Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3eefb6d authored by Devin Moore's avatar Devin Moore
Browse files

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
parent 9b1b1e03
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1676,12 +1676,13 @@ ifdef INTERNAL_KERNEL_CMDLINE
  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

+3 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ _board_strip_readonly_list += BOARD_INSTALLER_CMDLINE
_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 @@ endif
.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)),)