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

Commit f313fd99 authored by Jooyung Han's avatar Jooyung Han Committed by Gerrit Code Review
Browse files

Merge "apex: pass partition_tag to host_apex_verifier" into main

parents 54bfc97e b6ac822b
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -253,10 +253,10 @@ var (

	apexHostVerifierRule = pctx.StaticRule("apexHostVerifierRule", blueprint.RuleParams{
		Command: `${host_apex_verifier} --deapexer=${deapexer} --debugfs=${debugfs_static} ` +
			`--fsckerofs=${fsck_erofs} --apex=${in} && touch ${out}`,
			`--fsckerofs=${fsck_erofs} --apex=${in} --partition_tag=${partition_tag} && touch ${out}`,
		CommandDeps: []string{"${host_apex_verifier}", "${deapexer}", "${debugfs_static}", "${fsck_erofs}"},
		Description: "run host_apex_verifier",
	})
	}, "partition_tag")

	assembleVintfRule = pctx.StaticRule("assembleVintfRule", blueprint.RuleParams{
		Command:     `rm -f $out && VINTF_IGNORE_TARGET_FCM_VERSION=true ${assemble_vintf} -i $in -o $out`,
@@ -977,7 +977,7 @@ func (a *apexBundle) buildApex(ctx android.ModuleContext) {
			runApexElfCheckerUnwanted(ctx, unsignedOutputFile.OutputPath, a.properties.Unwanted_transitive_deps))
	}
	if !a.testApex && android.InList(a.payloadFsType, []fsType{ext4, erofs}) {
		validations = append(validations, runApexHostVerifier(ctx, unsignedOutputFile.OutputPath))
		validations = append(validations, runApexHostVerifier(ctx, a, unsignedOutputFile.OutputPath))
	}
	ctx.Build(pctx, android.BuildParams{
		Rule:        rule,
@@ -1288,12 +1288,15 @@ func runApexElfCheckerUnwanted(ctx android.ModuleContext, apexFile android.Outpu
	return timestamp
}

func runApexHostVerifier(ctx android.ModuleContext, apexFile android.OutputPath) android.Path {
func runApexHostVerifier(ctx android.ModuleContext, a *apexBundle, apexFile android.OutputPath) android.Path {
	timestamp := android.PathForModuleOut(ctx, "host_apex_verifier.timestamp")
	ctx.Build(pctx, android.BuildParams{
		Rule:   apexHostVerifierRule,
		Input:  apexFile,
		Output: timestamp,
		Args: map[string]string{
			"partition_tag": a.PartitionTag(ctx.DeviceConfig()),
		},
	})
	return timestamp
}