From 67bb1e3fa375f806eebd8c316a2ca4bf56df76f0 Mon Sep 17 00:00:00 2001 From: Michael Scott Date: Fri, 28 Aug 2026 17:33:40 -0700 Subject: [PATCH] qcom-capsule: patch the machine-selected xbl_config variant The logic for injecting FMP root cert currently uses a hardcoded filename: xbl_config.elf. Instead, use ${QCOM_XBL_CONFIG} which is set to the correct filename depending on features that are enabled in MACHINE_FEATURES. For example, "kvm" will set QCOM_XBL_CONFIG="xbl_config_kvm.elf". Also overwrite the plain xbl_config.elf in the staging dir with the patched variant so the capsule FV entry and do_deploy consume the correct file. This fixes an early kernel boot failure triggered when capsule generation is enabled for machines with "kvm" in MACHINE_FEATURES. They incorrectly get the default xbl_config.elf (which is typically based on Gunyah) as part of their boot binaries. Platforms without an xbl_config (e.g. hamoa) are unaffected. Signed-off-by: Michael Scott --- classes-recipe/qcom-capsule.bbclass | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/classes-recipe/qcom-capsule.bbclass b/classes-recipe/qcom-capsule.bbclass index 9219760a3..3958c90ad 100644 --- a/classes-recipe/qcom-capsule.bbclass +++ b/classes-recipe/qcom-capsule.bbclass @@ -299,10 +299,18 @@ do_compile() { "${BOOTBINS_STAGED}/dtb.bin" fi - # Inject OEM root cert into xbl_config.elf when present. Platforms - # without xbl_config.elf (e.g. hamoa) skip this step. - if [ -f "${BOOTBINS_STAGED}/xbl_config.elf" ]; then - patch_xblconfig_cert "${BOOTBINS_STAGED}/xbl_config.elf" + # Inject the OEM root cert into the MACHINE-SELECTED xbl_config variant + # QCOM_XBL_CONFIG when present. Platforms without an xbl_config (e.g. + # hamoa) skip this. + XBL_CONFIG_VARIANT="${QCOM_XBL_CONFIG}" + [ -n "${XBL_CONFIG_VARIANT}" ] || XBL_CONFIG_VARIANT="xbl_config.elf" + if [ -f "${BOOTBINS_STAGED}/${XBL_CONFIG_VARIANT}" ]; then + patch_xblconfig_cert "${BOOTBINS_STAGED}/${XBL_CONFIG_VARIANT}" + if [ -f "${CAPSULE_DIR}/.xbl_with_oem_cert" ] && \ + [ "${XBL_CONFIG_VARIANT}" != "xbl_config.elf" ]; then + cp "${BOOTBINS_STAGED}/${XBL_CONFIG_VARIANT}" \ + "${BOOTBINS_STAGED}/xbl_config.elf" + fi fi qcom-capsule-tool sysfw-version-create \