From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Ming Liu <liu.ming50@gmail.com>
Cc: openembedded-core@lists.openembedded.org, max.krummenacher@toradex.com
Subject: Re: [OE-core] [PATCH] meta: introduce UBOOT_MKIMAGE_KERNEL_TYPE
Date: Wed, 6 Jul 2022 16:06:12 +0200 [thread overview]
Message-ID: <YsWW1I3LrrA4YTv1@mail.local> (raw)
In-Reply-To: <20220706111028.149100-1-liu.ming50@gmail.com>
Hello,
On 06/07/2022 13:10:28+0200, Ming Liu wrote:
> From: Ming Liu <liu.ming50@gmail.com>
>
> Sometimes an end user might want to choose another kernel type argument
> for uboot-mkimage other than "kernel", for instance: "kernel_noload".
>
> Let's introduce a variable UBOOT_MKIMAGE_KERNEL_TYPE to support that,
> and it could be used by BSP layers as well.
>
> Signed-off-by: Ming Liu <liu.ming50@gmail.com>
> ---
> meta/classes/kernel-fitimage.bbclass | 2 +-
> meta/classes/kernel-uboot.bbclass | 3 +++
> meta/classes/kernel-uimage.bbclass | 2 +-
> meta/lib/oeqa/selftest/cases/fitimage.py | 3 ++-
> 4 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
> index 7e09b075ff..2112ae4cfa 100644
> --- a/meta/classes/kernel-fitimage.bbclass
> +++ b/meta/classes/kernel-fitimage.bbclass
> @@ -148,7 +148,7 @@ fitimage_emit_section_kernel() {
> kernel-$2 {
> description = "Linux kernel";
> data = /incbin/("$3");
> - type = "kernel";
> + type = "${UBOOT_MKIMAGE_KERNEL_TYPE}";
> arch = "${UBOOT_ARCH}";
> os = "linux";
> compression = "$4";
> diff --git a/meta/classes/kernel-uboot.bbclass b/meta/classes/kernel-uboot.bbclass
> index 2facade818..1bc98e042d 100644
> --- a/meta/classes/kernel-uboot.bbclass
> +++ b/meta/classes/kernel-uboot.bbclass
> @@ -2,6 +2,9 @@
> FIT_KERNEL_COMP_ALG ?= "gzip"
> FIT_KERNEL_COMP_ALG_EXTENSION ?= ".gz"
>
> +# Kernel image type passed to mkimage (i.e. kernel kernel_noload...)
> +UBOOT_MKIMAGE_KERNEL_TYPE ?= "kernel"
> +
> uboot_prep_kimage() {
> if [ -e arch/${ARCH}/boot/compressed/vmlinux ]; then
> vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux"
> diff --git a/meta/classes/kernel-uimage.bbclass b/meta/classes/kernel-uimage.bbclass
> index cedb4fa070..e116bf0265 100644
> --- a/meta/classes/kernel-uimage.bbclass
> +++ b/meta/classes/kernel-uimage.bbclass
> @@ -30,6 +30,6 @@ do_uboot_mkimage() {
> awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'`
> fi
>
> - uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C "${linux_comp}" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${B}/arch/${ARCH}/boot/uImage
> + uboot-mkimage -A ${UBOOT_ARCH} -O ${UBOOT_MKIMAGE_KERNEL_TYPE} -T kernel -C "${linux_comp}" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${B}/arch/${ARCH}/boot/uImage
I feel like you replace the wrong argument here.
> rm -f linux.bin
> }
> diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py
> index e6bfd1257e..7e6479c9ca 100644
> --- a/meta/lib/oeqa/selftest/cases/fitimage.py
> +++ b/meta/lib/oeqa/selftest/cases/fitimage.py
> @@ -763,6 +763,7 @@ FIT_HASH_ALG = "sha256"
>
> kernel_load = str(get_bb_var('UBOOT_LOADADDRESS'))
> kernel_entry = str(get_bb_var('UBOOT_ENTRYPOINT'))
> + kernel_type = str(get_bb_var('UBOOT_MKIMAGE_KERNEL_TYPE'))
> kernel_compression = str(get_bb_var('FIT_KERNEL_COMP_ALG'))
> uboot_arch = str(get_bb_var('UBOOT_ARCH'))
> fit_hash_alg = str(get_bb_var('FIT_HASH_ALG'))
> @@ -775,7 +776,7 @@ FIT_HASH_ALG = "sha256"
> 'kernel-1 {',
> 'description = "Linux kernel";',
> 'data = /incbin/("linux.bin");',
> - 'type = "kernel";',
> + 'type = "' + kernel_type + '";',
> 'arch = "' + uboot_arch + '";',
> 'os = "linux";',
> 'compression = "' + kernel_compression + '";',
> --
> 2.25.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#167719): https://lists.openembedded.org/g/openembedded-core/message/167719
> Mute This Topic: https://lists.openembedded.org/mt/92204115/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2022-07-06 14:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 11:10 [OE-core] [PATCH] meta: introduce UBOOT_MKIMAGE_KERNEL_TYPE liu.ming50
2022-07-06 14:06 ` Alexandre Belloni [this message]
2022-07-07 9:53 ` Ming Liu
2022-07-07 10:26 ` Alexandre Belloni
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=YsWW1I3LrrA4YTv1@mail.local \
--to=alexandre.belloni@bootlin.com \
--cc=liu.ming50@gmail.com \
--cc=max.krummenacher@toradex.com \
--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