* [PATCH v5 1/4] wic bootimg-efi.py: fail build if no binaries installed
@ 2025-05-28 12:56 Mikko Rapeli
2025-05-28 12:56 ` [PATCH v5 2/4] image_types_wic.bbclass: depend on grub-efi and systemd-boot on aarch64, systemd-boot on arm Mikko Rapeli
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Mikko Rapeli @ 2025-05-28 12:56 UTC (permalink / raw)
To: openembedded-core; +Cc: Mikko Rapeli
With systemd-boot, some builds included correct EFI
bootloader binaries and some not. Thus some builds
booted and some not. Check that some boot binary
was installed so that build fails if none were installed.
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
scripts/lib/wic/plugins/source/bootimg-efi.py | 7 +++++++
1 file changed, 7 insertions(+)
v5: separated from modular kernel changes, changed from shell "ls" command to
python glob
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 96c710bf77..e0ee2f7127 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -367,6 +367,13 @@ class BootimgEFIPlugin(SourcePlugin):
else:
raise WicError("unrecognized bootimg-efi loader: %s" %
source_params['loader'])
+
+ # must have installed at least one EFI bootloader
+ out = glob(os.path.join(hdddir, 'EFI', 'BOOT', 'boot*.efi'))
+ logger.debug("Installed systemd-boot files:\n%s" % out)
+ if not out:
+ raise WicError("No EFI loaders installed to ESP partition. Check that grub-efi, systemd-boot or similar is installed.")
+
except KeyError:
raise WicError("bootimg-efi requires a loader, none specified")
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v5 2/4] image_types_wic.bbclass: depend on grub-efi and systemd-boot on aarch64, systemd-boot on arm 2025-05-28 12:56 [PATCH v5 1/4] wic bootimg-efi.py: fail build if no binaries installed Mikko Rapeli @ 2025-05-28 12:56 ` Mikko Rapeli 2025-05-28 12:56 ` [PATCH v5 3/4] image_types_wic.bbclass: remove os-release from WKS_FILE_DEPENDS_BOOTLOADERS on x86 and x86_64 Mikko Rapeli ` (2 subsequent siblings) 3 siblings, 0 replies; 6+ messages in thread From: Mikko Rapeli @ 2025-05-28 12:56 UTC (permalink / raw) To: openembedded-core; +Cc: Mikko Rapeli On x86 family builds, grub and systemd-boot are always included and thus get built and deployed before wic image builds. On aarch64 builds that was not the case. Result is that some builds added systemd-boot binaries to the wic image ESP partition and some not, though bugs in wic plugins contributed here too since missing files were silently ignored. Boot of such images fails since firmware is not able to load the default EFI binaries. Adding EFI_PROVIDER to WKS_FILE_DEPENDS_BOOTLOADERS is not possible because of parsing order so adding grub-efi and systemd-boot to aarch64 and systemd-boot to arm depends which makes sure their do_deploy is always executed before wic image is generated. Thus systemd-boot and grub binaries will get copied from deploy directory to the wic image ESP partition, and boot of the images succeeds. Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> --- meta/classes-recipe/image_types_wic.bbclass | 2 ++ 1 file changed, 2 insertions(+) v5: separated from modular kernel/systemd initrd series, os-release removal added as separate commit diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass index 61f028bd7b..90bf8c7a60 100644 --- a/meta/classes-recipe/image_types_wic.bbclass +++ b/meta/classes-recipe/image_types_wic.bbclass @@ -111,6 +111,8 @@ WKS_FILE_DEPENDS_DEFAULT += "bmaptool-native cdrtools-native btrfs-tools-native # Unified kernel images need objcopy WKS_FILE_DEPENDS_DEFAULT += "virtual/cross-binutils" WKS_FILE_DEPENDS_BOOTLOADERS = "" +WKS_FILE_DEPENDS_BOOTLOADERS:aarch64 = "grub-efi systemd-boot" +WKS_FILE_DEPENDS_BOOTLOADERS:arm = "systemd-boot" WKS_FILE_DEPENDS_BOOTLOADERS:x86 = "syslinux grub-efi systemd-boot os-release" WKS_FILE_DEPENDS_BOOTLOADERS:x86-64 = "syslinux systemd-boot os-release" WKS_FILE_DEPENDS_BOOTLOADERS:x86-x32 = "syslinux grub-efi" -- 2.43.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v5 3/4] image_types_wic.bbclass: remove os-release from WKS_FILE_DEPENDS_BOOTLOADERS on x86 and x86_64 2025-05-28 12:56 [PATCH v5 1/4] wic bootimg-efi.py: fail build if no binaries installed Mikko Rapeli 2025-05-28 12:56 ` [PATCH v5 2/4] image_types_wic.bbclass: depend on grub-efi and systemd-boot on aarch64, systemd-boot on arm Mikko Rapeli @ 2025-05-28 12:56 ` Mikko Rapeli 2025-05-28 12:56 ` [PATCH v5 4/4] image_types_wic.bbclass: capture verbose wic output by default Mikko Rapeli 2025-05-29 13:55 ` [OE-core] [PATCH v5 1/4] wic bootimg-efi.py: fail build if no binaries installed Mathieu Dubois-Briand 3 siblings, 0 replies; 6+ messages in thread From: Mikko Rapeli @ 2025-05-28 12:56 UTC (permalink / raw) To: openembedded-core; +Cc: Mikko Rapeli os-release was needed with UKI generation when this was done using wic plugin but now with separate uki.bbclass wic does not need it anymore. Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> --- meta/classes-recipe/image_types_wic.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass index 90bf8c7a60..a64beda95e 100644 --- a/meta/classes-recipe/image_types_wic.bbclass +++ b/meta/classes-recipe/image_types_wic.bbclass @@ -113,8 +113,8 @@ WKS_FILE_DEPENDS_DEFAULT += "virtual/cross-binutils" WKS_FILE_DEPENDS_BOOTLOADERS = "" WKS_FILE_DEPENDS_BOOTLOADERS:aarch64 = "grub-efi systemd-boot" WKS_FILE_DEPENDS_BOOTLOADERS:arm = "systemd-boot" -WKS_FILE_DEPENDS_BOOTLOADERS:x86 = "syslinux grub-efi systemd-boot os-release" -WKS_FILE_DEPENDS_BOOTLOADERS:x86-64 = "syslinux systemd-boot os-release" +WKS_FILE_DEPENDS_BOOTLOADERS:x86 = "syslinux grub-efi systemd-boot" +WKS_FILE_DEPENDS_BOOTLOADERS:x86-64 = "syslinux systemd-boot" WKS_FILE_DEPENDS_BOOTLOADERS:x86-x32 = "syslinux grub-efi" WKS_FILE_DEPENDS ??= "${WKS_FILE_DEPENDS_DEFAULT} ${WKS_FILE_DEPENDS_BOOTLOADERS}" -- 2.43.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v5 4/4] image_types_wic.bbclass: capture verbose wic output by default 2025-05-28 12:56 [PATCH v5 1/4] wic bootimg-efi.py: fail build if no binaries installed Mikko Rapeli 2025-05-28 12:56 ` [PATCH v5 2/4] image_types_wic.bbclass: depend on grub-efi and systemd-boot on aarch64, systemd-boot on arm Mikko Rapeli 2025-05-28 12:56 ` [PATCH v5 3/4] image_types_wic.bbclass: remove os-release from WKS_FILE_DEPENDS_BOOTLOADERS on x86 and x86_64 Mikko Rapeli @ 2025-05-28 12:56 ` Mikko Rapeli 2025-05-29 13:55 ` [OE-core] [PATCH v5 1/4] wic bootimg-efi.py: fail build if no binaries installed Mathieu Dubois-Briand 3 siblings, 0 replies; 6+ messages in thread From: Mikko Rapeli @ 2025-05-28 12:56 UTC (permalink / raw) To: openembedded-core; +Cc: Mikko Rapeli Call wic with --debug to capture logs from wic internals so that it's clear which partitions get created and which files get copied where. wic plugins contain for example race conditions which don't install files at all and thus images fail to boot and it's not possible to debug these without something in wic task logs. As an example core-image-initramfs-boot do_image_wic log is now 576 lines which is not excessive but very important when debugging problems, especially race conditions which are only hit in some builds in CI. With all issues I have to deal within wic, I always need to apply this change before I get to see any details what wic and its plugins are doing. Thus I strongly believe this verbose outuput should be the default. Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> --- meta/classes-recipe/image_types_wic.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) v5: no changes, v4 caused pseudo aborts on autobuilder but these are likely fixed now after path inclusion list changes v4: https://lists.openembedded.org/g/openembedded-core/message/215221 v3: https://lists.openembedded.org/g/openembedded-core/message/214360 diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass index a64beda95e..7c6a6f2e23 100644 --- a/meta/classes-recipe/image_types_wic.bbclass +++ b/meta/classes-recipe/image_types_wic.bbclass @@ -72,7 +72,7 @@ IMAGE_CMD:wic () { if [ -z "$wks" ]; then bbfatal "No kickstart files from WKS_FILES were found: ${WKS_FILES}. Please set WKS_FILE or WKS_FILES appropriately." fi - BUILDDIR="${TOPDIR}" PSEUDO_UNLOAD=1 wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$build_wic/" -w "$tmp_wic" ${WIC_CREATE_EXTRA_ARGS} + BUILDDIR="${TOPDIR}" PSEUDO_UNLOAD=1 wic create --debug "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$build_wic/" -w "$tmp_wic" ${WIC_CREATE_EXTRA_ARGS} # look to see if the user specifies a custom imager IMAGER=direct -- 2.43.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH v5 1/4] wic bootimg-efi.py: fail build if no binaries installed 2025-05-28 12:56 [PATCH v5 1/4] wic bootimg-efi.py: fail build if no binaries installed Mikko Rapeli ` (2 preceding siblings ...) 2025-05-28 12:56 ` [PATCH v5 4/4] image_types_wic.bbclass: capture verbose wic output by default Mikko Rapeli @ 2025-05-29 13:55 ` Mathieu Dubois-Briand 2025-05-30 8:30 ` Mikko Rapeli 3 siblings, 1 reply; 6+ messages in thread From: Mathieu Dubois-Briand @ 2025-05-29 13:55 UTC (permalink / raw) To: mikko.rapeli, openembedded-core On Wed May 28, 2025 at 2:56 PM CEST, Mikko Rapeli via lists.openembedded.org wrote: > With systemd-boot, some builds included correct EFI > bootloader binaries and some not. Thus some builds > booted and some not. Check that some boot binary > was installed so that build fails if none were installed. > > Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> > --- Hi Mikko, It looks like we have a new selftest error: 2025-05-29 06:41:09,920 - oe-selftest - INFO - overlayfs.OverlayFSEtcRunTimeTests.test_image_feature_is_missing (subunit.RemotedTestCase) 2025-05-29 06:41:09,921 - oe-selftest - INFO - ... FAIL ... ERROR: core-image-minimal-1.0-r0 do_image_wic: Execution of '/srv/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-1199444/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/temp/run.do_image_wic.2027179' failed with exit code 1 ... | ERROR: No EFI loaders installed to ESP partition. Check that grub-efi, systemd-boot or similar is installed. https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/1649 https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/1590 Can you have a look please? -- Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH v5 1/4] wic bootimg-efi.py: fail build if no binaries installed 2025-05-29 13:55 ` [OE-core] [PATCH v5 1/4] wic bootimg-efi.py: fail build if no binaries installed Mathieu Dubois-Briand @ 2025-05-30 8:30 ` Mikko Rapeli 0 siblings, 0 replies; 6+ messages in thread From: Mikko Rapeli @ 2025-05-30 8:30 UTC (permalink / raw) To: Mathieu Dubois-Briand; +Cc: openembedded-core Hi, On Thu, May 29, 2025 at 03:55:56PM +0200, Mathieu Dubois-Briand wrote: > On Wed May 28, 2025 at 2:56 PM CEST, Mikko Rapeli via lists.openembedded.org wrote: > > With systemd-boot, some builds included correct EFI > > bootloader binaries and some not. Thus some builds > > booted and some not. Check that some boot binary > > was installed so that build fails if none were installed. > > > > Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> > > --- > > Hi Mikko, > > It looks like we have a new selftest error: > > 2025-05-29 06:41:09,920 - oe-selftest - INFO - overlayfs.OverlayFSEtcRunTimeTests.test_image_feature_is_missing (subunit.RemotedTestCase) > 2025-05-29 06:41:09,921 - oe-selftest - INFO - ... FAIL > ... > ERROR: core-image-minimal-1.0-r0 do_image_wic: Execution of '/srv/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-1199444/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/temp/run.do_image_wic.2027179' failed with exit code 1 > ... > | ERROR: No EFI loaders installed to ESP partition. Check that grub-efi, systemd-boot or similar is installed. > > https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/1649 > https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/1590 > > Can you have a look please? Thanks to verbose wic logs I can see from https://autobuilder.yoctoproject.org/valkyrie/api/v2/logs/2526606/raw_inline | DEBUG: _exec_cmd: install -d /srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/tmp-wic/hdd/boot/EFI/BOOT | DEBUG: ['install', '-d', '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/tmp-wic/hdd/boot/EFI/BOOT'] | DEBUG: _exec_cmd: output for install -d /srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/tmp-wic/hdd/boot/EFI/BOOT (rc = 0): | DEBUG: Ignoring missing initrd | DEBUG: Writing grubefi config /srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/tmp-wic/hdd/boot/EFI/BOOT/grub.cfg | DEBUG: No boot files defined in IMAGE_EFI_BOOT_FILES | DEBUG: _exec_cmd: install -d /srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/tmp-wic/hdd/boot | DEBUG: ['install', '-d', '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/tmp-wic/hdd/boot'] | DEBUG: _exec_cmd: output for install -d /srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/tmp-wic/hdd/boot (rc = 0): | DEBUG: Writing syslinux config /srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/tmp-wic/hdd/boot/syslinux.cfg | DEBUG: SourcePlugin: do_stage_partition: part: <wic.partition.Partition object at 0x7f026ffef230> | DEBUG: _exec_cmd: install -v -p -m 0644 /srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/deploy/images/qemux86-64/bzImage /srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/tmp-wic/hdd/boot/bzImage | DEBUG: ['install', '-v', '-p', '-m', '0644', '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/deploy/images/qemux86-64/bzImage', '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/tmp-wic/hdd/boot/bzImage'] | DEBUG: _exec_cmd: output for install -v -p -m 0644 /srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/deploy/images/qemux86-64/bzImage /srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/tmp-wic/hdd/boot/bzImage (rc = 0): '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/deploy/images/qemux86-64/bzImage' -> '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/tmp-wic/hdd/boot/bzImage' | DEBUG: Installed kernel files: | '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/deploy/images/qemux86-64/bzImage' -> '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2677000/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/tmp-wic/hdd/boot/bzImage' | DEBUG: Installed systemd-boot files: | [] | ERROR: No EFI loaders installed to ESP partition. Check that grub-efi, systemd-boot or similar is installed. That the ESP partition did not install the EFI loader binary from grub-efi. I think this is a bug in the build setup for the overayfs test since that partition would not boot with EFI. I'll check how this can be fixed.. Cheers, -Mikko ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-05-30 8:30 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-05-28 12:56 [PATCH v5 1/4] wic bootimg-efi.py: fail build if no binaries installed Mikko Rapeli 2025-05-28 12:56 ` [PATCH v5 2/4] image_types_wic.bbclass: depend on grub-efi and systemd-boot on aarch64, systemd-boot on arm Mikko Rapeli 2025-05-28 12:56 ` [PATCH v5 3/4] image_types_wic.bbclass: remove os-release from WKS_FILE_DEPENDS_BOOTLOADERS on x86 and x86_64 Mikko Rapeli 2025-05-28 12:56 ` [PATCH v5 4/4] image_types_wic.bbclass: capture verbose wic output by default Mikko Rapeli 2025-05-29 13:55 ` [OE-core] [PATCH v5 1/4] wic bootimg-efi.py: fail build if no binaries installed Mathieu Dubois-Briand 2025-05-30 8:30 ` Mikko Rapeli
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox