diff mbox series

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

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

Commit Message

Hongxu Jia June 5, 2025, 2:37 p.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-NO_ISOHYBRID to disable or enable isohybrid, but still enable
isohybrid by default as usual. User could set NO_ISOHYBRID = "1" 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(-)

Comments

Gyorgy Sarvari June 5, 2025, 2:51 p.m. UTC | #1
On 6/5/25 16:37, hongxu via lists.openembedded.org wrote:
> Add var-NO_ISOHYBRID to disable or enable isohybrid, but still enable
> isohybrid by default as usual. User could set NO_ISOHYBRID = "1" in
> local.conf to disable it

Could this be please reversed? Like call it ISOHYBRID (or
ENABLE_ISOHYBRID, USE_ISOHYBRID...) instead of NO_ISOHYBRID and reverse
the current logic also accordingly? Possibly I'm dense, but I always
have to think 3 times when I face double-negation-enablements (and I
still set it incorrectly half of the time).
diff mbox series

Patch

diff --git a/meta/classes-recipe/image-live.bbclass b/meta/classes-recipe/image-live.bbclass
index d2e95ef51c3..743b7394d72 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"
 
+
+NO_ISOHYBRID ?= "0"
 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 [ "${NO_ISOHYBRID}" != "1" ]; then
+		isohybrid $isohybrid_args ${IMGDEPLOYDIR}/${IMAGE_NAME}.iso
+	fi
 }
 
 build_fat_img() {