Merge "bootloader: make serial console configurable"

This commit is contained in:
Zuul 2019-10-22 03:19:18 +00:00 committed by Gerrit Code Review
commit 5bc5f8aff3
3 changed files with 9 additions and 2 deletions

View File

@ -16,3 +16,7 @@ Arguments
* ``DIB_BOOTLOADER_DEFAULT_CMDLINE`` sets parameters that are appended
to the ``GRUB_CMDLINE_LINUX_DEFAULT`` values in ``grub.cfg``
configuration. It defaults to ``nofb nomodeset vga=normal``.
* ``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``.

View File

@ -1 +1,2 @@
export DIB_BOOTLOADER_DEFAULT_CMDLINE=${DIB_BOOTLOADER_DEFAULT_CMDLINE:-"nofb nomodeset vga=normal"}
export DIB_BOOTLOADER_SERIAL_CONSOLE=${DIB_BOOTLOADER_SERIAL_CONSOLE:-""}

View File

@ -174,8 +174,10 @@ function install_grub2 {
echo 'GRUB_TERMINAL="serial console"' >>/etc/default/grub
echo 'GRUB_GFXPAYLOAD_LINUX=auto' >>/etc/default/grub
if [[ -n "${DIB_BOOTLOADER_SERIAL_CONSOLE}" ]]; then
SERIAL_CONSOLE="${DIB_BOOTLOADER_SERIAL_CONSOLE}"
elif [[ "powerpc ppc64 ppc64le" =~ "$ARCH" ]]; then
# Serial console on Power is hvc0
if [[ "powerpc ppc64 ppc64le" =~ "$ARCH" ]]; then
SERIAL_CONSOLE="hvc0"
elif [[ "arm64" =~ "$ARCH" ]]; then
SERIAL_CONSOLE="ttyAMA0,115200"