diff mbox series

[v6,1/5] wic bootimg-efi.py: fail build if no binaries installed

Message ID 20250530112459.776330-1-mikko.rapeli@linaro.org
State New
Headers show
Series [v6,1/5] wic bootimg-efi.py: fail build if no binaries installed | expand

Commit Message

Mikko Rapeli May 30, 2025, 11:24 a.m. UTC
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(+)

v6: no chnages

v5: separated from modular kernel changes, changed from shell "ls" command to
    python glob
diff mbox series

Patch

diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 96c710bf77ad..e0ee2f712774 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")