Build ramdisk's build.prop with soong
Following the same pattern as existing soong build.props, but with
minor tweaks for ramdisk such as making the partition "bootimage".
Bug: 378146476
Test: Diff'd out/target/product/vsoc_x86_64/ramdisk/system/etc/ramdisk/build.prop before and after this cl
Change-Id: I7ab2621d78c28deb73628bc455e040247a3c8031
diff --git a/android/build_prop.go b/android/build_prop.go
index 8389470..270e4de 100644
--- a/android/build_prop.go
+++ b/android/build_prop.go
@@ -115,21 +115,14 @@
return "vendor_dlkm"
} else if p.InstallInOdmDlkm() {
return "odm_dlkm"
+ } else if p.InstallInRamdisk() {
+ // From this hardcoding in make:
+ // https://cs.android.com/android/platform/superproject/main/+/main:build/make/core/sysprop.mk;l=311;drc=274435657e4682e5cee3fffd11fb301ab32a828d
+ return "bootimage"
}
return "system"
}
-var validPartitions = []string{
- "system",
- "system_ext",
- "product",
- "odm",
- "vendor",
- "system_dlkm",
- "vendor_dlkm",
- "odm_dlkm",
-}
-
func (p *buildPropModule) GenerateAndroidBuildActions(ctx ModuleContext) {
if !p.SocSpecific() && p.properties.Android_info != nil {
ctx.ModuleErrorf("Android_info cannot be set if build.prop is not installed in vendor partition")
@@ -138,10 +131,6 @@
p.outputFilePath = PathForModuleOut(ctx, "build.prop").OutputPath
partition := p.partition(ctx.DeviceConfig())
- if !InList(partition, validPartitions) {
- ctx.PropertyErrorf("partition", "unsupported partition %q: only %q are supported", partition, validPartitions)
- return
- }
rule := NewRuleBuilder(pctx, ctx)