summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2024-11-12 15:13:37 -0800
committer Cole Faust <colefaust@google.com> 2024-11-13 11:14:14 -0800
commit4385d3545cc7bf5bd6eb96ee01f68acece883a28 (patch)
treed0e47ec13fda6c4d6c45b27c84e0d7df4d26069d
parent059af370890f6b1f27ee956bc40fffb8496f8194 (diff)
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
-rw-r--r--Android.bp9
-rw-r--r--android/build_prop.go19
-rw-r--r--scripts/gen_build_prop.py2
3 files changed, 14 insertions, 16 deletions
diff --git a/Android.bp b/Android.bp
index 976362278..1219c626a 100644
--- a/Android.bp
+++ b/Android.bp
@@ -234,3 +234,12 @@ build_prop {
relative_install_path: "etc", // odm_dlkm/etc/build.prop
visibility: ["//visibility:private"],
}
+
+build_prop {
+ name: "ramdisk-build.prop",
+ stem: "build.prop",
+ ramdisk: true,
+ product_config: ":product_config",
+ relative_install_path: "etc/ramdisk", // ramdisk/system/etc/ramdisk/build.prop
+ visibility: ["//visibility:private"],
+}
diff --git a/android/build_prop.go b/android/build_prop.go
index 838947045..270e4dedc 100644
--- a/android/build_prop.go
+++ b/android/build_prop.go
@@ -115,21 +115,14 @@ func (p *buildPropModule) partition(config DeviceConfig) string {
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 @@ func (p *buildPropModule) GenerateAndroidBuildActions(ctx ModuleContext) {
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)
diff --git a/scripts/gen_build_prop.py b/scripts/gen_build_prop.py
index 0b7780e96..5f52d6f9e 100644
--- a/scripts/gen_build_prop.py
+++ b/scripts/gen_build_prop.py
@@ -608,7 +608,7 @@ def main():
build_product_prop(args)
case "vendor":
build_vendor_prop(args)
- case "system_dlkm" | "vendor_dlkm" | "odm_dlkm":
+ case "system_dlkm" | "vendor_dlkm" | "odm_dlkm" | "bootimage":
build_prop(args, gen_build_info=False, gen_common_build_props=True, variables=[])
case _:
sys.exit(f"not supported partition {args.partition}")