summaryrefslogtreecommitdiff
path: root/apex/builder.go
diff options
context:
space:
mode:
author Jooyung Han <jooyung@google.com> 2023-11-14 13:52:51 +0900
committer Jooyung Han <jooyung@google.com> 2023-11-14 13:52:51 +0900
commitfed9cce4b638d3929b54b3cf2f851dbd432802ee (patch)
tree02b3e83e9c6f99d1c80c6c4baa7c1450123b133b /apex/builder.go
parent6f9522e4a8676a853e201c046eb5513b89c4a821 (diff)
Use vendor_file for vendor apex root
It was 'vendor_apex_metadata_file', but root directories can be simply labelled as 'vendor_file' so that linker can resolve paths in vendor apexes. Bug: 310528686 Test: m blueprint_tests Change-Id: I689b23efccb7be61980e791e185fcef28a76d9bc
Diffstat (limited to 'apex/builder.go')
-rw-r--r--apex/builder.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/apex/builder.go b/apex/builder.go
index afbfa1cf9..ba4df5f6b 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -372,12 +372,12 @@ func (a *apexBundle) buildFileContexts(ctx android.ModuleContext) android.Output
output := android.PathForModuleOut(ctx, "file_contexts")
rule := android.NewRuleBuilder(pctx, ctx)
- forceLabel := "u:object_r:system_file:s0"
+ labelForRoot := "u:object_r:system_file:s0"
+ labelForManifest := "u:object_r:system_file:s0"
if a.SocSpecific() && !a.vndkApex {
- // APEX on /vendor should label ./ and ./apex_manifest.pb as vendor_apex_metadata_file.
- // The reason why we skip VNDK APEX is that aosp_{pixel device} targets install VNDK APEX on /vendor
- // even though VNDK APEX is supposed to be installed on /system. (See com.android.vndk.current.on_vendor)
- forceLabel = "u:object_r:vendor_apex_metadata_file:s0"
+ // APEX on /vendor should label ./ and ./apex_manifest.pb as vendor file.
+ labelForRoot = "u:object_r:vendor_file:s0"
+ labelForManifest = "u:object_r:vendor_apex_metadata_file:s0"
}
// remove old file
rule.Command().Text("rm").FlagWithOutput("-f ", output)
@@ -387,8 +387,8 @@ func (a *apexBundle) buildFileContexts(ctx android.ModuleContext) android.Output
rule.Command().Text("echo").Text(">>").Output(output)
if !useFileContextsAsIs {
// force-label /apex_manifest.pb and /
- rule.Command().Text("echo").Text("/apex_manifest\\\\.pb").Text(forceLabel).Text(">>").Output(output)
- rule.Command().Text("echo").Text("/").Text(forceLabel).Text(">>").Output(output)
+ rule.Command().Text("echo").Text("/apex_manifest\\\\.pb").Text(labelForManifest).Text(">>").Output(output)
+ rule.Command().Text("echo").Text("/").Text(labelForRoot).Text(">>").Output(output)
}
rule.Build("file_contexts."+a.Name(), "Generate file_contexts")