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
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index e123f24..d01608f 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -264,6 +264,14 @@
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").