[Backport wrynose] fit-dtb-compatible: invert key direction and split linux-qcom-only entries#2328
Merged
Merged
Conversation
Contributor
Author
|
Depends on #2327 |
lumag
previously approved these changes
May 30, 2026
Previously FIT_DTB_COMPATIBLE used the DTB+overlay combo as the flag key and the compatible string as the value, so a single key could carry multiple space-separated compat strings. This required custom split/join logic in the bbclass and made it hard to read the mapping (the intended firmware target was buried in the value field). Invert the direction: each encoded compatible string (commas replaced with underscores per BitBake flag-name rules) is now the flag key, and the DTB+overlay combo string is the value. Multiple compatible strings that share the same combo each get their own entry pointing to the same value. An accidentally repeated compatible string then collides as a duplicate flag key; BitBake silently keeps only the last assignment, so the test_fit_dtb_compatible_no_duplicate_keys selftest scans the include file and fails when any key is defined more than once. All entries (base-kernel and linux-qcom-specific) remain in a single fit-dtb-compatible.inc for now. Combos that reference linux-qcom-only overlays (el2, camx, staging, ifp-mezzanine) are silently skipped by the bbclass for kernel variants whose KERNEL_DEVICETREE does not include those overlay files, so the single file works correctly across all kernel variants. Overlay combos use space-separated stems (e.g. "base overlay1 overlay2") rather than the previous plus-sign notation, which allows long combos to be split across multiple lines. Update the bbclass parser to iterate over keys, decode underscores back to commas, deduplicate overlay-group entries via a seen_combos set, and accumulate space-separated compat strings for configs that share one combo. Update all unit tests and matrix tests in qcom_fitimage.py to use the new dict shape, replacing test_fit_dtb_compatible_keys_exist_in_kernel_sources and test_fit_dtb_compatible_no_duplicate_values with test_fit_dtb_compatible_combos_exist_in_kernel_sources and test_fit_dtb_compatible_compat_key_format that match the new format. Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com> (cherry picked from commit 330717e)
linux-qcom tracks a newer kernel than linux-yocto and can carry device trees -- both .dtb and .dtbo -- that linux-yocto does not have yet (today these are the el2, camx, staging and ifp-mezzanine overlays and the combos built on them). Carrying every entry in a single fit-dtb-compatible.inc couples those faster-moving linux-qcom additions to linux-yocto and makes the boundary hard to see. Split the linux-qcom-only entries into a new fit-dtb-compatible-linux-qcom.inc and introduce LINUX_QCOM_FIT_DTB_COMPATIBLE in dtb-fit-image.bbclass to select which include to load. The variable defaults to fit-dtb-compatible.inc; linux-qcom* kernel recipes set it to fit-dtb-compatible-linux-qcom.inc, which opens with a require of the base file so it is self-contained. Because BitBake uses last-write-wins for flag variables, the qcom file is loaded after the base file, so its entries naturally override any shared key. This lets linux-qcom add device trees without waiting for linux-yocto, while a linux-yocto-only build stays functional from the base file alone; entries migrate back to the base file as linux-yocto gains the same device trees. Update the matrix selftest to check both files: base entries against the union of all kernel sources, linux-qcom entries against qcom-only sources (since linux-yocto does not ship those newer device tree sources yet). Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com> (cherry picked from commit 3d5748b)
b68ddb5 to
6875243
Compare
ricardosalveti
approved these changes
May 30, 2026
lumag
approved these changes
May 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #2305 to
wrynose.