| Message ID | 20260219163051.3809204-1-viswanath.kraleti@oss.qualcomm.com |
|---|---|
| State | New |
| Headers | show |
| Series | [OE-core,meta] uki.bbclass: make DTB packaging optional | expand |
Hi Viswanath; Wrong mailing list, it should be: openembedded-core@lists.openembedded.org Jose Viswanath Kraleti via lists.openembedded.org <viswanath.kraleti= oss.qualcomm.com@lists.openembedded.org> escreveu (quinta, 19/02/2026 à(s) 16:31): > According to the Unified Kernel Image (UKI) specification [1], including > a compiled device tree in the .dtb section of a UKI is optional. However, > the current implementation always packages device trees listed in > KERNEL_DEVICETREE into the UKI by default. This makes uki.bbclass > unsuitable for systems that rely on firmware-provided DTBs and do not > want a DTB embedded in the UKI. > > Fix this by introducing a new UKI_DEVICETREE variable to control device > tree packaging. The dtb section is now populated from UKI_DEVICETREE > instead of KERNEL_DEVICETREE. Users who do not want DTBs included in the > UKI can override UKI_DEVICETREE to an empty value from their recipes. > > [1] https://uapi-group.org/specifications/specs/unified_kernel_image/ > > Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com> > --- > meta/classes-recipe/uki.bbclass | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/meta/classes-recipe/uki.bbclass > b/meta/classes-recipe/uki.bbclass > index ea449540db..326697a066 100644 > --- a/meta/classes-recipe/uki.bbclass > +++ b/meta/classes-recipe/uki.bbclass > @@ -80,6 +80,7 @@ UKI_CONFIG_FILE ?= "${UNPACKDIR}/uki.conf" > UKI_FILENAME ?= "uki.efi" > UKI_KERNEL_FILENAME ?= "${KERNEL_IMAGETYPE}" > UKI_CMDLINE ?= "rootwait root=LABEL=root" > +UKI_DEVICETREE ?= "${KERNEL_DEVICETREE}" > # secure boot keys and cert, needs sbsign-tools-native (meta-secure-core) > #UKI_SB_KEY ?= "" > #UKI_SB_CERT ?= "" > @@ -149,8 +150,9 @@ python do_uki() { > ukify_cmd += " --cmdline='%s'" % (cmdline) > > # dtb > - if d.getVar('KERNEL_DEVICETREE'): > - for dtb in d.getVar('KERNEL_DEVICETREE').split(): > + uki_devicetree = d.getVar('UKI_DEVICETREE') > + if uki_devicetree: > + for dtb in uki_devicetree.split(): > # DTBs are without sub-directories in deploy_dir > dtb_name = os.path.basename(dtb) > dtb_path = "%s/%s" % (deploy_dir_image, dtb_name) > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#124510): > https://lists.openembedded.org/g/openembedded-devel/message/124510 > Mute This Topic: https://lists.openembedded.org/mt/117894999/5052612 > Group Owner: openembedded-devel+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [ > quaresma.jose@gmail.com] > -=-=-=-=-=-=-=-=-=-=-=- > >
diff --git a/meta/classes-recipe/uki.bbclass b/meta/classes-recipe/uki.bbclass index ea449540db..326697a066 100644 --- a/meta/classes-recipe/uki.bbclass +++ b/meta/classes-recipe/uki.bbclass @@ -80,6 +80,7 @@ UKI_CONFIG_FILE ?= "${UNPACKDIR}/uki.conf" UKI_FILENAME ?= "uki.efi" UKI_KERNEL_FILENAME ?= "${KERNEL_IMAGETYPE}" UKI_CMDLINE ?= "rootwait root=LABEL=root" +UKI_DEVICETREE ?= "${KERNEL_DEVICETREE}" # secure boot keys and cert, needs sbsign-tools-native (meta-secure-core) #UKI_SB_KEY ?= "" #UKI_SB_CERT ?= "" @@ -149,8 +150,9 @@ python do_uki() { ukify_cmd += " --cmdline='%s'" % (cmdline) # dtb - if d.getVar('KERNEL_DEVICETREE'): - for dtb in d.getVar('KERNEL_DEVICETREE').split(): + uki_devicetree = d.getVar('UKI_DEVICETREE') + if uki_devicetree: + for dtb in uki_devicetree.split(): # DTBs are without sub-directories in deploy_dir dtb_name = os.path.basename(dtb) dtb_path = "%s/%s" % (deploy_dir_image, dtb_name)
According to the Unified Kernel Image (UKI) specification [1], including a compiled device tree in the .dtb section of a UKI is optional. However, the current implementation always packages device trees listed in KERNEL_DEVICETREE into the UKI by default. This makes uki.bbclass unsuitable for systems that rely on firmware-provided DTBs and do not want a DTB embedded in the UKI. Fix this by introducing a new UKI_DEVICETREE variable to control device tree packaging. The dtb section is now populated from UKI_DEVICETREE instead of KERNEL_DEVICETREE. Users who do not want DTBs included in the UKI can override UKI_DEVICETREE to an empty value from their recipes. [1] https://uapi-group.org/specifications/specs/unified_kernel_image/ Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com> --- meta/classes-recipe/uki.bbclass | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)