diff options
| -rw-r--r-- | apex/apex.go | 14 | ||||
| -rw-r--r-- | apex/apex_test.go | 34 | ||||
| -rw-r--r-- | cc/config/global.go | 4 | ||||
| -rw-r--r-- | ui/build/paths/config.go | 6 |
4 files changed, 48 insertions, 10 deletions
diff --git a/apex/apex.go b/apex/apex.go index 0445c205e..5ce0e0573 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -136,7 +136,7 @@ func init() { pctx.HostBinToolVariable("zip2zip", "zip2zip") pctx.HostBinToolVariable("zipalign", "zipalign") - android.RegisterModuleType("apex", apexBundleFactory) + android.RegisterModuleType("apex", ApexBundleFactory) android.PostDepsMutators(func(ctx android.RegisterMutatorsContext) { ctx.TopDown("apex_deps", apexDepsMutator) @@ -684,8 +684,14 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext, keyFile and } else { readOnlyPaths = append(readOnlyPaths, pathInApex) } - if !android.InList(f.installDir, executablePaths) { - executablePaths = append(executablePaths, f.installDir) + dir := f.installDir + for !android.InList(dir, executablePaths) && dir != "" { + executablePaths = append(executablePaths, dir) + dir, _ = filepath.Split(dir) // move up to the parent + if len(dir) > 0 { + // remove trailing slash + dir = dir[:len(dir)-1] + } } } sort.Strings(readOnlyPaths) @@ -871,7 +877,7 @@ func (a *apexBundle) androidMkForType(apexType apexPackaging) android.AndroidMkD } } -func apexBundleFactory() android.Module { +func ApexBundleFactory() android.Module { module := &apexBundle{ outputFiles: map[apexPackaging]android.WritablePath{}, } diff --git a/apex/apex_test.go b/apex/apex_test.go index d1794ee5c..c7ef58efa 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -28,7 +28,7 @@ func testApex(t *testing.T, bp string) *android.TestContext { defer teardown(buildDir) ctx := android.NewTestArchContext() - ctx.RegisterModuleType("apex", android.ModuleFactoryAdaptor(apexBundleFactory)) + ctx.RegisterModuleType("apex", android.ModuleFactoryAdaptor(ApexBundleFactory)) ctx.RegisterModuleType("apex_key", android.ModuleFactoryAdaptor(apexKeyFactory)) ctx.PostDepsMutators(func(ctx android.RegisterMutatorsContext) { @@ -40,6 +40,7 @@ func testApex(t *testing.T, bp string) *android.TestContext { ctx.RegisterModuleType("cc_library_shared", android.ModuleFactoryAdaptor(cc.LibrarySharedFactory)) ctx.RegisterModuleType("cc_object", android.ModuleFactoryAdaptor(cc.ObjectFactory)) ctx.RegisterModuleType("toolchain_library", android.ModuleFactoryAdaptor(cc.ToolchainLibraryFactory)) + ctx.RegisterModuleType("prebuilt_etc", android.ModuleFactoryAdaptor(android.PrebuiltEtcFactory)) ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) { ctx.BottomUp("link", cc.LinkageMutator).Parallel() ctx.BottomUp("version", cc.VersionMutator).Parallel() @@ -94,6 +95,7 @@ func testApex(t *testing.T, bp string) *android.TestContext { "apex_manifest.json": nil, "system/sepolicy/apex/myapex-file_contexts": nil, "mylib.cpp": nil, + "myprebuilt": nil, }) _, errs := ctx.ParseFileList(".", []string{"Android.bp"}) android.FailIfErrored(t, errs) @@ -415,3 +417,33 @@ func TestApexWithSystemLibsStubs(t *testing.T) { ensureContains(t, mylibCFlags, "__LIBDL_API__=27") ensureContains(t, mylibSharedCFlags, "__LIBDL_API__=27") } + +func TestFilesInSubDir(t *testing.T) { + ctx := testApex(t, ` + apex { + name: "myapex", + key: "myapex.key", + prebuilts: ["myetc"], + } + + apex_key { + name: "myapex.key", + public_key: "testkey.avbpubkey", + private_key: "testkey.pem", + } + + prebuilt_etc { + name: "myetc", + src: "myprebuilt", + sub_dir: "foo/bar", + } + `) + + generateFsRule := ctx.ModuleForTests("myapex", "android_common_myapex").Rule("generateFsConfig") + dirs := strings.Split(generateFsRule.Args["exec_paths"], " ") + + // Ensure that etc, etc/foo, and etc/foo/bar are all listed + ensureListContains(t, dirs, "etc") + ensureListContains(t, dirs, "etc/foo") + ensureListContains(t, dirs, "etc/foo/bar") +} diff --git a/cc/config/global.go b/cc/config/global.go index 92969b0b7..13ad27cd5 100644 --- a/cc/config/global.go +++ b/cc/config/global.go @@ -120,8 +120,8 @@ var ( // prebuilts/clang default settings. ClangDefaultBase = "prebuilts/clang/host" - ClangDefaultVersion = "clang-r346389" - ClangDefaultShortVersion = "8.0.5" + ClangDefaultVersion = "clang-r346389b" + ClangDefaultShortVersion = "8.0.6" // Directories with warnings from Android.bp files. WarningAllowedProjects = []string{ diff --git a/ui/build/paths/config.go b/ui/build/paths/config.go index 12daee365..592c2eb55 100644 --- a/ui/build/paths/config.go +++ b/ui/build/paths/config.go @@ -84,7 +84,6 @@ var Configuration = map[string]PathConfig{ "date": Allowed, "dd": Allowed, "diff": Allowed, - "dirname": Allowed, "du": Allowed, "echo": Allowed, "egrep": Allowed, @@ -96,7 +95,6 @@ var Configuration = map[string]PathConfig{ "git": Allowed, "grep": Allowed, "gzip": Allowed, - "head": Allowed, "hexdump": Allowed, "hostname": Allowed, "jar": Allowed, @@ -107,7 +105,6 @@ var Configuration = map[string]PathConfig{ "lsof": Allowed, "m4": Allowed, "md5sum": Allowed, - "mkdir": Allowed, "mktemp": Allowed, "mv": Allowed, "openssl": Allowed, @@ -161,8 +158,11 @@ var Configuration = map[string]PathConfig{ "cat": Toybox, "cmp": Toybox, "comm": Toybox, + "dirname": Toybox, "env": Toybox, + "head": Toybox, "id": Toybox, + "mkdir": Toybox, "od": Toybox, "paste": Toybox, "pwd": Toybox, |