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