ANDROID: build: Pass variant-specific bootconfig params to vendor

Enable the inclusion of variant-specific Android bootconfig parameters in
vendor builds through the generation of a file containing them.

Set "androidboot.console" to 0 for Vendor GKI variant by this method.

Previously, this was set via the kernel command line, which leads to a
VTS test failure that forbids "androidboot.*" parameters from being
specified via kernel command line and redirects their inclusion via the
`bootconfig` mechanism.

Change-Id: Id449bd82d655082add0a80b3be221ada97fc1933
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
This commit is contained in:
Guru Das Srinagesh 2023-06-20 18:54:18 -07:00
parent 1b2788e623
commit 8a0b83b567
3 changed files with 26 additions and 7 deletions

View File

@ -7,7 +7,8 @@ def boot_image_opts(
lz4_ramdisk = True,
earlycon_addr = "0x00a9C000",
kernel_vendor_cmdline_extras = ["bootconfig"],
board_kernel_cmdline_extras = []):
board_kernel_cmdline_extras = [],
board_bootconfig_extras = []):
return struct(
boot_image_header_version = boot_image_header_version,
base_address = base_address,
@ -18,6 +19,7 @@ def boot_image_opts(
earlycon_addr = earlycon_addr,
kernel_vendor_cmdline_extras = kernel_vendor_cmdline_extras,
board_kernel_cmdline_extras = board_kernel_cmdline_extras,
board_bootconfig_extras = board_bootconfig_extras,
)
def vm_image_opts(

View File

@ -111,14 +111,24 @@ EOF
],
)
board_extras = " ".join(boot_image_opts.board_kernel_cmdline_extras)
if board_extras:
board_cmdline_extras = " ".join(boot_image_opts.board_kernel_cmdline_extras)
if board_cmdline_extras:
native.genrule(
name = "{}_extra_cmdline".format(target),
outs = ["board_extra_cmdline_{}".format(target)],
cmd_bash = """
echo {} > "$@"
""".format(board_extras),
""".format(board_cmdline_extras),
)
board_bc_extras = " ".join(boot_image_opts.board_bootconfig_extras)
if board_bc_extras:
native.genrule(
name = "{}_extra_bootconfig".format(target),
outs = ["board_extra_bootconfig_{}".format(target)],
cmd_bash = """
echo {} > "$@"
""".format(board_bc_extras),
)
def _define_kernel_build(
@ -336,10 +346,14 @@ def _define_kernel_dist(
msm_dist_targets.append("{}_avb_sign_boot_image".format(target))
board_extras = " ".join(boot_image_opts.board_kernel_cmdline_extras)
if board_extras:
board_cmdline_extras = " ".join(boot_image_opts.board_kernel_cmdline_extras)
if board_cmdline_extras:
msm_dist_targets.append("{}_extra_cmdline".format(target))
board_bc_extras = " ".join(boot_image_opts.board_kernel_cmdline_extras)
if board_bc_extras:
msm_dist_targets.append("{}_extra_bootconfig".format(target))
if define_abi_targets:
kernel_abi_dist(
name = "{}_dist".format(target),

View File

@ -281,14 +281,16 @@ def define_pineapple():
]
board_kernel_cmdline_extras = []
board_bootconfig_extras = []
for variant in la_variants:
if variant == "consolidate":
mod_list = _pineapple_consolidate_in_tree_modules
else:
mod_list = _pineapple_in_tree_modules
board_kernel_cmdline_extras += ["nosoftlockup", "androidboot.console=0"]
board_kernel_cmdline_extras += ["nosoftlockup"]
kernel_vendor_cmdline_extras += ["nosoftlockup"]
board_bootconfig_extras += ["androidboot.console=0"]
define_msm_la(
msm_target = target_name,
@ -298,5 +300,6 @@ def define_pineapple():
earlycon_addr = "qcom_geni,0x00a9C000",
kernel_vendor_cmdline_extras = kernel_vendor_cmdline_extras,
board_kernel_cmdline_extras = board_kernel_cmdline_extras,
board_bootconfig_extras = board_bootconfig_extras,
),
)