diff mbox series

[v6,20/21] kernel.bbclass: remove support for type fitImage

Message ID 20250602075714.32122-21-adrian.freihofer@siemens.com
State Accepted, archived
Commit ec606ef2879ddba750e275dae4dc8ab1e943b259
Headers show
Series FIT image improvements | expand

Commit Message

AdrianF June 2, 2025, 7:56 a.m. UTC
From: Adrian Freihofer <adrian.freihofer@siemens.com>

kernel.bbclass is no longer involved in FIT image creation. Whether a
FIT image is built now depends entirely on whether the linux-yocto-fitimage
recipe (or any other recipe capable of producing a FIT image) is selected
for the build.
As a result, specifying the kernel image type "fitImage" in
KERNEL_IMAGETYPE or KERNEL_IMAGETYPES is no longer necessary and gets
removed.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 meta/classes-recipe/kernel.bbclass | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

Comments

Bruce Ashfield June 2, 2025, 6:59 p.m. UTC | #1
In message: [OE-core] [PATCH v6 20/21] kernel.bbclass: remove support for type fitImage
on 02/06/2025 Adrian Freihofer via lists.openembedded.org wrote:

> From: Adrian Freihofer <adrian.freihofer@siemens.com>
> 
> kernel.bbclass is no longer involved in FIT image creation. Whether a
> FIT image is built now depends entirely on whether the linux-yocto-fitimage
> recipe (or any other recipe capable of producing a FIT image) is selected
> for the build.
> As a result, specifying the kernel image type "fitImage" in
> KERNEL_IMAGETYPE or KERNEL_IMAGETYPES is no longer necessary and gets
> removed.
> 
> Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
> ---
>  meta/classes-recipe/kernel.bbclass | 20 +++++++-------------
>  1 file changed, 7 insertions(+), 13 deletions(-)
> 
> diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
> index 36ce659762e..599996ceb0b 100644
> --- a/meta/classes-recipe/kernel.bbclass
> +++ b/meta/classes-recipe/kernel.bbclass
> @@ -84,6 +84,10 @@ python __anonymous () {
>          types = (alttype + ' ' + types).strip()
>      d.setVar('KERNEL_IMAGETYPES', types)
>  
> +    # Since kernel-fitimage.bbclass got replaced by kernel-fit-image.bbclass
> +    if "fitImage" in types:
> +        bb.error("fitImage is no longer supported as a KERNEL_IMAGETYPE(S)")

Can this be a little be more specific ? Indicating the migration
path (the new recipe) would help someone seeing the message.

> +
>      # KERNEL_IMAGETYPES may contain a mixture of image types supported directly
>      # by the kernel build system and types which are created by post-processing
>      # the output of the kernel build system (e.g. compressing vmlinux ->
> @@ -477,17 +481,10 @@ kernel_do_install() {
>  	install -d ${D}/${KERNEL_IMAGEDEST}
>  
>  	#
> -	# When including an initramfs bundle inside a FIT image, the fitImage is created after the install task
> -	# by do_assemble_fitimage_initramfs.
> -	# This happens after the generation of the initramfs bundle (done by do_bundle_initramfs).
> -	# So, at the level of the install task we should not try to install the fitImage. fitImage is still not
> -	# generated yet.
> -	# After the generation of the fitImage, the deploy task copies the fitImage from the build directory to
> -	# the deploy folder.
> +	# bundle_initramfs runs after do_install before do_deploy. do_deploy does what's needed therefore.
>  	#
> -
>  	for imageType in ${KERNEL_IMAGETYPES} ; do
> -		if [ $imageType != "fitImage" ] || [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ] ; then
> +		if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ] ; then
>  			install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType ${D}/${KERNEL_IMAGEDEST}/$imageType-${KERNEL_VERSION}
>  		fi
>  	done
> @@ -843,11 +840,8 @@ kernel_do_deploy() {
>  		fi
>  	fi
>  
> -	if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
> +	if [ -n "${INITRAMFS_IMAGE}" ] && [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then

Minor 'nit, but the above change is unrelated to the fit image rework :)

Bruce

>  		for imageType in ${KERNEL_IMAGETYPES} ; do
> -			if [ "$imageType" = "fitImage" ] ; then
> -				continue
> -			fi
>  			initramfsBaseName=$imageType-${INITRAMFS_NAME}
>  			install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType.initramfs $deployDir/$initramfsBaseName${KERNEL_IMAGE_BIN_EXT}
>  			if [ -n "${INITRAMFS_LINK_NAME}" ] ; then
> -- 
> 2.49.0
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#217705): https://lists.openembedded.org/g/openembedded-core/message/217705
> Mute This Topic: https://lists.openembedded.org/mt/113424439/1050810
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index 36ce659762e..599996ceb0b 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -84,6 +84,10 @@  python __anonymous () {
         types = (alttype + ' ' + types).strip()
     d.setVar('KERNEL_IMAGETYPES', types)
 
+    # Since kernel-fitimage.bbclass got replaced by kernel-fit-image.bbclass
+    if "fitImage" in types:
+        bb.error("fitImage is no longer supported as a KERNEL_IMAGETYPE(S)")
+
     # KERNEL_IMAGETYPES may contain a mixture of image types supported directly
     # by the kernel build system and types which are created by post-processing
     # the output of the kernel build system (e.g. compressing vmlinux ->
@@ -477,17 +481,10 @@  kernel_do_install() {
 	install -d ${D}/${KERNEL_IMAGEDEST}
 
 	#
-	# When including an initramfs bundle inside a FIT image, the fitImage is created after the install task
-	# by do_assemble_fitimage_initramfs.
-	# This happens after the generation of the initramfs bundle (done by do_bundle_initramfs).
-	# So, at the level of the install task we should not try to install the fitImage. fitImage is still not
-	# generated yet.
-	# After the generation of the fitImage, the deploy task copies the fitImage from the build directory to
-	# the deploy folder.
+	# bundle_initramfs runs after do_install before do_deploy. do_deploy does what's needed therefore.
 	#
-
 	for imageType in ${KERNEL_IMAGETYPES} ; do
-		if [ $imageType != "fitImage" ] || [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ] ; then
+		if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ] ; then
 			install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType ${D}/${KERNEL_IMAGEDEST}/$imageType-${KERNEL_VERSION}
 		fi
 	done
@@ -843,11 +840,8 @@  kernel_do_deploy() {
 		fi
 	fi
 
-	if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
+	if [ -n "${INITRAMFS_IMAGE}" ] && [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then
 		for imageType in ${KERNEL_IMAGETYPES} ; do
-			if [ "$imageType" = "fitImage" ] ; then
-				continue
-			fi
 			initramfsBaseName=$imageType-${INITRAMFS_NAME}
 			install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType.initramfs $deployDir/$initramfsBaseName${KERNEL_IMAGE_BIN_EXT}
 			if [ -n "${INITRAMFS_LINK_NAME}" ] ; then