diff mbox series

image-live.bbclass: Adjust the default value for INITRD_LIVE

Message ID 20240303065454.4141916-1-haokexin@gmail.com
State New
Headers show
Series image-live.bbclass: Adjust the default value for INITRD_LIVE | expand

Commit Message

Kevin Hao March 3, 2024, 6:54 a.m. UTC
From: Kevin Hao <kexin.hao@windriver.com>

- After the commit 26d97acc7137 ("image-artifact-names: include
${IMAGE_NAME_SUFFIX} directly in both ${IMAGE_NAME} and
${IMAGE_LINK_NAME}"), the image names have changed from
  core-image-minimal-qemux86-64-20230307181808.rootfs.ext4
  core-image-minimal-qemux86-64.ext4
to
  core-image-minimal-qemux86-64.rootfs-20230307181456.ext4
  core-image-minimal-qemux86-64.rootfs.ext4
So we also need to add ${IMAGE_NAME_SUFFIX} to the default INITRD_LIVE.

- The ${INITRAMFS_FSTYPES} may contains multi filesystem types,
such as "cpio.gz cpio.xz". So it can't be used directly in setting
of the default INITRD_LIVE. We choose the first filesystem type
in ${INITRAMFS_FSTYPES} for the default INITRD_LIVE.

Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
---
 meta/classes-recipe/image-live.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Purdie March 5, 2024, 12:11 a.m. UTC | #1
On Sun, 2024-03-03 at 14:54 +0800, Kevin Hao wrote:
> From: Kevin Hao <kexin.hao@windriver.com>
> 
> - After the commit 26d97acc7137 ("image-artifact-names: include
> ${IMAGE_NAME_SUFFIX} directly in both ${IMAGE_NAME} and
> ${IMAGE_LINK_NAME}"), the image names have changed from
>   core-image-minimal-qemux86-64-20230307181808.rootfs.ext4
>   core-image-minimal-qemux86-64.ext4
> to
>   core-image-minimal-qemux86-64.rootfs-20230307181456.ext4
>   core-image-minimal-qemux86-64.rootfs.ext4
> So we also need to add ${IMAGE_NAME_SUFFIX} to the default INITRD_LIVE.
> 
> - The ${INITRAMFS_FSTYPES} may contains multi filesystem types,
> such as "cpio.gz cpio.xz". So it can't be used directly in setting
> of the default INITRD_LIVE. We choose the first filesystem type
> in ${INITRAMFS_FSTYPES} for the default INITRD_LIVE.
> 
> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
> ---
>  meta/classes-recipe/image-live.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I think this causes:

https://autobuilder.yoctoproject.org/typhoon/#/builders/58/builds/8468/steps/11/logs/stdio

unfortunately.

Cheers,

Richard
Kevin Hao March 5, 2024, 6:32 a.m. UTC | #2
On Tue, Mar 05, 2024 at 12:11:51AM +0000, Richard Purdie wrote:
> On Sun, 2024-03-03 at 14:54 +0800, Kevin Hao wrote:
> > From: Kevin Hao <kexin.hao@windriver.com>
> > 
> > - After the commit 26d97acc7137 ("image-artifact-names: include
> > ${IMAGE_NAME_SUFFIX} directly in both ${IMAGE_NAME} and
> > ${IMAGE_LINK_NAME}"), the image names have changed from
> >   core-image-minimal-qemux86-64-20230307181808.rootfs.ext4
> >   core-image-minimal-qemux86-64.ext4
> > to
> >   core-image-minimal-qemux86-64.rootfs-20230307181456.ext4
> >   core-image-minimal-qemux86-64.rootfs.ext4
> > So we also need to add ${IMAGE_NAME_SUFFIX} to the default INITRD_LIVE.
> > 
> > - The ${INITRAMFS_FSTYPES} may contains multi filesystem types,
> > such as "cpio.gz cpio.xz". So it can't be used directly in setting
> > of the default INITRD_LIVE. We choose the first filesystem type
> > in ${INITRAMFS_FSTYPES} for the default INITRD_LIVE.
> > 
> > Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
> > ---
> >  meta/classes-recipe/image-live.bbclass | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> I think this causes:
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/58/builds/8468/steps/11/logs/stdio
> 
> unfortunately.

Sorry, my default. ${IMAGE_NAME_SUFFIX} shouldn't be added to INITRD_LIVE. V2 is coming.

Thanks,
Kevin
diff mbox series

Patch

diff --git a/meta/classes-recipe/image-live.bbclass b/meta/classes-recipe/image-live.bbclass
index da919d52f983..2029807d2d2e 100644
--- a/meta/classes-recipe/image-live.bbclass
+++ b/meta/classes-recipe/image-live.bbclass
@@ -38,7 +38,7 @@  do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \
 LABELS_LIVE ?= "boot install"
 ROOT_LIVE ?= "root=/dev/ram0"
 INITRD_IMAGE_LIVE ?= "${MLPREFIX}core-image-minimal-initramfs"
-INITRD_LIVE ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE_LIVE}${IMAGE_MACHINE_SUFFIX}.${INITRAMFS_FSTYPES}"
+INITRD_LIVE ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE_LIVE}${IMAGE_MACHINE_SUFFIX}${IMAGE_NAME_SUFFIX}.${@d.getVar('INITRAMFS_FSTYPES').split()[0]}"
 
 LIVE_ROOTFS_TYPE ?= "ext4"
 ROOTFS ?= "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${LIVE_ROOTFS_TYPE}"