From 67211ab91c035b839534e355a71c1e917e04ff79 Mon Sep 17 00:00:00 2001 From: Michael Scott Date: Tue, 15 Sep 2026 09:09:21 -0700 Subject: [PATCH 1/2] firmware-qcom-capsule: stop hamoa's dtb entry leaking to other machines CAPSULE_FLASH_TYPE and CAPSULE_ENTRIES definitions are machine-qualified. The CAPSULE_ENTRY_dtb[...] flags are not. Varflags don't work with override resolution. This: CAPSULE_ENTRY_dtb[dest_disk]:iq-x7181-evk does not exist. Currently, the CAPSULE_ENTRY_dtb entries apply to every machine. Any other board that declares a "dtb" capsule entry ends up inheriting hamoa's SPINOR destinations without any warning to the user. Nothing catches it: generate_fvupdate() checks that an entry has a binary, a dest_disk and a dest_partition, all of which hamoa's values supply. The build succeeds and produces a capsule aimed at storage the machine may not have, or worse: may use for a different purpose and will be overwritten during a rare capsule update event. Instead of guards or other attempts to rename the "dtb" entry to something more unique for the machine, let's relocate these settings to iq-x7181-evk.conf where they won't affect anyone else. Fixes: a314263 ("firmware-qcom-capsule: add iq-x7181-evk capsule entry definitions") Signed-off-by: Igor Opaniuk Signed-off-by: Michael Scott --- conf/machine/iq-x7181-evk.conf | 13 +++++++++++++ .../firmware/firmware-qcom-capsule_%.bbappend | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 dynamic-layers/meta-arm/recipes-firmware/firmware/firmware-qcom-capsule_%.bbappend diff --git a/conf/machine/iq-x7181-evk.conf b/conf/machine/iq-x7181-evk.conf index 607631e6b..d5ef492ba 100644 --- a/conf/machine/iq-x7181-evk.conf +++ b/conf/machine/iq-x7181-evk.conf @@ -34,6 +34,19 @@ QCOM_BOOT_FIRMWARE = "firmware-qcom-boot-iq-x7181" QCOM_CDT_FIRMWARE = "firmware-qcom-cdt-iq-x7181" CAPSULE_GUID = "0F6D58FC-2258-4D27-9E23-D77219B0897C" +CAPSULE_FLASH_TYPE = "NORUFS" +CAPSULE_ENTRIES = "dtb" + +# Hamoa stores the Linux DTB FIT image in SPINOR. The firmware uses a +# main/backup model: dtb is always the active partition; dtb_BACKUP holds a +# rollback copy that is overwritten by before dtb is updated. +CAPSULE_ENTRY_dtb[binary] = "dtb.bin" +CAPSULE_ENTRY_dtb[dest_disk] = "SPINOR" +CAPSULE_ENTRY_dtb[dest_partition] = "dtb" +CAPSULE_ENTRY_dtb[dest_guid] = "{2A1A52FC-AA0B-401C-A808-5EA0F91068F8}" +CAPSULE_ENTRY_dtb[backup_disk] = "SPINOR" +CAPSULE_ENTRY_dtb[backup_partition] = "dtb_BACKUP" +CAPSULE_ENTRY_dtb[backup_guid] = "{A166F11A-2B39-4FAA-B7E7-F8AA080D0587}" # Isolate rt cpu QCOM_RT_CPU = "11" diff --git a/dynamic-layers/meta-arm/recipes-firmware/firmware/firmware-qcom-capsule_%.bbappend b/dynamic-layers/meta-arm/recipes-firmware/firmware/firmware-qcom-capsule_%.bbappend deleted file mode 100644 index 373a63afe..000000000 --- a/dynamic-layers/meta-arm/recipes-firmware/firmware/firmware-qcom-capsule_%.bbappend +++ /dev/null @@ -1,13 +0,0 @@ -CAPSULE_FLASH_TYPE:iq-x7181-evk = "NORUFS" -CAPSULE_ENTRIES:iq-x7181-evk = "dtb" - -# Hamoa stores the Linux DTB FIT image in SPINOR. The firmware uses a -# main/backup model: dtb is always the active partition; dtb_BACKUP holds a -# rollback copy that is overwritten by before dtb is updated. -CAPSULE_ENTRY_dtb[binary] = "dtb.bin" -CAPSULE_ENTRY_dtb[dest_disk] = "SPINOR" -CAPSULE_ENTRY_dtb[dest_partition] = "dtb" -CAPSULE_ENTRY_dtb[dest_guid] = "{2A1A52FC-AA0B-401C-A808-5EA0F91068F8}" -CAPSULE_ENTRY_dtb[backup_disk] = "SPINOR" -CAPSULE_ENTRY_dtb[backup_partition] = "dtb_BACKUP" -CAPSULE_ENTRY_dtb[backup_guid] = "{A166F11A-2B39-4FAA-B7E7-F8AA080D0587}" From 171eee2b54d13c52b96cc9aadeaf6898d5242d22 Mon Sep 17 00:00:00 2001 From: Michael Scott Date: Wed, 16 Sep 2026 12:00:48 -0700 Subject: [PATCH 2/2] qcom-capsule: changing CAPSULE_ENTYRY_* data should cause a rebuild Add the CAPSULE_ENTRY_* values as a vardep dependency to generate_fvupdate() to ensure a rebuild of the capsule-update when the CAPSULE_ENTRY_* data is changed. Signed-off-by: Michael Scott --- classes-recipe/qcom-capsule.bbclass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/classes-recipe/qcom-capsule.bbclass b/classes-recipe/qcom-capsule.bbclass index 9219760a3..31ec31533 100644 --- a/classes-recipe/qcom-capsule.bbclass +++ b/classes-recipe/qcom-capsule.bbclass @@ -203,6 +203,9 @@ python generate_fvupdate() { } do_compile[prefuncs] += "generate_fvupdate" +# Add the CAPSULE_ENTRY_* data as a dependency to generate_fvupdate(). +# This makes sure we rebuild when changes are made to the entries. +generate_fvupdate[vardeps] += "${@' '.join('CAPSULE_ENTRY_' + e for e in d.getVar('CAPSULE_ENTRIES').split())}" # Inject the OEM root certificate into xbl_config.elf. # Dumps the config sections, auto-detects the post-DDR DTB (or uses