diff options
author | 2024-10-14 18:20:14 +0900 | |
---|---|---|
committer | 2024-10-14 18:24:44 +0900 | |
commit | b6ac822b856e4966a8b9836a912bcbec098c26a6 (patch) | |
tree | 789873aaf015f57d0c9331cd03f3adf87a6206ff /apex | |
parent | 8017cca9eaabc14ffda4c8fcfc04b5ef7c047ace (diff) |
apex: pass partition_tag to host_apex_verifier
host_apex_verifier can check partition-specific checks. For example,
.rc files in APEX don't support 'on' if the APEX is from /system.
To support this, pass the partition tag to host_apex_verifier.
Bug: 223896570
Test: m
Test: host_apex_verifier --apex=<path> --partition_tag=system
# fails when the apex has .rc file with 'on' section.
Change-Id: I62141aad5823cedb114434fd19bed5d31f6c3bbc
Diffstat (limited to 'apex')
-rw-r--r-- | apex/builder.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/apex/builder.go b/apex/builder.go index 371d7d527..c244b2532 100644 --- a/apex/builder.go +++ b/apex/builder.go @@ -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`, @@ -976,7 +976,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, @@ -1287,12 +1287,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 } |