All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] live-vm-common.bbclass: conditionally to add kernel and initrd to efi.img of ISO live
@ 2025-03-28 13:02 Hongxu Jia
  2025-03-28 13:02 ` [PATCH 2/2] image-live.bbclass: fix booting EFI ISO live failed Hongxu Jia
  0 siblings, 1 reply; 4+ messages in thread
From: Hongxu Jia @ 2025-03-28 13:02 UTC (permalink / raw)
  To: openembedded-core

Add var-EFI_ISO_KERNEL, if ${EFI_ISO_KERNEL} != "1", do not add kernel and
initrd to efi.img of ISO live.

For grub-efi's ISO live, the kernel and initrd is not necessary in efi.img,
because grub-efi's bootx64.efi sets `search.file ($cmdpath)/EFI/BOOT/grub.cfg root'
to locate kernel and initrd in ISO live image.

It helps while the size of initrd is big to break the limit of efi.img in which
the filesystem type is FAT

Also clean up ${EFIIMGDIR} before populating

Set EFI_ISO_KERNEL ??= "1" by default which adds kernel and initrd to efi.img
as usual

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/classes-recipe/live-vm-common.bbclass | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/meta/classes-recipe/live-vm-common.bbclass b/meta/classes-recipe/live-vm-common.bbclass
index d90cc67ebc..f087d9e236 100644
--- a/meta/classes-recipe/live-vm-common.bbclass
+++ b/meta/classes-recipe/live-vm-common.bbclass
@@ -48,18 +48,25 @@ efi_populate_common() {
         printf 'fs0:%s\%s\n' "$EFIPATH" "${EFI_BOOT_IMAGE}" >${DEST}/startup.nsh
 }
 
+# Kernel(with initrd) image in efi.img of ISO live
+EFI_ISO_KERNEL ??= "1"
+
 efi_iso_populate() {
         iso_dir=$1
         efi_populate $iso_dir
+
+        rm -rf ${EFIIMGDIR}
         # Build a EFI directory to create efi.img
         mkdir -p ${EFIIMGDIR}/${EFIDIR}
         cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
-        cp $iso_dir/${KERNEL_IMAGETYPE} ${EFIIMGDIR}
+        if [ "${EFI_ISO_KERNEL}" = "1" ]; then
+                cp $iso_dir/${KERNEL_IMAGETYPE} ${EFIIMGDIR}
+        fi
 
         EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
         printf 'fs0:%s\%s\n' "$EFIPATH" "${EFI_BOOT_IMAGE}" >${EFIIMGDIR}/startup.nsh
 
-        if [ -f "$iso_dir/initrd" ] ; then
+        if [ -f "$iso_dir/initrd" -a "${EFI_ISO_KERNEL}" = "1" ] ; then
                 cp $iso_dir/initrd ${EFIIMGDIR}
         fi
 }
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-08  4:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-28 13:02 [PATCH 1/2] live-vm-common.bbclass: conditionally to add kernel and initrd to efi.img of ISO live Hongxu Jia
2025-03-28 13:02 ` [PATCH 2/2] image-live.bbclass: fix booting EFI ISO live failed Hongxu Jia
2025-04-07 16:28   ` [OE-core] " Ross Burton
2025-04-08  4:30     ` hongxu

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.