Loading Android.bp +3 −2 Original line number Diff line number Diff line Loading @@ -175,6 +175,7 @@ build_prop { // Currently, only microdroid, Ravenwood, and cf system image can refer to system-build.prop visibility: [ "//build/make/target/product/generic", "//build/make/target/product/gsi", "//packages/modules/Virtualization/build/microdroid", "//frameworks/base/ravenwood", ], Loading @@ -186,7 +187,7 @@ build_prop { system_ext_specific: true, product_config: ":product_config", relative_install_path: "etc", // system_ext/etc/build.prop visibility: ["//visibility:private"], visibility: ["//build/make/target/product/gsi"], } build_prop { Loading @@ -195,7 +196,7 @@ build_prop { product_specific: true, product_config: ":product_config", relative_install_path: "etc", // product/etc/build.prop visibility: ["//visibility:private"], visibility: ["//build/make/target/product/gsi"], } build_prop { Loading android/packaging.go +16 −1 Original line number Diff line number Diff line Loading @@ -165,6 +165,10 @@ func (p *PackagingSpec) Partition() string { return p.partition } func (p *PackagingSpec) SetPartition(partition string) { p.partition = partition } func (p *PackagingSpec) SkipInstall() bool { return p.skipInstall } Loading @@ -186,6 +190,7 @@ type PackageModule interface { // GatherPackagingSpecs gathers PackagingSpecs of transitive dependencies. GatherPackagingSpecs(ctx ModuleContext) map[string]PackagingSpec GatherPackagingSpecsWithFilter(ctx ModuleContext, filter func(PackagingSpec) bool) map[string]PackagingSpec GatherPackagingSpecsWithFilterAndModifier(ctx ModuleContext, filter func(PackagingSpec) bool, modifier func(*PackagingSpec)) map[string]PackagingSpec // CopyDepsToZip zips the built artifacts of the dependencies into the given zip file and // returns zip entries in it. This is expected to be called in GenerateAndroidBuildActions, Loading Loading @@ -444,7 +449,8 @@ func (p *PackagingBase) AddDeps(ctx BottomUpMutatorContext, depTag blueprint.Dep } } func (p *PackagingBase) GatherPackagingSpecsWithFilter(ctx ModuleContext, filter func(PackagingSpec) bool) map[string]PackagingSpec { // See PackageModule.GatherPackagingSpecs func (p *PackagingBase) GatherPackagingSpecsWithFilterAndModifier(ctx ModuleContext, filter func(PackagingSpec) bool, modifier func(*PackagingSpec)) map[string]PackagingSpec { // packaging specs gathered from the dep that are not high priorities. var regularPriorities []PackagingSpec Loading Loading @@ -491,6 +497,10 @@ func (p *PackagingBase) GatherPackagingSpecsWithFilter(ctx ModuleContext, filter } } if modifier != nil { modifier(&ps) } if _, ok := depTag.(highPriorityDepTag); ok { highPriorities = append(highPriorities, ps) } else { Loading Loading @@ -551,6 +561,11 @@ func (p *PackagingBase) GatherPackagingSpecsWithFilter(ctx ModuleContext, filter return m } // See PackageModule.GatherPackagingSpecs func (p *PackagingBase) GatherPackagingSpecsWithFilter(ctx ModuleContext, filter func(PackagingSpec) bool) map[string]PackagingSpec { return p.GatherPackagingSpecsWithFilterAndModifier(ctx, filter, nil) } // See PackageModule.GatherPackagingSpecs func (p *PackagingBase) GatherPackagingSpecs(ctx ModuleContext) map[string]PackagingSpec { return p.GatherPackagingSpecsWithFilter(ctx, nil) Loading compliance/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -35,5 +35,6 @@ notice_xml { partition_name: "system", visibility: [ "//build/make/target/product/generic", "//build/make/target/product/gsi", ], } filesystem/filesystem.go +10 −8 Original line number Diff line number Diff line Loading @@ -67,6 +67,10 @@ type filesystemBuilder interface { BuildLinkerConfigFile(ctx android.ModuleContext, builder *android.RuleBuilder, rebasedDir android.OutputPath) // Function that filters PackagingSpec in PackagingBase.GatherPackagingSpecs() FilterPackagingSpec(spec android.PackagingSpec) bool // Function that modifies PackagingSpec in PackagingBase.GatherPackagingSpecs() to customize. // For example, GSI system.img contains system_ext and product artifacts and their // relPathInPackage need to be rebased to system/system_ext and system/system_product. ModifyPackagingSpec(spec *android.PackagingSpec) } var _ filesystemBuilder = (*filesystem)(nil) Loading Loading @@ -302,6 +306,10 @@ func (f *filesystem) FilterPackagingSpec(ps android.PackagingSpec) bool { return true } func (f *filesystem) ModifyPackagingSpec(ps *android.PackagingSpec) { // do nothing by default } var pctx = android.NewPackageContext("android/soong/filesystem") func (f *filesystem) GenerateAndroidBuildActions(ctx android.ModuleContext) { Loading Loading @@ -792,7 +800,7 @@ func (f *filesystem) SignedOutputPath() android.Path { // Note that "apex" module installs its contents to "apex"(fake partition) as well // for symbol lookup by imitating "activated" paths. func (f *filesystem) gatherFilteredPackagingSpecs(ctx android.ModuleContext) map[string]android.PackagingSpec { specs := f.PackagingBase.GatherPackagingSpecsWithFilter(ctx, f.filesystemBuilder.FilterPackagingSpec) specs := f.PackagingBase.GatherPackagingSpecsWithFilterAndModifier(ctx, f.filesystemBuilder.FilterPackagingSpec, f.filesystemBuilder.ModifyPackagingSpec) return specs } Loading @@ -818,13 +826,7 @@ type filesystemDefaults struct { android.ModuleBase android.DefaultsModuleBase properties filesystemDefaultsProperties } type filesystemDefaultsProperties struct { // Identifies which partition this is for //visibility:any_system_image (and others) visibility // checks, and will be used in the future for API surface checks. Partition_type *string properties FilesystemProperties } // android_filesystem_defaults is a default module for android_filesystem and android_system_image Loading filesystem/system_image.go +13 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,9 @@ import ( "android/soong/android" "android/soong/linkerconfig" "path/filepath" "strings" "github.com/google/blueprint/proptools" ) Loading Loading @@ -58,5 +61,14 @@ func (s *systemImage) BuildLinkerConfigFile(ctx android.ModuleContext, builder * // for symbol lookup by imitating "activated" paths. func (s *systemImage) FilterPackagingSpec(ps android.PackagingSpec) bool { return !ps.SkipInstall() && (ps.Partition() == "system" || ps.Partition() == "root") (ps.Partition() == "system" || ps.Partition() == "root" || strings.HasPrefix(ps.Partition(), "system/")) } func (s *systemImage) ModifyPackagingSpec(ps *android.PackagingSpec) { if strings.HasPrefix(ps.Partition(), "system/") { subPartition := strings.TrimPrefix(ps.Partition(), "system/") ps.SetPartition("system") ps.SetRelPathInPackage(filepath.Join(subPartition, ps.RelPathInPackage())) } } Loading
Android.bp +3 −2 Original line number Diff line number Diff line Loading @@ -175,6 +175,7 @@ build_prop { // Currently, only microdroid, Ravenwood, and cf system image can refer to system-build.prop visibility: [ "//build/make/target/product/generic", "//build/make/target/product/gsi", "//packages/modules/Virtualization/build/microdroid", "//frameworks/base/ravenwood", ], Loading @@ -186,7 +187,7 @@ build_prop { system_ext_specific: true, product_config: ":product_config", relative_install_path: "etc", // system_ext/etc/build.prop visibility: ["//visibility:private"], visibility: ["//build/make/target/product/gsi"], } build_prop { Loading @@ -195,7 +196,7 @@ build_prop { product_specific: true, product_config: ":product_config", relative_install_path: "etc", // product/etc/build.prop visibility: ["//visibility:private"], visibility: ["//build/make/target/product/gsi"], } build_prop { Loading
android/packaging.go +16 −1 Original line number Diff line number Diff line Loading @@ -165,6 +165,10 @@ func (p *PackagingSpec) Partition() string { return p.partition } func (p *PackagingSpec) SetPartition(partition string) { p.partition = partition } func (p *PackagingSpec) SkipInstall() bool { return p.skipInstall } Loading @@ -186,6 +190,7 @@ type PackageModule interface { // GatherPackagingSpecs gathers PackagingSpecs of transitive dependencies. GatherPackagingSpecs(ctx ModuleContext) map[string]PackagingSpec GatherPackagingSpecsWithFilter(ctx ModuleContext, filter func(PackagingSpec) bool) map[string]PackagingSpec GatherPackagingSpecsWithFilterAndModifier(ctx ModuleContext, filter func(PackagingSpec) bool, modifier func(*PackagingSpec)) map[string]PackagingSpec // CopyDepsToZip zips the built artifacts of the dependencies into the given zip file and // returns zip entries in it. This is expected to be called in GenerateAndroidBuildActions, Loading Loading @@ -444,7 +449,8 @@ func (p *PackagingBase) AddDeps(ctx BottomUpMutatorContext, depTag blueprint.Dep } } func (p *PackagingBase) GatherPackagingSpecsWithFilter(ctx ModuleContext, filter func(PackagingSpec) bool) map[string]PackagingSpec { // See PackageModule.GatherPackagingSpecs func (p *PackagingBase) GatherPackagingSpecsWithFilterAndModifier(ctx ModuleContext, filter func(PackagingSpec) bool, modifier func(*PackagingSpec)) map[string]PackagingSpec { // packaging specs gathered from the dep that are not high priorities. var regularPriorities []PackagingSpec Loading Loading @@ -491,6 +497,10 @@ func (p *PackagingBase) GatherPackagingSpecsWithFilter(ctx ModuleContext, filter } } if modifier != nil { modifier(&ps) } if _, ok := depTag.(highPriorityDepTag); ok { highPriorities = append(highPriorities, ps) } else { Loading Loading @@ -551,6 +561,11 @@ func (p *PackagingBase) GatherPackagingSpecsWithFilter(ctx ModuleContext, filter return m } // See PackageModule.GatherPackagingSpecs func (p *PackagingBase) GatherPackagingSpecsWithFilter(ctx ModuleContext, filter func(PackagingSpec) bool) map[string]PackagingSpec { return p.GatherPackagingSpecsWithFilterAndModifier(ctx, filter, nil) } // See PackageModule.GatherPackagingSpecs func (p *PackagingBase) GatherPackagingSpecs(ctx ModuleContext) map[string]PackagingSpec { return p.GatherPackagingSpecsWithFilter(ctx, nil) Loading
compliance/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -35,5 +35,6 @@ notice_xml { partition_name: "system", visibility: [ "//build/make/target/product/generic", "//build/make/target/product/gsi", ], }
filesystem/filesystem.go +10 −8 Original line number Diff line number Diff line Loading @@ -67,6 +67,10 @@ type filesystemBuilder interface { BuildLinkerConfigFile(ctx android.ModuleContext, builder *android.RuleBuilder, rebasedDir android.OutputPath) // Function that filters PackagingSpec in PackagingBase.GatherPackagingSpecs() FilterPackagingSpec(spec android.PackagingSpec) bool // Function that modifies PackagingSpec in PackagingBase.GatherPackagingSpecs() to customize. // For example, GSI system.img contains system_ext and product artifacts and their // relPathInPackage need to be rebased to system/system_ext and system/system_product. ModifyPackagingSpec(spec *android.PackagingSpec) } var _ filesystemBuilder = (*filesystem)(nil) Loading Loading @@ -302,6 +306,10 @@ func (f *filesystem) FilterPackagingSpec(ps android.PackagingSpec) bool { return true } func (f *filesystem) ModifyPackagingSpec(ps *android.PackagingSpec) { // do nothing by default } var pctx = android.NewPackageContext("android/soong/filesystem") func (f *filesystem) GenerateAndroidBuildActions(ctx android.ModuleContext) { Loading Loading @@ -792,7 +800,7 @@ func (f *filesystem) SignedOutputPath() android.Path { // Note that "apex" module installs its contents to "apex"(fake partition) as well // for symbol lookup by imitating "activated" paths. func (f *filesystem) gatherFilteredPackagingSpecs(ctx android.ModuleContext) map[string]android.PackagingSpec { specs := f.PackagingBase.GatherPackagingSpecsWithFilter(ctx, f.filesystemBuilder.FilterPackagingSpec) specs := f.PackagingBase.GatherPackagingSpecsWithFilterAndModifier(ctx, f.filesystemBuilder.FilterPackagingSpec, f.filesystemBuilder.ModifyPackagingSpec) return specs } Loading @@ -818,13 +826,7 @@ type filesystemDefaults struct { android.ModuleBase android.DefaultsModuleBase properties filesystemDefaultsProperties } type filesystemDefaultsProperties struct { // Identifies which partition this is for //visibility:any_system_image (and others) visibility // checks, and will be used in the future for API surface checks. Partition_type *string properties FilesystemProperties } // android_filesystem_defaults is a default module for android_filesystem and android_system_image Loading
filesystem/system_image.go +13 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,9 @@ import ( "android/soong/android" "android/soong/linkerconfig" "path/filepath" "strings" "github.com/google/blueprint/proptools" ) Loading Loading @@ -58,5 +61,14 @@ func (s *systemImage) BuildLinkerConfigFile(ctx android.ModuleContext, builder * // for symbol lookup by imitating "activated" paths. func (s *systemImage) FilterPackagingSpec(ps android.PackagingSpec) bool { return !ps.SkipInstall() && (ps.Partition() == "system" || ps.Partition() == "root") (ps.Partition() == "system" || ps.Partition() == "root" || strings.HasPrefix(ps.Partition(), "system/")) } func (s *systemImage) ModifyPackagingSpec(ps *android.PackagingSpec) { if strings.HasPrefix(ps.Partition(), "system/") { subPartition := strings.TrimPrefix(ps.Partition(), "system/") ps.SetPartition("system") ps.SetRelPathInPackage(filepath.Join(subPartition, ps.RelPathInPackage())) } }