0

I am running Alpine Linux on a device on which I was making use of a serial console configured on /dev/ttyS0 to login.

I recently enabled console redirection in my BIOS so that I could use the same serial connection to access BIOS functionality such as boot order.

The intention was for the BIOS to then hand control over the serial device to Linux when it boots.

However now Alpine does not see /dev/ttyS0 anymore, and kernel logs do not come across the wire.

Two surprising observations, though:

  • If I boot Ubuntu instead of Alpine, the serial device continues to work for console access.

  • When I shut down Alpine, I do get a single shutdown message with the timestamp format that the Linux kernel uses, so I think it is coming from the kernel:

      [ 1497.625657] reboot: Restarting system
    

How can I ensure that /dev/ttyS0 is available when Alpine boots?

1 Answer 1

1

I suppose you are using Alpine starting with a USB key, even if not stated. If this is the case, you can modify the file /boot/syslinux.cfg as follow:

serial 0 9600
timeout 20
prompt 1
default vanilla
label vanilla
        kernel /boot/vanilla
        append initrd=/boot/vanilla.gz alpine_dev=sda1:vfat modules=sd-mod,usb-storage console=ttyS0,9600

Depending on the Alpine's version you are using, some entries might differ. The relevant parts that you should add are: serial 0 9600 and append console=ttyS0,9600 to the append initrd= entry.

Complete instructions can be found here: https://wiki.alpinelinux.org/wiki/Enable_Serial_Console_on_Boot

.: Francesco Colista

1
  • Thanks, I'll see if that works. I'm actually net booting it, which means I can set boot arguments but it's harder to customize /boot/syslinux.cfg without modifying the initramfs.
    – rgov
    Oct 31, 2020 at 20:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .