diff --git a/image_opts.bzl b/image_opts.bzl index 4a510fe64b70..167166bc8dfb 100644 --- a/image_opts.bzl +++ b/image_opts.bzl @@ -5,7 +5,7 @@ def boot_image_opts( super_image_size = 0x10000000, boot_partition_size = 0x6000000, lz4_ramdisk = True, - earlycon_addr = "0x00a9C000", + earlycon_addr = None, kernel_vendor_cmdline_extras = ["bootconfig"], board_kernel_cmdline_extras = [], board_bootconfig_extras = []): diff --git a/msm_kernel_la.bzl b/msm_kernel_la.bzl index c512eda4d7d4..002d938a6a5f 100644 --- a/msm_kernel_la.bzl +++ b/msm_kernel_la.bzl @@ -48,6 +48,11 @@ def _define_build_config( variant: variant of kernel to build (e.g. "gki") """ + # keep earlycon addr in earlycon cmdline param only when provided explicitly in target's bazel file + # otherwise, rely on stdout-path + earlycon_param = "={}".format(boot_image_opts.earlycon_addr) if boot_image_opts.earlycon_addr != None else "" + earlycon_param = '[ "$KERNEL_CMDLINE_CONSOLE_AUTO" != "0" ] && KERNEL_VENDOR_CMDLINE+=\' earlycon{} \''.format(earlycon_param) + write_file( name = "{}_build_config_bazel".format(target), out = "build.config.msm.{}.generated".format(target), @@ -67,7 +72,7 @@ def _define_build_config( "BUILD_INIT_BOOT_IMG=1", "LZ4_RAMDISK={}".format(int(boot_image_opts.lz4_ramdisk)), '[ -z "$DT_OVERLAY_SUPPORT" ] && DT_OVERLAY_SUPPORT=1', - '[ "$KERNEL_CMDLINE_CONSOLE_AUTO" != "0" ] && KERNEL_VENDOR_CMDLINE+=\' earlycon={} \''.format(boot_image_opts.earlycon_addr), + earlycon_param, "KERNEL_VENDOR_CMDLINE+=' {} '".format(" ".join(boot_image_opts.kernel_vendor_cmdline_extras)), "VENDOR_BOOTCONFIG+='androidboot.first_stage_console=1 androidboot.hardware=qcom_kp'", "", # Needed for newline at end of file diff --git a/msm_kernel_lagvm.bzl b/msm_kernel_lagvm.bzl index 974b08765160..7706e79a1091 100644 --- a/msm_kernel_lagvm.bzl +++ b/msm_kernel_lagvm.bzl @@ -45,6 +45,11 @@ def _define_build_config( variant: variant of kernel to build (e.g. "gki") """ + # keep earlycon addr in earlycon cmdline param only when provided explicitly in target's bazel file + # otherwise, rely on stdout-path + earlycon_param = "={}".format(boot_image_opts.earlycon_addr) if boot_image_opts.earlycon_addr != None else "" + earlycon_param = '[ "$KERNEL_CMDLINE_CONSOLE_AUTO" != "0" ] && KERNEL_VENDOR_CMDLINE+=\' earlycon{} \''.format(earlycon_param) + write_file( name = "{}_build_config_bazel".format(target), out = "build.config.msm.{}.generated".format(target), @@ -64,7 +69,7 @@ def _define_build_config( "BUILD_INIT_BOOT_IMG=1", "LZ4_RAMDISK={}".format(int(boot_image_opts.lz4_ramdisk)), '[ -z "$DT_OVERLAY_SUPPORT" ] && DT_OVERLAY_SUPPORT=1', - '[ "$KERNEL_CMDLINE_CONSOLE_AUTO" != "0" ] && KERNEL_VENDOR_CMDLINE+=\' earlycon={} \''.format(boot_image_opts.earlycon_addr), + earlycon_param, "KERNEL_VENDOR_CMDLINE+=' {} '".format(" ".join(boot_image_opts.kernel_vendor_cmdline_extras)), "VENDOR_BOOTCONFIG+='androidboot.first_stage_console=1 androidboot.hardware=qcom_kp'", "", # Needed for newline at end of file diff --git a/msm_kernel_le.bzl b/msm_kernel_le.bzl index 2688a00d4124..af50506d4c9c 100644 --- a/msm_kernel_le.bzl +++ b/msm_kernel_le.bzl @@ -42,6 +42,11 @@ def _define_build_config( variant: variant of kernel to build (e.g. "gki") """ + # keep earlycon addr in earlycon cmdline param only when provided explicitly in target's bazel file + # otherwise, rely on stdout-path + earlycon_param = "={}".format(boot_image_opts.earlycon_addr) if boot_image_opts.earlycon_addr != None else "" + earlycon_param = "earlycon" + earlycon_param + write_file( name = "{}_build_config_bazel".format(target), out = "build.config.msm.{}.generated".format(target), @@ -60,7 +65,7 @@ def _define_build_config( "SKIP_UNPACKING_RAMDISK=1", "BUILD_INITRAMFS=1", '[ -z "$DT_OVERLAY_SUPPORT" ] && DT_OVERLAY_SUPPORT=1', - '[ "$KERNEL_CMDLINE_CONSOLE_AUTO" != "0" ] && KERNEL_VENDOR_CMDLINE+=\' console=ttyMSM0,115200n8 earlycon=qcom_geni,0x00a9C000 qcom_geni_serial.con_enabled=1 \'', + '[ "$KERNEL_CMDLINE_CONSOLE_AUTO" != "0" ] && KERNEL_VENDOR_CMDLINE+=\' console=ttyMSM0,115200n8 {} qcom_geni_serial.con_enabled=1 \''.format(earlycon_param), "", # Needed for newline at end of file ], ) diff --git a/pineapple.bzl b/pineapple.bzl index 672d9acb31b2..069dd8261431 100644 --- a/pineapple.bzl +++ b/pineapple.bzl @@ -328,7 +328,6 @@ def define_pineapple(): variant = variant, in_tree_module_list = mod_list, boot_image_opts = boot_image_opts( - 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,