Merge "Allow custom console=tty0 argument"

This commit is contained in:
Zuul 2023-04-20 04:27:09 +00:00 committed by Gerrit Code Review
commit f8733f729b
4 changed files with 28 additions and 5 deletions

View File

@ -17,3 +17,8 @@ Arguments
* ``DIB_BOOTLOADER_SERIAL_CONSOLE`` sets the serial device to be
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
used as a console. It defaults to ``tty0``. When explicitly set
to an empty string then no virtual terminal console kernel argument
is added.

View File

@ -1,2 +1,9 @@
export DIB_BOOTLOADER_DEFAULT_CMDLINE=${DIB_BOOTLOADER_DEFAULT_CMDLINE:-"nofb nomodeset gfxpayload=text"}
export DIB_BOOTLOADER_SERIAL_CONSOLE=${DIB_BOOTLOADER_SERIAL_CONSOLE:-""}
if [ ! -v DIB_BOOTLOADER_VIRTUAL_TERMINAL ]; then
# DIB_BOOTLOADER_VIRTUAL_TERMINAL is unset
export DIB_BOOTLOADER_VIRTUAL_TERMINAL=tty0
else
# DIB_BOOTLOADER_VIRTUAL_TERMINAL is set to empty string or other value
export DIB_BOOTLOADER_VIRTUAL_TERMINAL=${DIB_BOOTLOADER_VIRTUAL_TERMINAL}
fi

View File

@ -135,17 +135,23 @@ fi
if [[ -n "${DIB_BOOTLOADER_SERIAL_CONSOLE}" ]]; then
SERIAL_CONSOLE="${DIB_BOOTLOADER_SERIAL_CONSOLE}"
SERIAL_CONSOLE="console=${DIB_BOOTLOADER_SERIAL_CONSOLE}"
elif [[ "powerpc ppc64 ppc64le" =~ "$ARCH" ]]; then
# Serial console on Power is hvc0
SERIAL_CONSOLE="hvc0"
SERIAL_CONSOLE="console=hvc0"
elif [[ "arm64" =~ "$ARCH" ]]; then
SERIAL_CONSOLE="ttyAMA0,115200"
SERIAL_CONSOLE="console=ttyAMA0,115200"
else
SERIAL_CONSOLE="ttyS0,115200"
SERIAL_CONSOLE="console=ttyS0,115200"
fi
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=${SERIAL_CONSOLE} no_timer_check"
if [[ -n "${DIB_BOOTLOADER_VIRTUAL_TERMINAL}" ]]; then
VIRTUAL_TERMINAL="console=${DIB_BOOTLOADER_VIRTUAL_TERMINAL}"
else
VIRTUAL_TERMINAL=""
fi
GRUB_CMDLINE_LINUX_DEFAULT="${VIRTUAL_TERMINAL} ${SERIAL_CONSOLE} no_timer_check"
echo "GRUB_CMDLINE_LINUX_DEFAULT=\"${GRUB_CMDLINE_LINUX_DEFAULT} ${DIB_BOOTLOADER_DEFAULT_CMDLINE} ${BOOT_FS} ${BOOT_FIPS}\"" >>/etc/default/grub
echo 'GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"' >>/etc/default/grub

View File

@ -0,0 +1,5 @@
---
features:
- |
The bootloader element now has variable DIB_BOOTLOADER_VIRTUAL_TERMINAL to
customize or suppress the console=tty0 kernel argument.