Loading filesystem/filesystem.go +1 −1 Original line number Diff line number Diff line Loading @@ -264,7 +264,7 @@ func (f *filesystem) partitionName() string { func (f *filesystem) filterInstallablePackagingSpec(ps android.PackagingSpec) bool { // Filesystem module respects the installation semantic. A PackagingSpec from a module with // IsSkipInstall() is skipped. return !ps.SkipInstall() return !ps.SkipInstall() && (ps.Partition() == f.PartitionType()) } var pctx = android.NewPackageContext("android/soong/filesystem") Loading filesystem/filesystem_test.go +25 −0 Original line number Diff line number Diff line Loading @@ -584,3 +584,28 @@ func TestErofsPartition(t *testing.T) { android.AssertStringDoesContain(t, "erofs fs type compress hint", buildImageConfig, "erofs_default_compress_hints=compress_hints.txt") android.AssertStringDoesContain(t, "erofs fs type sparse", buildImageConfig, "erofs_sparse_flag=-s") } // If a system_ext/ module depends on system/ module, the dependency should *not* // be installed in system_ext/ func TestDoNotPackageCrossPartitionDependencies(t *testing.T) { result := fixture.RunTestWithBp(t, ` android_filesystem { name: "myfilesystem", deps: ["binfoo"], partition_type: "system_ext", } cc_binary { name: "binfoo", shared_libs: ["libfoo"], system_ext_specific: true, } cc_library_shared { name: "libfoo", // installed in system/ } `) partition := result.ModuleForTests("myfilesystem", "android_common") fileList := android.ContentFromFileRuleForTests(t, result.TestContext, partition.Output("fileList")) android.AssertDeepEquals(t, "filesystem with dependencies on different partition", "bin/binfoo\n", fileList) } filesystem/system_image.go +1 −1 Original line number Diff line number Diff line Loading @@ -103,6 +103,6 @@ func (s *systemImage) buildLinkerConfigFile(ctx android.ModuleContext, root andr // partition. Note that "apex" module installs its contents to "apex"(fake partition) as well // for symbol lookup by imitating "activated" paths. func (s *systemImage) filterPackagingSpec(ps android.PackagingSpec) bool { return s.filesystem.filterInstallablePackagingSpec(ps) && return !ps.SkipInstall() && (ps.Partition() == "system" || ps.Partition() == "root") } Loading
filesystem/filesystem.go +1 −1 Original line number Diff line number Diff line Loading @@ -264,7 +264,7 @@ func (f *filesystem) partitionName() string { func (f *filesystem) filterInstallablePackagingSpec(ps android.PackagingSpec) bool { // Filesystem module respects the installation semantic. A PackagingSpec from a module with // IsSkipInstall() is skipped. return !ps.SkipInstall() return !ps.SkipInstall() && (ps.Partition() == f.PartitionType()) } var pctx = android.NewPackageContext("android/soong/filesystem") Loading
filesystem/filesystem_test.go +25 −0 Original line number Diff line number Diff line Loading @@ -584,3 +584,28 @@ func TestErofsPartition(t *testing.T) { android.AssertStringDoesContain(t, "erofs fs type compress hint", buildImageConfig, "erofs_default_compress_hints=compress_hints.txt") android.AssertStringDoesContain(t, "erofs fs type sparse", buildImageConfig, "erofs_sparse_flag=-s") } // If a system_ext/ module depends on system/ module, the dependency should *not* // be installed in system_ext/ func TestDoNotPackageCrossPartitionDependencies(t *testing.T) { result := fixture.RunTestWithBp(t, ` android_filesystem { name: "myfilesystem", deps: ["binfoo"], partition_type: "system_ext", } cc_binary { name: "binfoo", shared_libs: ["libfoo"], system_ext_specific: true, } cc_library_shared { name: "libfoo", // installed in system/ } `) partition := result.ModuleForTests("myfilesystem", "android_common") fileList := android.ContentFromFileRuleForTests(t, result.TestContext, partition.Output("fileList")) android.AssertDeepEquals(t, "filesystem with dependencies on different partition", "bin/binfoo\n", fileList) }
filesystem/system_image.go +1 −1 Original line number Diff line number Diff line Loading @@ -103,6 +103,6 @@ func (s *systemImage) buildLinkerConfigFile(ctx android.ModuleContext, root andr // partition. Note that "apex" module installs its contents to "apex"(fake partition) as well // for symbol lookup by imitating "activated" paths. func (s *systemImage) filterPackagingSpec(ps android.PackagingSpec) bool { return s.filesystem.filterInstallablePackagingSpec(ps) && return !ps.SkipInstall() && (ps.Partition() == "system" || ps.Partition() == "root") }