| Message ID | 20250422143501.99565-9-mikko.rapeli@linaro.org |
|---|---|
| State | New |
| Headers | show |
| Series | systemd based initrd and modular kernel support | expand |
On Tue, 2025-04-22 at 17:35 +0300, 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> > --- > 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: Lets avoid the exec overhead of using "ls" here and use glob.glob() to check for the files, which makes the code more readable/maintainable into the future. Thanks! Richard
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:
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(+)