diff mbox series

[wic] wic/plugins: allow timeout of 0 for systemd-boot

Message ID 20260826133817.2852505-1-marcel@solidxs.se
State New
Headers show
Series [wic] wic/plugins: allow timeout of 0 for systemd-boot | expand

Commit Message

Marcel Hamer Aug. 26, 2026, 1:38 p.m. UTC
Setting a timeout value of 0 for systemd-boot evaluated to False and
caused for a default timeout value of 5 to be set instead of 0.

A timeout of 0 is a valid loader.conf value for systemd-boot.

Signed-off-by: Marcel Hamer <marcel@solidxs.se>
---
 src/wic/plugins/source/bootimg_efi.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/wic/plugins/source/bootimg_efi.py b/src/wic/plugins/source/bootimg_efi.py
index fe6c222..1f73f85 100644
--- a/src/wic/plugins/source/bootimg_efi.py
+++ b/src/wic/plugins/source/bootimg_efi.py
@@ -145,7 +145,8 @@  class BootimgEFIPlugin(SourcePlugin):
         loader_conf = ""
 
         # 5 seconds is a sensible default timeout
-        loader_conf += "timeout %d\n" % (bootloader.timeout or 5)
+        timeout_val = bootloader.timeout if bootloader.timeout is not None else 5
+        loader_conf += f"timeout {timeout_val}\n"
 
         logger.debug("Writing systemd-boot config "
                      "%s/hdd/boot/loader/loader.conf", cr_workdir)