diff mbox series

[V2] image-live.bbclass: support to enable/disable isohybrid

Message ID 20250609022512.1657737-1-hongxu.jia@windriver.com
State New
Headers show
Series [V2] image-live.bbclass: support to enable/disable isohybrid | expand

Commit Message

Hongxu Jia June 9, 2025, 2:25 a.m. UTC
While NO PCBIOS and EFI only for ISO 9660 image, burn the image
to SandDisk USB stick, plug it into laptop, then boot laptop and
enter UEFI mode, there are two boot options in UEFI system.

Here is the steps:

$ echo 'MACHINE = "genericx86-64"' >> conf/local.conf
$ echo 'MACHINE_FEATURES:remove = "pcbios"' >> conf/local.conf
$ echo 'IMAGE_FSTYPES:pn-core-image-minimal = " live"' >> conf/local.conf
$ bitbake core-image-minimal
$ sudo dd if=tmp/deploy/images/genericx86-64/core-image-minimal-genericx86-64.rootfs.iso of=/dev/sda

Boot laptop and entery UEFI mode
...
Boot mode is set to: UEFI

UEFI BOOT:
    UEFI: SanDisk
    UEFI: SanDisk 2
...

In this case, PCBIOS is not used, calling isohybrid for ISO 9660 image
is not necessary, and do not call isohybrid for ISO 9660 image could
remove duplicated boot option in UEFI mode.

Add var-ENABLE_ISOHYBRID to disable or enable isohybrid, but still enable
isohybrid by default as usual. User could set ENABLE_ISOHYBRID = "0" in
local.conf to disable it

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/classes-recipe/image-live.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/image-live.bbclass b/meta/classes-recipe/image-live.bbclass
index d2e95ef51c3..cf8efb2c9b2 100644
--- a/meta/classes-recipe/image-live.bbclass
+++ b/meta/classes-recipe/image-live.bbclass
@@ -63,6 +63,8 @@  ISODIR = "${S}/iso"
 EFIIMGDIR = "${S}/efi_img"
 COMPACT_ISODIR = "${S}/iso.z"
 
+
+ENABLE_ISOHYBRID ??= "1"
 ISOLINUXDIR ?= "/isolinux"
 ISO_BOOTIMG = "isolinux/isolinux.bin"
 ISO_BOOTCAT = "isolinux/boot.cat"
@@ -147,7 +149,9 @@  build_iso() {
 		isohybrid_args="-u"
 	fi
 
-	isohybrid $isohybrid_args ${IMGDEPLOYDIR}/${IMAGE_NAME}.iso
+	if [ "${ENABLE_ISOHYBRID}" = "1" ]; then
+		isohybrid $isohybrid_args ${IMGDEPLOYDIR}/${IMAGE_NAME}.iso
+	fi
 }
 
 build_fat_img() {