Change grub variables for style and timeout

This change is done in order to make the troubleshooting of images
in non CI/CD deployments easier. We pick GRUBs upstream defaults to
select as neutral a set of values as possible. If you need additional
time for debugging or hidden menus you should override these values in
your downstream elements.

Change-Id: I08155152b63f629c4eaf72d29ff931e92d7e4b33
This commit is contained in:
Rafal Lewandowski
2024-12-13 14:41:28 +01:00
committed by Clark Boylan
parent 62ea9b95dd
commit 673e4d4783
3 changed files with 20 additions and 7 deletions

View File

@@ -8,12 +8,12 @@ Arguments
=========
* ``DIB_GRUB_TIMEOUT`` sets the ``grub`` menu timeout. It defaults to
1 seconds. Set this to 0 (no timeout) for fast boot times.
5 seconds. Set this to 0 (no timeout) for fast boot times.
* ``DIB_GRUB_TIMEOUT_STYLE`` sets the visibility of the ``grub`` menu.
It defaults to ``hidden`` (or ``countdown`` as an alias). Set this to
``menu`` to display the menu and then wait for the timeout set by
``DIB_GRUB_TIMEOUT`` to expire before booting the default entry.
It defaults to ``menu``. Set this to ``hidden`` (or ``countdown``
as an alias) to not display the menu until the timeout is reached at
which point the default boot entry will be selected.
* ``DIB_BOOTLOADER_DEFAULT_CMDLINE`` sets parameters that are appended
to the ``GRUB_CMDLINE_LINUX_DEFAULT`` values in ``grub.cfg``
@@ -23,7 +23,7 @@ Arguments
to be disabled in the resulting image by setting to a value of ``False``.
* ``DIB_BOOTLOADER_SERIAL_CONSOLE`` sets the serial device to be
used as a console. It defaults to ``hvc0`` for PowerPC,
used as a console. It defaults to ``hvc0`` for PowerPC,
``ttyAMA0,115200`` for ARM64, otherwise ``ttyS0,115200``.
* ``DIB_BOOTLOADER_VIRTUAL_TERMINAL`` sets the virtual terminal be

View File

@@ -116,8 +116,14 @@ fi
append_or_replace /etc/default/grub GRUB_DEVICE "LABEL=${DIB_ROOT_LABEL}"
append_or_replace /etc/default/grub GRUB_DISABLE_LINUX_UUID true
append_or_replace /etc/default/grub GRUB_TIMEOUT "${DIB_GRUB_TIMEOUT:-1}"
append_or_replace /etc/default/grub GRUB_TIMEOUT_STYLE "${DIB_GRUB_TIMEOUT_STYLE:-hidden}"
# Please do not change these defaults unless the change is to only set our
# overrides when overrides are present. The current defaults are based on
# upstream Grub defaults. These values are clearly contentious with different
# groups wanting different values. For this reason we pick the current GRUB
# defaults and stick to them. The only exception should be an update to
# fall through to GRUB using its own defaults.
append_or_replace /etc/default/grub GRUB_TIMEOUT "${DIB_GRUB_TIMEOUT:-5}"
append_or_replace /etc/default/grub GRUB_TIMEOUT_STYLE "${DIB_GRUB_TIMEOUT_STYLE:-menu}"
if [[ "True" == "${DIB_BOOTLOADER_USE_SERIAL_CONSOLE:-True}" ]]; then
append_or_replace /etc/default/grub GRUB_TERMINAL \""serial console"\"
else

View File

@@ -0,0 +1,7 @@
---
upgrade:
- |
Change default values for ``DIB_GRUB_TIMEOUT_STYLE`` and
``DIB_GRUB_TIMEOUT``. The default value for ``DIB_GRUB_TIMEOUT_STYLE``
will be ``menu`` and for ``DIB_GRUB_TIMEOUT`` will be ``5``. These
values are based on current GRUB defaults.