fit-dtb-compatible: invert key direction and split linux-qcom-only entries#2305
fit-dtb-compatible: invert key direction and split linux-qcom-only entries#2305ricardosalveti wants to merge 2 commits into
Conversation
|
@lumag @kraghava-qti @vkraleti as discussed at #2273 (comment), I decided to get copilot to invert the logic as it makes more sense, and it is also aligned with qcom-metadata. I also separated the the list of entries based on the kernel used, so we can easily maintain the two sets separately, making it clear about the origin of the DTS. This is a major change (the inverted logic), but I believe it is easier to understand and maintain this way. Opened as draft until it is properly validated with all targets. |
Test Results 103 files 632 suites 5h 0m 47s ⏱️ Results for commit 3d5748b. ♻️ This comment has been updated with latest results. |
a63ed71 to
da47aad
Compare
da47aad to
4d0c068
Compare
|
|
||
| fdtentries = [f"fdt-{dt}" for dt in dt_list] | ||
| lookup_key = "+".join([os.path.splitext(dt)[0].replace(',', '_') for dt in dt_list]) | ||
| lookup_key = " ".join([os.path.splitext(dt)[0].replace(',', '_') for dt in dt_list]) |
There was a problem hiding this comment.
Hmm. Does it mean that it requires exactly one whitespace the value? It would be really inconvenient.
There was a problem hiding this comment.
Here it is just building a key to index the overlay_compats dict, and it is derived out of a .split, which drops the extra whitespace that could be part of the variable, so this is safe.
|
bootup failure on Rb8 and RB4 :https://axiom.qualcomm.com/#/reports/job/36984663 |
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>
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>
4d0c068 to
3d5748b
Compare
|
Lava and Axiom tests all functional now. |
Redesigns FIT_DTB_COMPATIBLE so each encoded compatible string is the flag
key and the DTB+overlay combo is the value, inverting the previous layout
that buried the firmware target in the value field and made duplicate
compatible detection impossible at parse time.
Linux-qcom-only entries (el2, camx, staging, ifp-mezzanine overlays) are
moved into a new fit-dtb-compatible-linux-qcom.inc, loaded via
LINUX_QCOM_FIT_DTB_COMPATIBLE_INC only for linux-qcom* kernel variants,
keeping the base file valid for linux-yocto builds. Selftests are updated
to cover both files.
Assisted-by: GitHub Copilot:claude-opus-4-6