Merge "Use vendor_file for vendor apex root" into main
This commit is contained in:
@@ -372,12 +372,12 @@ func (a *apexBundle) buildFileContexts(ctx android.ModuleContext) android.Output
|
|||||||
output := android.PathForModuleOut(ctx, "file_contexts")
|
output := android.PathForModuleOut(ctx, "file_contexts")
|
||||||
rule := android.NewRuleBuilder(pctx, ctx)
|
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 {
|
if a.SocSpecific() && !a.vndkApex {
|
||||||
// APEX on /vendor should label ./ and ./apex_manifest.pb as vendor_apex_metadata_file.
|
// APEX on /vendor should label ./ and ./apex_manifest.pb as vendor file.
|
||||||
// The reason why we skip VNDK APEX is that aosp_{pixel device} targets install VNDK APEX on /vendor
|
labelForRoot = "u:object_r:vendor_file:s0"
|
||||||
// even though VNDK APEX is supposed to be installed on /system. (See com.android.vndk.current.on_vendor)
|
labelForManifest = "u:object_r:vendor_apex_metadata_file:s0"
|
||||||
forceLabel = "u:object_r:vendor_apex_metadata_file:s0"
|
|
||||||
}
|
}
|
||||||
// remove old file
|
// remove old file
|
||||||
rule.Command().Text("rm").FlagWithOutput("-f ", output)
|
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)
|
rule.Command().Text("echo").Text(">>").Output(output)
|
||||||
if !useFileContextsAsIs {
|
if !useFileContextsAsIs {
|
||||||
// force-label /apex_manifest.pb and /
|
// force-label /apex_manifest.pb and /
|
||||||
rule.Command().Text("echo").Text("/apex_manifest\\\\.pb").Text(forceLabel).Text(">>").Output(output)
|
rule.Command().Text("echo").Text("/apex_manifest\\\\.pb").Text(labelForManifest).Text(">>").Output(output)
|
||||||
rule.Command().Text("echo").Text("/").Text(forceLabel).Text(">>").Output(output)
|
rule.Command().Text("echo").Text("/").Text(labelForRoot).Text(">>").Output(output)
|
||||||
}
|
}
|
||||||
|
|
||||||
rule.Build("file_contexts."+a.Name(), "Generate file_contexts")
|
rule.Build("file_contexts."+a.Name(), "Generate file_contexts")
|
||||||
|
Reference in New Issue
Block a user