Re: [OE-core] [PATCH v5] kernel-fit-image: allow extending compatible string property for DTBs

Mathieu Dubois-Briand
2025-10-12T07:59:09Z

On Sat Oct 11, 2025 at 11:48 AM CEST, Kavinaya S via lists.openembedded.org wrote:
> The Linux kernel allows multiple DTBs to share the same compatible string.
> For example:
> qcs6490-rb3gen2.dtb
> qcs6490-rb3gen2-vision-mezzanine.dtb
> qcs6490-rb3gen2-industrial-mezzanine.dtb
>
> All of these use the same base compatible string:
> compatible = "qcom,qcs6490-rb3gen2", "qcom,qcm6490";
>
> Since the latter two DTBs are overlays on top of the base DTB and do not
> modify platform properties, they retain the same compatible string.
>
> When these DTBs are bundled into a single fitImage, the bootloader cannot
> distinguish between them due to identical compatible strings.
>
> To address this, introduce a mechanism to extend the compatible string
> using a OE build variable:
> FIT_DTB_COMPATIBLE_EXTENTION[dtb_name] = "extension"
>
> This appends the extension to the first compatible string in the DTB,
> resulting in unique entries in the generated .its file. For example:
> FIT_DTB_COMPATIBLE_EXTENTION[qcs6490-rb3gen2-vision-mezzanine] = "vision"
> FIT_DTB_COMPATIBLE_EXTENTION[qcs6490-rb3gen2-industrial-mezzanine] = "industrial"
>
> Generates:
> compatible = "qcom,qcs6490-rb3gen2-vision", "qcom,qcm6490";
> compatible = "qcom,qcs6490-rb3gen2-industrial", "qcom,qcm6490";
>
> Suggested-By: Alexander Kanavin <alex.kanavin@gmail.com>
> Suggested-By: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> Signed-off-by: Kavinaya S <kavinaya@qti.qualcomm.com>
> ---

Hi Kavinaya,

Thanks for the new version.

It looks like this is breaking some selftest:

AssertionError: 'ti,am335x-bone-green-subtypeA' not found in '/dts-v1/;\n\n/ {\n description = "Kernel fitImage for Poky (Yocto Project Reference Distro)/1.0/beaglebone-yocto";\n #address-cells = <1>;\n images {\n kernel-1 {\n description = "Linux kernel";\n type = "kernel";\n compression = "none";\n data = /incbin/("linux.bin");\n arch = "arm";\n os = "linux";\n load = <0x20008000>;\n entry = <0x20008000>;\n hash-1 {\n algo = "sha256";\n };\n };\n fdt-am335x-bone.dtb {\n description = "Flattened Device Tree blob";\n type = "flat_dt";\n compression = "none";\n data = /incbin/("am335x-bone.dtb");\n arch = "arm";\n hash-1 {\n algo = "sha256";\n };\n };\n fdt-am335x-boneblack.dtb {\n description = "Flattened Device Tree blob";\n type = "flat_dt";\n compression = "none";\n data = /incbin/("am335x-boneblack.dtb");\n arch = "arm";\n hash-1 {\n algo = "sha256";\n };\n };\n fdt-am335x-bonegreen.dtb {\n description = "Flattened Device Tree blob";\n type = "flat_dt";\n compression = "none";\n data = /incbin/("am335x-bonegreen.dtb");\n arch = "arm";\n hash-1 {\n algo = "sha256";\n };\n };\n };\n configurations {\n default = "conf-am335x-bone.dtb";\n conf-am335x-bone.dtb {\n description = "1 Linux kernel, FDT blob";\n kernel = "kernel-1";\n fdt = "fdt-am335x-bone.dtb";\n hash-1 {\n algo = "sha256";\n };\n };\n conf-am335x-boneblack.dtb {\n description = "0 Linux kernel, FDT blob";\n kernel = "kernel-1";\n fdt = "fdt-am335x-boneblack.dtb";\n hash-1 {\n algo = "sha256";\n };\n };\n conf-am335x-bonegreen.dtb {\n description = "0 Linux kernel, FDT blob";\n kernel = "kernel-1";\n fdt = "fdt-am335x-bonegreen.dtb";\n hash-1 {\n algo = "sha256";\n };\n };\n };\n};\n'
...
2025-10-11 15:18:18,764 - oe-selftest - INFO - fitimage.KernelFitImageRecipeTests.test_fitimage_compatible_extn_in_its (subunit.RemotedTestCase)
2025-10-11 15:18:18,771 - oe-selftest - INFO - ... FAIL

Can you have a look at this failure, please?

Thanks,
Mathieu

--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering