summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYi-Yo Chiang <yochiang@google.com>2021-04-19 19:41:05 +0800
committerYo Chiang <yochiang@google.com>2021-04-27 11:03:29 +0000
commite100edcf771d70c3a74214fcf1fc5865a4c7cdd8 (patch)
treecc84c262a2213a6066890c6c74d7f99affdd97f0
parentd15a0844a0d0947de4d2856270151fc403e4731d (diff)
downloadbuild-e100edcf771d70c3a74214fcf1fc5865a4c7cdd8.tar.gz
build.sh: Add vendor bootconfig support
If BOOT_IMAGE_HEADER_VERSION is greater than or equal to 4 and VENDOR_BOOTCONFIG is defined, then vendor bootconfig would be appended to vendor_boot and " bootconfig" would be appended to the vendor kernel commandline. Bug: 184490452 Test: Bump BOOT_IMAGE_HEADER_VERSION to 4 and define VENDOR_BOOTCONFIG, then use unpack_bootimg.py to verify the built vendor_boot.img Change-Id: Ied6bebe6826911e072c1c1625442689ef7e1601c
-rwxr-xr-xbuild.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 2b4090bd..97959754 100755
--- a/build.sh
+++ b/build.sh
@@ -200,8 +200,8 @@
# be defined:
# - BASE_ADDRESS=<base address to load the kernel at>
# - PAGE_SIZE=<flash page size>
-# If the BOOT_IMAGE_HEADER_VERSION is 3, a vendor_boot image will be built unless
-# SKIP_VENDOR_BOOT is defined.
+# If BOOT_IMAGE_HEADER_VERSION >= 3, a vendor_boot image will be built
+# unless SKIP_VENDOR_BOOT is defined.
# - MODULES_LIST=<file to list of modules> list of modules to use for
# modules.load. If this property is not set, then the default modules.load
# is used.
@@ -212,6 +212,8 @@
# blocked from being loaded. This file is copied directly to staging directory,
# and should be in the format:
# blocklist module_name
+# If BOOT_IMAGE_HEADER_VERSION >= 4, the following variable can be defined:
+# - VENDOR_BOOTCONFIG=<string of bootconfig parameters>
#
# VENDOR_RAMDISK_CMDS
# When building vendor boot image, VENDOR_RAMDISK_CMDS enables the build
@@ -1176,6 +1178,16 @@ if [ ! -z "${BUILD_BOOT_IMG}" ] ; then
exit 1
fi
+ if [ "${BOOT_IMAGE_HEADER_VERSION}" -ge "4" ]; then
+ if [ -n "${VENDOR_BOOTCONFIG}" ]; then
+ for PARAM in ${VENDOR_BOOTCONFIG}; do
+ echo "${PARAM}"
+ done >"${DIST_DIR}/vendor-bootconfig.img"
+ MKBOOTIMG_ARGS+=("--vendor_bootconfig" "${DIST_DIR}/vendor-bootconfig.img")
+ KERNEL_VENDOR_CMDLINE+=" bootconfig"
+ fi
+ fi
+
if [ "${BOOT_IMAGE_HEADER_VERSION}" -ge "3" ]; then
if [ -f "${GKI_RAMDISK_PREBUILT_BINARY}" ]; then
MKBOOTIMG_ARGS+=("--ramdisk" "${GKI_RAMDISK_PREBUILT_BINARY}")