This repository was archived by the owner on Aug 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
This repository was archived by the owner on Aug 7, 2025. It is now read-only.
set-timeout 0 should set the timeout to 0, not remove it #263
Copy link
Copy link
Open
Description
clr-boot-manager/src/bootloaders/systemd-class.c
Lines 367 to 381 in 86c739c
| if (timeout > 0) { | |
| /* Set the timeout as configured by the user */ | |
| item_name = string_printf("timeout %d\ndefault %s-%s-%s-%d.conf\n", | |
| timeout, | |
| prefix, | |
| kernel->meta.ktype, | |
| kernel->meta.version, | |
| kernel->meta.release); | |
| } else { | |
| item_name = string_printf("default %s-%s-%s-%d.conf\n", | |
| prefix, | |
| kernel->meta.ktype, | |
| kernel->meta.version, | |
| kernel->meta.release); | |
| } |
clr-boot-manager/src/bootman/timeout.c
Lines 41 to 53 in 86c739c
| path = string_printf("%s%s/timeout", self->sysconfig->prefix, KERNEL_CONF_DIRECTORY); | |
| if (timeout <= 0) { | |
| /* Nothing to be done here. */ | |
| if (!nc_file_exists(path)) { | |
| return true; | |
| } | |
| if (unlink(path) < 0) { | |
| LOG_ERROR("Unable to remove %s: %s", path, strerror(errno)); | |
| return false; | |
| } | |
| return true; | |
| } |
# clr-boot-manager set-timeout 0
Timeout has been removedresults in the timeout value being completely removed from loader.conf, in which case systemd-boot will remain at the menu until the user makes a selection. Instead, we should write timeout 0 to loader.conf.
https://www.freedesktop.org/software/systemd/man/latest/loader.conf.html
Workaround is to mount /boot and manually change loader.conf
systemctl start boot.mount
cat /boot/loader/loader.conf # To check against the new file we generate
(echo 'timeout 0'; grep -v '^timeout' /boot/loader/loader.conf) > /boot/loader/loader.conf.new
cat /boot/loader/loader.conf.new # Make sure this looks right
mv /boot/loader/loader.conf.new /boot/loader/loader.conf
systemctl stop boot.mountMetadata
Metadata
Assignees
Labels
No labels