2011-08-31

Enabling serial console on Linux Slackware

I'm doing this frequently enough to warrant a post.
  1. Make sure you use a kernel with console enabled

  2. Confirm that your serial tty's are detected with dmesg | grep tty:
    [    0.000000] console [tty0] enabled
    [ 1.323949] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
    [ 1.568561] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
    [ 1.592267] 00:0c: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
    [ 1.614293] 00:10: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A

  3. Edit /etc/securetty and uncomment the lines matching the ttyS you got from dmesg. Else you won't be able to logon as root.

  4. Edit your /etc/inittab and uncomment the lines:
    s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100
    s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100
    While you're at it, you probably want to change the 9600 vt100 to 115200 linux, if you use putty in serial mode to connect for instance.

  5. If you want the boot messages on serial as well (recommended!), make sure you append a console= line to your kernel. For instance, if using LILO and for 115200 bauds, you would add a line:
    append = "console=ttyS0,115200"

No comments:

Post a Comment