From 61087d33e9ef67f05ef4a3b0dfc90ab521604292 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 2 Dec 2016 14:08:06 +1100 Subject: [PATCH] Set grub timeout default Set the grub timeout to 5 seconds by default, and add notes on how to update this. This will stop infra having to carry an element that goes and rewrites the grub configuration. Change-Id: I556b3f48eff1b67ee8c4b9b64f749af95100fb99 --- elements/bootloader/README.rst | 15 +++++++++++---- elements/bootloader/finalise.d/50-bootloader | 1 + .../notes/grub-timeout-1cdd14a2b1467d89.yaml | 6 ++++++ 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/grub-timeout-1cdd14a2b1467d89.yaml diff --git a/elements/bootloader/README.rst b/elements/bootloader/README.rst index ecfefc428..86f759143 100644 --- a/elements/bootloader/README.rst +++ b/elements/bootloader/README.rst @@ -1,7 +1,14 @@ ========== bootloader ========== -Installs grub[2] on boot partition on the system. In case GRUB2 -is not available in the system, a fallback to Extlinux will happen. It's -also possible to enforce the use of Extlinux by exporting a DIB_EXTLINUX -variable to the environment. + +Installs ``grub[2]`` on boot partition on the system. In case GRUB2 is +not available in the system, a fallback to Extlinux will happen. It's +also possible to enforce the use of Extlinux by exporting a +``DIB_EXTLINUX`` variable to the environment. + +Arguments +========= + +* ``DIB_GRUB_TIMEOUT`` sets the ``grub`` menu timeout. It defaults to + 5 seconds. Set this to 0 (no timeout) for fast boot times. diff --git a/elements/bootloader/finalise.d/50-bootloader b/elements/bootloader/finalise.d/50-bootloader index 1b479d46f..fbf9e56c8 100755 --- a/elements/bootloader/finalise.d/50-bootloader +++ b/elements/bootloader/finalise.d/50-bootloader @@ -133,6 +133,7 @@ function install_grub2 { GRUB_CFG=/boot/grub/grub.cfg fi + echo "GRUB_TIMEOUT=${DIB_GRUB_TIMEOUT:-5}" >>/etc/default/grub echo 'GRUB_TERMINAL="serial console"' >>/etc/default/grub echo 'GRUB_GFXPAYLOAD_LINUX=text' >>/etc/default/grub echo 'GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200 no_timer_check"' >>/etc/default/grub diff --git a/releasenotes/notes/grub-timeout-1cdd14a2b1467d89.yaml b/releasenotes/notes/grub-timeout-1cdd14a2b1467d89.yaml new file mode 100644 index 000000000..cedbc2fd6 --- /dev/null +++ b/releasenotes/notes/grub-timeout-1cdd14a2b1467d89.yaml @@ -0,0 +1,6 @@ +--- +features: + - The ``bootloader`` element will explicitly set the timeout to + ``5`` seconds when using ``grub`` (previously this was undefined, + but platform defaults were usually 5 seconds). Set this to ``0`` + for faster boots.