Support a raw bootconfig file as input to vendor-bootconfig.img
Make variables can only get us so far...
This allows for more of the supported input formats for boot config,
like spaces in the values.
Ex:
foo=this will work in a file
If that is in a file, it will be added to the vendor-bootconfig.img
as-is. If it is in the BOARD_BOOTCONFIG variable, it gets chopped up to
look like multiple different arguments like:
foo=this
will
work
in
a
file
Test: build with/without BOARD_BOOTCONFIG and BOARD_BOOTCONFIG_FILE
Test: verify contents of vendor-bootconfig.img in all 4 combos
Test: verify "bootconfig" kernel cmdline arg doesn't show up in
vendor_boot.img when neither variable is set
Bug: 374651835
Change-Id: If59b1a9c968799bacbd4d88e0191e6bddc81a361
diff --git a/core/Makefile b/core/Makefile
index 81ae6f7..42d680c 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1676,12 +1676,13 @@
INTERNAL_VENDOR_BOOTIMAGE_ARGS += --vendor_cmdline "$(INTERNAL_KERNEL_CMDLINE)"
endif
-ifdef INTERNAL_BOOTCONFIG
+ifneq (, $(INTERNAL_BOOTCONFIG)$(INTERNAL_BOOTCONFIG_FILE))
INTERNAL_VENDOR_BOOTCONFIG_TARGET := $(PRODUCT_OUT)/vendor-bootconfig.img
$(INTERNAL_VENDOR_BOOTCONFIG_TARGET):
rm -f $@
$(foreach param,$(INTERNAL_BOOTCONFIG), \
printf "%s\n" $(param) >> $@;)
+ cat $(INTERNAL_BOOTCONFIG_FILE) >> $@
INTERNAL_VENDOR_BOOTIMAGE_ARGS += --vendor_bootconfig $(INTERNAL_VENDOR_BOOTCONFIG_TARGET)
endif
diff --git a/core/board_config.mk b/core/board_config.mk
index 5606964..38baa0a 100644
--- a/core/board_config.mk
+++ b/core/board_config.mk
@@ -27,6 +27,7 @@
_board_strip_readonly_list += BOARD_KERNEL_CMDLINE
_board_strip_readonly_list += BOARD_BOOT_HEADER_VERSION
_board_strip_readonly_list += BOARD_BOOTCONFIG
+_board_strip_readonly_list += BOARD_BOOTCONFIG_FILE
_board_strip_readonly_list += BOARD_KERNEL_BASE
_board_strip_readonly_list += BOARD_USES_GENERIC_AUDIO
_board_strip_readonly_list += BOARD_USES_RECOVERY_AS_BOOT
@@ -311,9 +312,10 @@
.KATI_READONLY := $(_board_strip_readonly_list)
INTERNAL_KERNEL_CMDLINE := $(BOARD_KERNEL_CMDLINE)
-ifneq (,$(BOARD_BOOTCONFIG))
+ifneq (,$(BOARD_BOOTCONFIG)$(BOARD_BOOTCONFIG_FILE))
INTERNAL_KERNEL_CMDLINE += bootconfig
INTERNAL_BOOTCONFIG := $(BOARD_BOOTCONFIG)
+ INTERNAL_BOOTCONFIG_FILE := $(BOARD_BOOTCONFIG_FILE)
endif
ifneq ($(filter %64,$(TARGET_ARCH)),)