public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Richard Leitner <dev@g0hl1n.net>
To: openembedded-core@lists.openembedded.org
Cc: Richard Leitner <dev@g0hl1n.net>
Subject: [PATCH] fitimage: introduce FIT_CONF_STRIP_EXT
Date: Wed,  7 Jan 2026 10:26:00 +0100	[thread overview]
Message-ID: <20260107092600.73848-1-dev@g0hl1n.net> (raw)

Introduce a configuration variable named FIT_CONF_STRIP_EXT which
removes the file-type extension from the configuration node name.

This feature enables us to give configuration nodes arbritary names
(based on the dtb file names). This is in my case needed to ensure
consistent configuration names which where previously (walnascar)
generated using a fitimage_emit_section_config:append() function.

Signed-off-by: Richard Leitner <dev@g0hl1n.net>
---
 meta/classes-recipe/kernel-fit-image.bbclass | 1 +
 meta/conf/image-fitimage.conf                | 3 +++
 meta/lib/oe/fitimage.py                      | 4 ++++
 meta/lib/oeqa/selftest/cases/fitimage.py     | 3 +++
 4 files changed, 11 insertions(+)

diff --git a/meta/classes-recipe/kernel-fit-image.bbclass b/meta/classes-recipe/kernel-fit-image.bbclass
index fd0d21ceee..6f78016e14 100644
--- a/meta/classes-recipe/kernel-fit-image.bbclass
+++ b/meta/classes-recipe/kernel-fit-image.bbclass
@@ -54,6 +54,7 @@ python do_compile() {
     root_node = oe.fitimage.ItsNodeRootKernel(
         d.getVar("FIT_DESC"), d.getVar("FIT_ADDRESS_CELLS"),
         d.getVar('HOST_PREFIX'), d.getVar('UBOOT_ARCH'),  d.getVar("FIT_CONF_PREFIX"),
+        oe.types.boolean(d.getVar('FIT_CONF_STRIP_EXT')),
         oe.types.boolean(d.getVar('FIT_KERNEL_SIGN_ENABLE')), d.getVar("FIT_KERNEL_SIGN_KEYDIR"),
         d.getVar("UBOOT_MKIMAGE"), d.getVar("UBOOT_MKIMAGE_DTCOPTS"),
         d.getVar("UBOOT_MKIMAGE_SIGN"), d.getVar("UBOOT_MKIMAGE_SIGN_ARGS"),
diff --git a/meta/conf/image-fitimage.conf b/meta/conf/image-fitimage.conf
index 090ee148f4..6bf0dd1299 100644
--- a/meta/conf/image-fitimage.conf
+++ b/meta/conf/image-fitimage.conf
@@ -35,6 +35,9 @@ FIT_SIGN_INDIVIDUAL ?= "0"
 FIT_CONF_PREFIX ?= "conf-"
 FIT_CONF_PREFIX[doc] = "Prefix to use for FIT configuration node name"
 
+FIT_CONF_STRIP_EXT ?= "0"
+FIT_CONF_STRIP_EXT[doc] = "Set true to strip a possible file-type extension from a FIT configuration node name"
+
 FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio"
 
 # Allow user to support special use cases where the kernel binary is
diff --git a/meta/lib/oe/fitimage.py b/meta/lib/oe/fitimage.py
index f303799155..bbd5e1843f 100644
--- a/meta/lib/oe/fitimage.py
+++ b/meta/lib/oe/fitimage.py
@@ -154,6 +154,7 @@ class ItsNodeRootKernel(ItsNode):
     firt DTB. If there is no dtb present than the default configuation the kernel.
     """
     def __init__(self, description, address_cells, host_prefix, arch, conf_prefix,
+                 conf_strip_ext=False,
                  sign_enable=False, sign_keydir=None,
                  mkimage=None, mkimage_dtcopts=None,
                  mkimage_sign=None, mkimage_sign_args=None,
@@ -171,6 +172,7 @@ class ItsNodeRootKernel(ItsNode):
         self._host_prefix = host_prefix
         self._arch = arch
         self._conf_prefix = conf_prefix
+        self._conf_strip_ext = conf_strip_ext
 
         # Signature related properties
         self._sign_enable = sign_enable
@@ -468,6 +470,8 @@ class ItsNodeRootKernel(ItsNode):
                 dtb_name = dtb.name
                 if dtb.name.startswith("fdt-"):
                     dtb_name = dtb.name[len("fdt-"):]
+                if self._conf_strip_ext:
+                    dtb_name = dtb_name.rsplit(".", 1)[0]
                 self._fitimage_emit_one_section_config(self._conf_prefix + dtb_name, dtb)
             for dtb in self._dtb_alias:
                 self._fitimage_emit_one_section_config(self._conf_prefix + dtb.alias_name, dtb)
diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py
index 8df5e92a34..84741f10ae 100644
--- a/meta/lib/oeqa/selftest/cases/fitimage.py
+++ b/meta/lib/oeqa/selftest/cases/fitimage.py
@@ -412,6 +412,7 @@ class KernelFitImageBase(FitImageTestCase):
             'DEPLOY_DIR_IMAGE',
             'FIT_CONF_DEFAULT_DTB',
             'FIT_CONF_PREFIX',
+            'FIT_CONF_STRIP_EXT',
             'FIT_DESC',
             'FIT_HASH_ALG',
             'FIT_KERNEL_COMP_ALG',
@@ -1070,6 +1071,7 @@ class FitImagePyTests(KernelFitImageBase):
             'FIT_ADDRESS_CELLS': "1",
             'FIT_CONF_DEFAULT_DTB': "",
             'FIT_CONF_PREFIX': "conf-",
+            'FIT_CONF_STRIP_EXT': "0",
             'FIT_DESC': "Kernel fitImage for a dummy distro",
             'FIT_GENERATE_KEYS': "0",
             'FIT_HASH_ALG': "sha256",
@@ -1115,6 +1117,7 @@ class FitImagePyTests(KernelFitImageBase):
         root_node = oe.fitimage.ItsNodeRootKernel(
             bb_vars["FIT_DESC"], bb_vars["FIT_ADDRESS_CELLS"],
             bb_vars['HOST_PREFIX'], bb_vars['UBOOT_ARCH'],  bb_vars["FIT_CONF_PREFIX"],
+            oe.types.boolean(bb_vars['FIT_CONF_STRIP_EXT']),
             oe.types.boolean(bb_vars['UBOOT_SIGN_ENABLE']), bb_vars["UBOOT_SIGN_KEYDIR"],
             bb_vars["UBOOT_MKIMAGE"], bb_vars["UBOOT_MKIMAGE_DTCOPTS"],
             bb_vars["UBOOT_MKIMAGE_SIGN"], bb_vars["UBOOT_MKIMAGE_SIGN_ARGS"],
-- 
2.47.3



             reply	other threads:[~2026-01-07  9:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-07  9:26 Richard Leitner [this message]
2026-01-09  8:09 ` [OE-core] [PATCH] fitimage: introduce FIT_CONF_STRIP_EXT Mathieu Dubois-Briand
2026-01-09  8:28   ` Richard Leitner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260107092600.73848-1-dev@g0hl1n.net \
    --to=dev@g0hl1n.net \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox