Merge "Remove flatten_apex: property" am: 7f7e8d79a9
am: d947550b6f
am: a7627cf627
am: 8743379791
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2628996 Change-Id: Id40e5c554b935ab730925b4328e84753c2d721b3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
2e5e101971
3 changed files with 6 additions and 52 deletions
|
@ -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: [
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue