|
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); |
|
} |
|
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 removed
results 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.mount
clr-boot-manager/src/bootloaders/systemd-class.c
Lines 367 to 381 in 86c739c
clr-boot-manager/src/bootman/timeout.c
Lines 41 to 53 in 86c739c
# clr-boot-manager set-timeout 0 Timeout has been removedresults in the
timeoutvalue 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 writetimeout 0to loader.conf.https://www.freedesktop.org/software/systemd/man/latest/loader.conf.html
Workaround is to mount /boot and manually change loader.conf