AlpineLinux 3.6: extlinux and Linux with serial console

This article will describe changing extlinux and Linux to serial console.

1 Enable serial console

Enable serial console and disable hidden menu in extlinux. Append console=ttyS0,115200とconsole=tty1,38400 to kernel parameter.

# . /etc/update-extlinux.conf
# O="${default_kernel_opts} console=ttyS0,115200 console=tty1,38400"
# sed -e 's/^serial_port=/serial_port=0/g' \
      -e "s/^hidden=1/hidden=0/g" \
      -e "s;^default_kernel_opts=.*;default_kernel_opts=\"${O}\";g" \
      -i /etc/update-extlinux.conf
# update-extlinux

Enable getty entry of ttyS0 in /etc/inittab.

# sed -e 's;^#ttyS0;ttyS0;g' -i /etc/inittab

Enable login from serial console.

# echo ttyS0 >> /etc/securetty

Reboot system.

# reboot

2 Execution result

Display is as below.

0001_Display.png

Serial console is as below.

0002_SerialConsole.png