Enable console during kernel boot on Power

On Power systems console should be added the kernel command line
in the following order: 'console=tty0 console=hvc0'.
The first one is the graphical console. The last one is the serial
console. The kernel enables all the consoles pointed through the
kernel command line. However, only the last one will receive
input/output during kernel boot. All the other consoles will be
enabled after the boot.

Change-Id: I0069f608e0ab104d3778954e033fb82ed5ea7693
This commit is contained in:
Rafael Folco 2017-07-07 17:53:41 +00:00
parent 43e32116bd
commit bfdf7dc0f6
2 changed files with 19 additions and 2 deletions

View File

@ -38,11 +38,18 @@ fi
# Dig up the initrd and kernel to use. # Dig up the initrd and kernel to use.
select_boot_kernel_initrd $TARGET_ROOT select_boot_kernel_initrd $TARGET_ROOT
# Serial console on Power is hvc0
if [ "powerpc ppc64 ppc64le" =~ "$ARCH" ] ; then
SERIAL_CONSOLE="hvc0"
else
SERIAL_CONSOLE="ttyS0,115200"
fi
sudo sh -c "cat > $CONF <<_EOF_ sudo sh -c "cat > $CONF <<_EOF_
DEFAULT linux DEFAULT linux
LABEL linux LABEL linux
KERNEL /boot/$KERNEL KERNEL /boot/$KERNEL
APPEND ro root=LABEL=${DIB_ROOT_LABEL} console=tty0 console=ttyS0,115200 nofb nomodeset vga=normal APPEND ro root=LABEL=${DIB_ROOT_LABEL} console=tty0 console=${SERIAL_CONSOLE} nofb nomodeset vga=normal
INITRD /boot/$RAMDISK INITRD /boot/$RAMDISK
_EOF_" _EOF_"

View File

@ -145,7 +145,17 @@ function install_grub2 {
echo "GRUB_TIMEOUT=${DIB_GRUB_TIMEOUT:-5}" >>/etc/default/grub echo "GRUB_TIMEOUT=${DIB_GRUB_TIMEOUT:-5}" >>/etc/default/grub
echo 'GRUB_TERMINAL="serial console"' >>/etc/default/grub echo 'GRUB_TERMINAL="serial console"' >>/etc/default/grub
echo 'GRUB_GFXPAYLOAD_LINUX=text' >>/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
# Serial console on Power is hvc0
if [ "powerpc ppc64 ppc64le" =~ "$ARCH" ] ; then
SERIAL_CONSOLE="hvc0"
else
SERIAL_CONSOLE="ttyS0,115200"
fi
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=${SERIAL_CONSOLE} no_timer_check"
echo "GRUB_CMDLINE_LINUX_DEFAULT=\"${GRUB_CMDLINE_LINUX_DEFAULT}\"" >>/etc/default/grub
echo 'GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"' >>/etc/default/grub echo 'GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"' >>/etc/default/grub
if type grub2-mkconfig >/dev/null; then if type grub2-mkconfig >/dev/null; then
GRUB_MKCONFIG="grub2-mkconfig -o $GRUB_CFG" GRUB_MKCONFIG="grub2-mkconfig -o $GRUB_CFG"