From 16e77a9b303a71018eb6630f12f1414cd6ad615c Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Mon, 30 Aug 2021 18:43:19 +0900 Subject: [PATCH] cmdline property in bootimg can be customized for debuggable builds This change adds product_variables.debuggable.cmdline so that the kernel cmdline arguments can be augmented for the debuggable builds. To support that the type of the property has changed to string array. Bug: 181936135 Test: inspect build.ninja Change-Id: I81b3ead5187ccb378efabb87d1d15fbdb59d8e2f --- android/variable.go | 2 ++ filesystem/bootimg.go | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/android/variable.go b/android/variable.go index 5cf9aa8e8..9d7c1e624 100644 --- a/android/variable.go +++ b/android/variable.go @@ -108,6 +108,8 @@ type variableProperties struct { Static_libs []string Whole_static_libs []string Shared_libs []string + + Cmdline []string } // eng is true for -eng builds, and can be used to turn on additionaly heavyweight debugging diff --git a/filesystem/bootimg.go b/filesystem/bootimg.go index 29a8a3944..73d807dbf 100644 --- a/filesystem/bootimg.go +++ b/filesystem/bootimg.go @@ -60,8 +60,8 @@ type bootimgProperties struct { // https://source.android.com/devices/bootloader/partitions/vendor-boot-partitions Vendor_boot *bool - // Optional kernel commandline - Cmdline *string `android:"arch_variant"` + // Optional kernel commandline arguments + Cmdline []string `android:"arch_variant"` // File that contains bootconfig parameters. This can be set only when `vendor_boot` is true // and `header_version` is greater than or equal to 4. @@ -152,7 +152,7 @@ func (b *bootimg) buildBootImage(ctx android.ModuleContext, vendor bool) android dtb := android.PathForModuleSrc(ctx, dtbName) cmd.FlagWithInput("--dtb ", dtb) - cmdline := proptools.String(b.properties.Cmdline) + cmdline := strings.Join(b.properties.Cmdline, " ") if cmdline != "" { flag := "--cmdline " if vendor {