From 585aa20d96ab0089e3440e042accfb4d0b280bdb Mon Sep 17 00:00:00 2001 From: Vamsi Krishna Lanka Date: Mon, 15 May 2023 14:05:56 -0700 Subject: [PATCH] ANDROID: build: Pass variant-specific kernel cmdline params to vendor Enable the inclusion of variant-specific kernel command line parameters in vendor builds through the generation of a file containing them. Set "androidboot.console" to 0 and 1 for Vendor GKI and consolidate variants respectively, by this method. Additionally, enable "nosoftlockup" for the GKI variant of both Kernel Platform and Vendor builds by this method. Change-Id: Id2ce57bad4556cfa96c1a0215141a1f015066e8b Signed-off-by: Vamsi Krishna Lanka Signed-off-by: Guru Das Srinagesh --- image_opts.bzl | 4 +++- msm_kernel_la.bzl | 10 ++++++++++ pineapple.bzl | 18 ++++++++++++------ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/image_opts.bzl b/image_opts.bzl index 9b6eb1e2b1d0..b2df95faac85 100644 --- a/image_opts.bzl +++ b/image_opts.bzl @@ -6,7 +6,8 @@ def boot_image_opts( boot_partition_size = 0x6000000, lz4_ramdisk = True, earlycon_addr = "0x00a9C000", - kernel_vendor_cmdline_extras = ["bootconfig"]): + kernel_vendor_cmdline_extras = ["bootconfig"], + board_kernel_cmdline_extras = []): return struct( boot_image_header_version = boot_image_header_version, base_address = base_address, @@ -16,6 +17,7 @@ def boot_image_opts( lz4_ramdisk = lz4_ramdisk, earlycon_addr = earlycon_addr, kernel_vendor_cmdline_extras = kernel_vendor_cmdline_extras, + board_kernel_cmdline_extras = board_kernel_cmdline_extras, ) def vm_image_opts( diff --git a/msm_kernel_la.bzl b/msm_kernel_la.bzl index c8921498a917..b2f22275d817 100644 --- a/msm_kernel_la.bzl +++ b/msm_kernel_la.bzl @@ -111,6 +111,14 @@ EOF ], ) + native.genrule( + name = "{}_extra_cmdline".format(target), + outs = ["board_extra_cmdline_{}".format(target)], + cmd_bash = """ + echo {} > "$@" + """.format(" ".join(boot_image_opts.board_kernel_cmdline_extras)), + ) + def _define_kernel_build( target, base_kernel, @@ -321,6 +329,8 @@ def _define_kernel_dist(target, msm_target, variant, base_kernel, define_abi_tar msm_dist_targets.append("{}_avb_sign_boot_image".format(target)) + msm_dist_targets.append("{}_extra_cmdline".format(target)) + if define_abi_targets: kernel_abi_dist( name = "{}_dist".format(target), diff --git a/pineapple.bzl b/pineapple.bzl index f0c6098ca25b..f35bc2e34356 100644 --- a/pineapple.bzl +++ b/pineapple.bzl @@ -270,11 +270,21 @@ def define_pineapple(): "lib/test_user_copy.ko", ] + kernel_vendor_cmdline_extras = [ + # do not sort + "console=ttyMSM0,115200n8", + "qcom_geni_serial.con_enabled=1", + "bootconfig", + ] + for variant in la_variants: if variant == "consolidate": mod_list = _pineapple_consolidate_in_tree_modules + board_kernel_cmdline_extras = ["androidboot.console=1"] else: mod_list = _pineapple_in_tree_modules + board_kernel_cmdline_extras = ["nosoftlockup", "androidboot.console=0"] + kernel_vendor_cmdline_extras += ["nosoftlockup"] define_msm_la( msm_target = target_name, @@ -282,11 +292,7 @@ def define_pineapple(): in_tree_module_list = mod_list, boot_image_opts = boot_image_opts( earlycon_addr = "qcom_geni,0x00a9C000", - kernel_vendor_cmdline_extras = [ - # do not sort - "console=ttyMSM0,115200n8", - "qcom_geni_serial.con_enabled=1", - "bootconfig", - ], + kernel_vendor_cmdline_extras = kernel_vendor_cmdline_extras, + board_kernel_cmdline_extras = board_kernel_cmdline_extras, ), )