All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy MacLeod <randy.macleod@windriver.com>
To: kavinaya@qti.qualcomm.com,
	openembedded-core@lists.openembedded.org,
	Adrian Freihofer <adrian.freihofer@gmail.com>
Cc: reatmon@ti.com, benjamin.missey@non.se.com
Subject: Re: [OE-core] [PATCH v2] fitimage: Add support for UBOOT_MKIMAGE_EXTRA_OPTS
Date: Mon, 15 Dec 2025 13:17:24 -0500	[thread overview]
Message-ID: <57dd38bf-653d-4b74-8de4-d05f4d2b9797@windriver.com> (raw)
In-Reply-To: <20251210110443.3230272-1-kavinaya@qti.qualcomm.com>

[-- Attachment #1: Type: text/plain, Size: 5550 bytes --]


Kavinaya, Adrian,   and others who have touched:
    meta/classes-recipe/kernel-fit-image.bbclass
in the last  ~ year.

This needs more review than we had time for in the YP patch review 
meeting today.

I think the concern was that there had been some independent 
improvements to fitimage
and that perhaps no one was looking at the overall design.

This may be a red herring but for example, is there overlap with:
    meta/classes/kernel-fitimage.bbclass
    # Options for the device tree compiler passed to mkimage '-D' feature:
    UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000"

If you think this is a sensible, maintainable change, do say so and 
explain your point of view.

Please don't shoot the messenger, as I don't work with u-boot or 
fitImage myself !


Thanks,

../Randy


On 2025-12-10 6:04 a.m., Kavinaya S via lists.openembedded.org wrote:
> Currently, mkimage options in U-Boot recipes are fixed, which limits
> flexibility for platforms that require additional mkimage arguments.
> Introduce UBOOT_MKIMAGE_EXTRA_OPTS to allow passing extra options to
> mkimage during image generation.
>
> This is a generic need because different SoCs and boot configurations
> often require mkimage flags beyond the defaults. For example:
> - `-E` enables external data in FIT images, which is essential for
>    modular boot setups, secure boot workflows, and reducing image size.
> - `-B 8` enforces 8-byte alignment, ensuring compatibility with boot
>    ROM requirements, improving memory access efficiency, and supporting
>    predictable offsets for multi-component FIT images.
>
> By exposing this variable, we provide a clean and extensible mechanism
> for developers to meet hardware-specific and security requirements
> without hardcoding options in recipes.
>
> Example:
>
> UBOOT_MKIMAGE_EXTRA_OPTS = "-B 8 -E"
> will result in the mkimage command being invoked as:
> `mkimage -B 8 -E -f fitImage.its fitImage.itb`
>
> Signed-off-by: Kavinaya S<kavinaya@qti.qualcomm.com>
> ---
>   meta/classes-recipe/kernel-fit-image.bbclass | 1 +
>   meta/conf/image-fitimage.conf                | 3 +++
>   meta/lib/oe/fitimage.py                      | 3 +++
>   3 files changed, 7 insertions(+)
>
> diff --git a/meta/classes-recipe/kernel-fit-image.bbclass b/meta/classes-recipe/kernel-fit-image.bbclass
> index fd0d21ceee..5456311f00 100644
> --- a/meta/classes-recipe/kernel-fit-image.bbclass
> +++ b/meta/classes-recipe/kernel-fit-image.bbclass
> @@ -56,6 +56,7 @@ python do_compile() {
>           d.getVar('HOST_PREFIX'), d.getVar('UBOOT_ARCH'),  d.getVar("FIT_CONF_PREFIX"),
>           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_EXTRA_OPTS'),
>           d.getVar("UBOOT_MKIMAGE_SIGN"), d.getVar("UBOOT_MKIMAGE_SIGN_ARGS"),
>           d.getVar('FIT_HASH_ALG'), d.getVar('FIT_SIGN_ALG'), d.getVar('FIT_PAD_ALG'),
>           d.getVar('FIT_KERNEL_SIGN_KEYNAME'),
> diff --git a/meta/conf/image-fitimage.conf b/meta/conf/image-fitimage.conf
> index 090ee148f4..e470adad5c 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 ?= ""
>   
> +# Additional mkimage options for FIT image creation
> +UBOOT_MKIMAGE_EXTRA_OPTS ?= ""
> +
>   # length of address in number of <u32> cells
>   # ex: 1 32bits address, 2 64bits address
>   FIT_ADDRESS_CELLS ?= "1"
> diff --git a/meta/lib/oe/fitimage.py b/meta/lib/oe/fitimage.py
> index f303799155..15a36310e0 100644
> --- a/meta/lib/oe/fitimage.py
> +++ b/meta/lib/oe/fitimage.py
> @@ -156,6 +156,7 @@ class ItsNodeRootKernel(ItsNode):
>       def __init__(self, description, address_cells, host_prefix, arch, conf_prefix,
>                    sign_enable=False, sign_keydir=None,
>                    mkimage=None, mkimage_dtcopts=None,
> +                 mkimage_extra_opts=None,
>                    mkimage_sign=None, mkimage_sign_args=None,
>                    hash_algo=None, sign_algo=None, pad_algo=None,
>                    sign_keyname_conf=None,
> @@ -177,6 +178,7 @@ class ItsNodeRootKernel(ItsNode):
>           self._sign_keydir = sign_keydir
>           self._mkimage = mkimage
>           self._mkimage_dtcopts = mkimage_dtcopts
> +        self._mkimage_extra_opts = shlex.split(mkimage_extra_opts)
>           self._mkimage_sign = mkimage_sign
>           self._mkimage_sign_args = mkimage_sign_args
>           self._hash_algo = hash_algo
> @@ -483,6 +485,7 @@ class ItsNodeRootKernel(ItsNode):
>       def run_mkimage_assemble(self, itsfile, fitfile):
>           cmd = [
>               self._mkimage,
> +            *self._mkimage_extra_opts,
>               '-f', itsfile,
>               fitfile
>           ]
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#227471):https://lists.openembedded.org/g/openembedded-core/message/227471
> Mute This Topic:https://lists.openembedded.org/mt/116710036/3616765
> Group Owner:openembedded-core+owner@lists.openembedded.org
> Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [randy.macleod@windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>

-- 
# Randy MacLeod
# Wind River Linux

[-- Attachment #2: Type: text/html, Size: 7464 bytes --]

  reply	other threads:[~2025-12-15 18:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-10 11:04 [PATCH v2] fitimage: Add support for UBOOT_MKIMAGE_EXTRA_OPTS Kavinaya S
2025-12-15 18:17 ` Randy MacLeod [this message]
2025-12-17 21:31   ` [OE-core] " adrian.freihofer
2025-12-18 11:34     ` Kavinaya S
2025-12-18 11:35     ` Kavinaya S

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=57dd38bf-653d-4b74-8de4-d05f4d2b9797@windriver.com \
    --to=randy.macleod@windriver.com \
    --cc=adrian.freihofer@gmail.com \
    --cc=benjamin.missey@non.se.com \
    --cc=kavinaya@qti.qualcomm.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=reatmon@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.