lemoncube.com Search: (normal)


Linux Serial Console

Blah My internet gateway was operating fine without a monitor connected, but for unknown reasons it would occasionally not boot up, so I'd have to hook up a monitor and keyboard and see what was going on. Usually, it had gotten stuck around the 'INIT' phase. I think it has something to do with setting 'linear' in LILO and using a > 500mb hard drive on this old P75 motherboard.
So I thought I should have a go at setting up serial console access (just like real UNIX boxes :-). Here's what I did:
  • Read the serial-console.txt that comes in the /usr/src/linux/Documentation directory. It says pretty much what you need to know. I already had a /dev/console and /dev/tty0, so I didn't have to do any mknod'ing
  • Recompile the kernel with serial console support. NB: This isn't under the 'consoles' section of config. I think its under Devices or thereabouts.
  • Now make some changes to /etc/lilo.conf so that 1) Your lilo prompt appears on the serial console and 2)That the kernel output goes to the console too. To set up a 38400 bps terminal, add these lines to the global (first bit) of the lilo.conf:
       #Use serial console on COM1
       serial = 0,38400n8
       append = "console=ttyS0,38400n8"
    Rerun lilo to install the changes.
  • Edit /etc/inittab and set up a serial getty. I'm using a butchered slackware 7.1, so I've got agetty. The line I have is:
       s1:12345:respawn:/sbin/agetty -i -h -L 38400 ttyS0 vt100
    You can test this line by doing a init q. If you make any further changes you'll need to do an init q and then kill the agetty process on ttyS0. The reason for the -i -h -L is that I'm still trying to figure out a problem with my serial console. The -i disables the printing of /etc/issue (usually the 'Welcome to Linux ...' banner). Currently if I don't disable it I never get a login prompt (or it eventually pops up). -h enables hardware flow control and -L forces the line to be local and doesn't do any odd carrier detect nonsense.

pablo , 2002-11-20 21:50:25