Add _bootconfig file to target_files.zip
Bug: 385383524
Test: diff'd the target_files.zip created by make and soong
Change-Id: Ifbce0a0831d76eaf98c289a7f158cd67220c016d
diff --git a/filesystem/android_device.go b/filesystem/android_device.go
index 52d3091..049e298 100644
--- a/filesystem/android_device.go
+++ b/filesystem/android_device.go
@@ -178,6 +178,9 @@
if bootImgInfo.Dtb != nil {
builder.Command().Textf("cp %s %s/VENDOR_BOOT/dtb", bootImgInfo.Dtb, targetFilesDir)
}
+ if bootImgInfo.Bootconfig != nil {
+ builder.Command().Textf("cp %s %s/VENDOR_BOOT/vendor_bootconfig", bootImgInfo.Bootconfig, targetFilesDir)
+ }
}
if a.partitionProps.Boot_partition_name != nil {
bootImg := ctx.GetDirectDepWithTag(proptools.String(a.partitionProps.Boot_partition_name), filesystemDepTag)
@@ -191,6 +194,9 @@
// Even though kernel is not used to build vendor_boot, copy the kernel to VENDOR_BOOT to match the behavior of make packaging.
builder.Command().Textf("cp %s %s/VENDOR_BOOT/kernel", bootImgInfo.Kernel, targetFilesDir)
}
+ if bootImgInfo.Bootconfig != nil {
+ builder.Command().Textf("cp %s %s/BOOT/bootconfig", bootImgInfo.Bootconfig, targetFilesDir)
+ }
}
builder.Command().
diff --git a/filesystem/bootimg.go b/filesystem/bootimg.go
index f4e01a8..0a3a177 100644
--- a/filesystem/bootimg.go
+++ b/filesystem/bootimg.go
@@ -231,18 +231,20 @@
// Set BootimgInfo for building target_files.zip
android.SetProvider(ctx, BootimgInfoProvider, BootimgInfo{
- Cmdline: b.properties.Cmdline,
- Kernel: b.getKernelPath(ctx),
- Dtb: b.getDtbPath(ctx),
+ Cmdline: b.properties.Cmdline,
+ Kernel: b.getKernelPath(ctx),
+ Dtb: b.getDtbPath(ctx),
+ Bootconfig: b.getBootconfigPath(ctx),
})
}
var BootimgInfoProvider = blueprint.NewProvider[BootimgInfo]()
type BootimgInfo struct {
- Cmdline []string
- Kernel android.Path
- Dtb android.Path
+ Cmdline []string
+ Kernel android.Path
+ Dtb android.Path
+ Bootconfig android.Path
}
func (b *bootimg) getKernelPath(ctx android.ModuleContext) android.Path {
@@ -263,6 +265,15 @@
return dtbPath
}
+func (b *bootimg) getBootconfigPath(ctx android.ModuleContext) android.Path {
+ var bootconfigPath android.Path
+ bootconfigName := proptools.String(b.properties.Bootconfig)
+ if bootconfigName != "" {
+ bootconfigPath = android.PathForModuleSrc(ctx, bootconfigName)
+ }
+ return bootconfigPath
+}
+
func (b *bootimg) buildBootImage(ctx android.ModuleContext, kernel android.Path) android.Path {
output := android.PathForModuleOut(ctx, "unsigned", b.installFileName())