]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
image-live.bbclass: support disable isohybrid for EFI-only boot
authorHongxu Jia <hongxu.jia@windriver.com>
Fri, 20 Jun 2025 05:44:53 +0000 (13:44 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 26 Jun 2025 10:01:18 +0000 (11:01 +0100)
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.

According to [1][2], use `[ "${PCBIOS}" != "1" ] && [ "${EFI}" = "1" ]' as the
EFI-only condition, the revert condition is `[ "${PCBIOS}" = "1" ] || [ "${EFI}" != "1" ]'

[1] https://git.openembedded.org/openembedded-core/commit/?id=be3fc8c07e84c654f55c5d09934dfbdc7ff7e2b6
[2] https://git.openembedded.org/openembedded-core/commit/?id=be95f54495bf9e03062f86b929c66cab6e385a03

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/image-live.bbclass

index d2e95ef51c3abd8bd61f78c74b03b5d1fde478eb..c3054be630104f5773280e940a81b74e6967cd7e 100644 (file)
@@ -147,7 +147,10 @@ build_iso() {
                isohybrid_args="-u"
        fi
 
-       isohybrid $isohybrid_args ${IMGDEPLOYDIR}/${IMAGE_NAME}.iso
+       # EFI only does not need isohybrid
+       if [ "${PCBIOS}" = "1" ]  || [ "${EFI}" != "1" ]; then
+               isohybrid $isohybrid_args ${IMGDEPLOYDIR}/${IMAGE_NAME}.iso
+       fi
 }
 
 build_fat_img() {