Merge "Remove flatten_apex: property" am: 7f7e8d79a9

Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2628996

Change-Id: I89a052032341990256d608d6708b6d1ac8aceda9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-06-21 05:24:50 +00:00 committed by Automerger Merge Worker
commit d947550b6f
3 changed files with 6 additions and 52 deletions

View file

@ -23,11 +23,6 @@ package {
// TODO(b/236681553): Remove com.android.bluetooth-file_contexts
filegroup {
name: "apex_file_contexts_files",
srcs: ["*-file_contexts"],
}
filegroup {
name: "apex.test-file_contexts",
srcs: [

View file

@ -18,7 +18,6 @@ import (
"fmt"
"io"
"os"
"strings"
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
@ -50,15 +49,6 @@ type selinuxContextsProperties struct {
Recovery_available *bool
}
type fileContextsProperties struct {
// flatten_apex can be used to specify additional sources of file_contexts.
// Apex paths, /system/apex/{apex_name}, will be amended to the paths of file_contexts
// entries.
Flatten_apex struct {
Srcs []string `android:"path"`
}
}
type seappProperties struct {
// Files containing neverallow rules.
Neverallow_files []string `android:"path"`
@ -70,13 +60,12 @@ type seappProperties struct {
type selinuxContextsModule struct {
android.ModuleBase
properties selinuxContextsProperties
fileContextsProperties fileContextsProperties
seappProperties seappProperties
build func(ctx android.ModuleContext, inputs android.Paths) android.Path
deps func(ctx android.BottomUpMutatorContext)
outputPath android.Path
installPath android.InstallPath
properties selinuxContextsProperties
seappProperties seappProperties
build func(ctx android.ModuleContext, inputs android.Paths) android.Path
deps func(ctx android.BottomUpMutatorContext)
outputPath android.Path
installPath android.InstallPath
}
var (
@ -164,7 +153,6 @@ func newModule() *selinuxContextsModule {
m := &selinuxContextsModule{}
m.AddProperties(
&m.properties,
&m.fileContextsProperties,
&m.seappProperties,
)
android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibCommon)
@ -304,26 +292,6 @@ func (m *selinuxContextsModule) buildFileContexts(ctx android.ModuleContext, inp
if m.properties.Fc_sort == nil {
m.properties.Fc_sort = proptools.BoolPtr(true)
}
rule := android.NewRuleBuilder(pctx, ctx)
if ctx.Config().FlattenApex() {
for _, path := range android.PathsForModuleSrc(ctx, m.fileContextsProperties.Flatten_apex.Srcs) {
out := pathForModuleOut(ctx, "flattened_apex", path.Rel())
apex_path := "/system/apex/" + strings.Replace(
strings.TrimSuffix(path.Base(), "-file_contexts"),
".", "\\\\.", -1)
rule.Command().
Text("awk '/object_r/{printf(\""+apex_path+"%s\\n\",$0)}'").
Input(path).
FlagWithOutput("> ", out)
inputs = append(inputs, out)
}
}
rule.Build(m.Name(), "flattened_apex_file_contexts")
return m.buildGeneralContexts(ctx, inputs)
}

View file

@ -79,10 +79,6 @@ file_contexts {
srcs: [":file_contexts_overlayfs_files{.plat_private}"],
},
},
flatten_apex: {
srcs: [":apex_file_contexts_files"],
},
}
file_contexts {
@ -97,11 +93,6 @@ file_contexts {
srcs: [":file_contexts_overlayfs_files{.plat_private}"],
},
},
flatten_apex: {
srcs: [":apex_file_contexts_files"],
},
recovery: true,
}