diff options
author | 2025-01-03 17:42:12 +0900 | |
---|---|---|
committer | 2025-01-03 17:42:12 +0900 | |
commit | 3ae653b84ed6afdec80b2fc5864d33b56040ae78 (patch) | |
tree | d0b669c719d5f5b1c37dda00923d03e74086599d /apex/builder.go | |
parent | e72fd2b5b3cae1b53b43992c2eddf11b87e40445 (diff) |
apex: pass partition tag to sepolicy tests
Vendor apex shouldn't use system_file_type contexts.
Bug: 387192232
Test: m
Change-Id: Icce6eeee147ffb4175ede2d56420483788103cb4
Diffstat (limited to 'apex/builder.go')
-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 c85d0a0ce..b74f4de1b 100644 --- a/apex/builder.go +++ b/apex/builder.go @@ -211,10 +211,10 @@ var ( apexSepolicyTestsRule = pctx.StaticRule("apexSepolicyTestsRule", blueprint.RuleParams{ Command: `${deapexer} --debugfs_path ${debugfs_static} list -Z ${in} > ${out}.fc` + - ` && ${apex_sepolicy_tests} -f ${out}.fc && touch ${out}`, + ` && ${apex_sepolicy_tests} -f ${out}.fc --partition ${partition_tag} && touch ${out}`, CommandDeps: []string{"${apex_sepolicy_tests}", "${deapexer}", "${debugfs_static}"}, Description: "run apex_sepolicy_tests", - }) + }, "partition_tag") apexLinkerconfigValidationRule = pctx.StaticRule("apexLinkerconfigValidationRule", blueprint.RuleParams{ Command: `${conv_linker_config} validate --type apex ${image_dir} && touch ${out}`, @@ -920,7 +920,7 @@ func (a *apexBundle) buildApex(ctx android.ModuleContext) { validations = append(validations, runApexLinkerconfigValidation(ctx, unsignedOutputFile, imageDir)) // TODO(b/279688635) deapexer supports [ext4] if !a.skipValidation(apexSepolicyTests) && suffix == imageApexSuffix && ext4 == a.payloadFsType { - validations = append(validations, runApexSepolicyTests(ctx, unsignedOutputFile)) + validations = append(validations, runApexSepolicyTests(ctx, a, unsignedOutputFile)) } if !a.testApex && len(a.properties.Unwanted_transitive_deps) > 0 { validations = append(validations, @@ -1206,12 +1206,15 @@ func runApexLinkerconfigValidation(ctx android.ModuleContext, apexFile android.P // // $ deapexer list -Z {apex_file} > {file_contexts} // $ apex_sepolicy_tests -f {file_contexts} -func runApexSepolicyTests(ctx android.ModuleContext, apexFile android.Path) android.Path { +func runApexSepolicyTests(ctx android.ModuleContext, a *apexBundle, apexFile android.Path) android.Path { timestamp := android.PathForModuleOut(ctx, "apex_sepolicy_tests.timestamp") ctx.Build(pctx, android.BuildParams{ Rule: apexSepolicyTestsRule, Input: apexFile, Output: timestamp, + Args: map[string]string{ + "partition_tag": a.PartitionTag(ctx.DeviceConfig()), + }, }) return timestamp } |