[PATCH v3 10/11] wic bootimg-efi.py: fail build if no binaries installed

Mikko Rapeli
2025-04-04T16:30:04Z

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 | 3 +++
1 file changed, 3 insertions(+)

diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 96c710bf77..20b1c36a46 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -341,6 +341,9 @@ class BootimgEFIPlugin(SourcePlugin):
cp_cmd = "cp -v -p %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[8:])
out = exec_cmd(cp_cmd, True)
logger.debug("systemd-boot files:\n%s" % out)
+ # must have installed at least one EFI bootloader
+ out = exec_cmd("ls %s/EFI/BOOT/boot*.efi" % (hdddir), True)
+ logger.debug("Installed systemd-boot files:\n%s" % out)
elif source_params['loader'] == 'uefi-kernel':
kernel = get_bitbake_var("KERNEL_IMAGETYPE")
if not kernel:
--
2.43.0