From 519015f99dd19328e806e0ce363d3c1005436f32 Mon Sep 17 00:00:00 2001 From: Nikita Ioffe Date: Fri, 23 Dec 2022 15:36:29 +0000 Subject: [PATCH] Run host_init_verifier when building filesystem As part of building Android images we run host_init_verifier to ensure that .rc files are well-formed. Unfortunately that doesn't cover the Microdroid image. This change addresses the divergence. Ideally we should have a concept of pluggable linters that we can run on the generated image. However, introducing such concept will take some time, so while we are working on it directly integrate host_init_verifier into the build system. Bug: 263486078 Test: m microdroid Test: add incorrect .rc file and run m microdroid, verify it fails Change-Id: Id8c9311915e89a10ce3ff7b1f209ebc8cb42211f --- filesystem/filesystem.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index e123f24f9..d01608f33 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -264,6 +264,14 @@ func (f *filesystem) buildImageUsingBuildImage(ctx android.ModuleContext) androi Input(rootZip). Input(rebasedDepsZip) + // run host_init_verifier + // Ideally we should have a concept of pluggable linters that verify the generated image. + // While such concept is not implement this will do. + // TODO(b/263574231): substitute with pluggable linter. + builder.Command(). + BuiltTool("host_init_verifier"). + FlagWithArg("--out_system=", rootDir.String()+"/system") + propFile, toolDeps := f.buildPropFile(ctx) output := android.PathForModuleOut(ctx, f.installFileName()).OutputPath builder.Command().BuiltTool("build_image").