* [PATCH v2] kernel-fit-image: enable compatible string for kernel built-in DTBs
@ 2025-10-13 5:53 Kavinaya S
2025-10-23 9:29 ` [OE-core] " Antonin Godard
0 siblings, 1 reply; 2+ messages in thread
From: Kavinaya S @ 2025-10-13 5:53 UTC (permalink / raw)
To: openembedded-core; +Cc: Kavinaya S
At present, the kernel-fit-image bbclass is adding compatible strings only
for external DTBs, omitting them for DTBs built from the kernel tree. This
behavior is limiting the ability to clearly identify the DTBs in FIT image
that includes multiple kernel built-in DTBs and possibly mix of in tree and
external ones, due to lack of consistent compatible strings.
To fix this, introduce a new BitBake variable, FIT_DTB_ADD_COMPATIBLE
when set to "True", the bbclass will extract and include the compatible
string from kernel-built DTBs also in the .its file, just like it does
for external DTBs.
Signed-off-by: Kavinaya S <kavinaya@qti.qualcomm.com>
---
meta/classes-recipe/kernel-fit-image.bbclass | 3 ++-
meta/conf/image-fitimage.conf | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/meta/classes-recipe/kernel-fit-image.bbclass b/meta/classes-recipe/kernel-fit-image.bbclass
index f04aee1807..3aa7a2e75a 100644
--- a/meta/classes-recipe/kernel-fit-image.bbclass
+++ b/meta/classes-recipe/kernel-fit-image.bbclass
@@ -85,7 +85,8 @@ python do_compile() {
# Copy the dtb or dtbo file into the FIT image assembly directory
shutil.copyfile(os.path.join(kernel_deploydir, dtb_name), dtb_name)
root_node.fitimage_emit_section_dtb(dtb_name, dtb_name,
- d.getVar("UBOOT_DTB_LOADADDRESS"), d.getVar("UBOOT_DTBO_LOADADDRESS"))
+ d.getVar("UBOOT_DTB_LOADADDRESS"), d.getVar("UBOOT_DTBO_LOADADDRESS"),
+ add_compatible = bb.utils.to_boolean(d.getVar("FIT_DTB_ADD_COMPATIBLE"), False))
if external_kernel_devicetree:
# iterate over all .dtb and .dtbo files in the external kernel devicetree directory
diff --git a/meta/conf/image-fitimage.conf b/meta/conf/image-fitimage.conf
index 090ee148f4..35e0459d09 100644
--- a/meta/conf/image-fitimage.conf
+++ b/meta/conf/image-fitimage.conf
@@ -47,6 +47,9 @@ FIT_LINUX_BIN ?= "linux.bin"
# Allow user to select the default DTB for FIT image when multiple dtb's exists.
FIT_CONF_DEFAULT_DTB ?= ""
+# Allow user to choose if DTB in FIT image can have compatible strings.
+FIT_DTB_ADD_COMPATIBLE ?= "False"
+
# length of address in number of <u32> cells
# ex: 1 32bits address, 2 64bits address
FIT_ADDRESS_CELLS ?= "1"
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [OE-core] [PATCH v2] kernel-fit-image: enable compatible string for kernel built-in DTBs
2025-10-13 5:53 [PATCH v2] kernel-fit-image: enable compatible string for kernel built-in DTBs Kavinaya S
@ 2025-10-23 9:29 ` Antonin Godard
0 siblings, 0 replies; 2+ messages in thread
From: Antonin Godard @ 2025-10-23 9:29 UTC (permalink / raw)
To: kavinaya, openembedded-core
On Mon Oct 13, 2025 at 7:53 AM CEST, Kavinaya S via lists.openembedded.org wrote:
> At present, the kernel-fit-image bbclass is adding compatible strings only
> for external DTBs, omitting them for DTBs built from the kernel tree. This
> behavior is limiting the ability to clearly identify the DTBs in FIT image
> that includes multiple kernel built-in DTBs and possibly mix of in tree and
> external ones, due to lack of consistent compatible strings.
>
> To fix this, introduce a new BitBake variable, FIT_DTB_ADD_COMPATIBLE
> when set to "True", the bbclass will extract and include the compatible
> string from kernel-built DTBs also in the .its file, just like it does
> for external DTBs.
>
> Signed-off-by: Kavinaya S <kavinaya@qti.qualcomm.com>
> ---
> meta/classes-recipe/kernel-fit-image.bbclass | 3 ++-
> meta/conf/image-fitimage.conf | 3 +++
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes-recipe/kernel-fit-image.bbclass b/meta/classes-recipe/kernel-fit-image.bbclass
> index f04aee1807..3aa7a2e75a 100644
> --- a/meta/classes-recipe/kernel-fit-image.bbclass
> +++ b/meta/classes-recipe/kernel-fit-image.bbclass
> @@ -85,7 +85,8 @@ python do_compile() {
> # Copy the dtb or dtbo file into the FIT image assembly directory
> shutil.copyfile(os.path.join(kernel_deploydir, dtb_name), dtb_name)
> root_node.fitimage_emit_section_dtb(dtb_name, dtb_name,
> - d.getVar("UBOOT_DTB_LOADADDRESS"), d.getVar("UBOOT_DTBO_LOADADDRESS"))
> + d.getVar("UBOOT_DTB_LOADADDRESS"), d.getVar("UBOOT_DTBO_LOADADDRESS"),
> + add_compatible = bb.utils.to_boolean(d.getVar("FIT_DTB_ADD_COMPATIBLE"), False))
>
> if external_kernel_devicetree:
> # iterate over all .dtb and .dtbo files in the external kernel devicetree directory
> diff --git a/meta/conf/image-fitimage.conf b/meta/conf/image-fitimage.conf
> index 090ee148f4..35e0459d09 100644
> --- a/meta/conf/image-fitimage.conf
> +++ b/meta/conf/image-fitimage.conf
> @@ -47,6 +47,9 @@ FIT_LINUX_BIN ?= "linux.bin"
> # Allow user to select the default DTB for FIT image when multiple dtb's exists.
> FIT_CONF_DEFAULT_DTB ?= ""
>
> +# Allow user to choose if DTB in FIT image can have compatible strings.
> +FIT_DTB_ADD_COMPATIBLE ?= "False"
Hi,
If this is merged can you please send a patch documenting this variable, on
docs@lists.yoctoproject.org?
This should be added to the glossary:
https://git.yoctoproject.org/yocto-docs/tree/documentation/ref-manual/variables.rst
Thanks!
Antonin
--
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-23 9:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-13 5:53 [PATCH v2] kernel-fit-image: enable compatible string for kernel built-in DTBs Kavinaya S
2025-10-23 9:29 ` [OE-core] " Antonin Godard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox