Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 519015f9 authored by Nikita Ioffe's avatar Nikita Ioffe
Browse files

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
parent 5482a833
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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").