Wednesday, 17 November 2010

Updating FreeBSD 7.3 to 8.1 on Soekris NET5501

Just a quick heads-up if you're updating a FreeBSD server with a serial console.

I've been running super-low-energy Soekris NET5501 boards as rackmount servers for a little while now, so I thought it was time to update one of them from FreeBSD 7.x to 8.1.  Apart from anything else, the USB serial port multiplexer on one of my 7.3 boxes has a tendency to make the box reboot when odd things happen on the serial ports, so I'm hoping for better luck with the new USB subsystem code in 8.x.

The Soekris machines are proper servers: no video card, no keyboard - just a serial port.  The serial port is your console device, so if your server isn't accessible on the network, it's vital that the serial console lets you log in and fix the problem.

So it was annoying to find that the serial console no longer worked after upgrading to FreeBSD 8.1.  However, it turns out that this is simply because FreeBSD's designers have, in their wisdom, decided to rename all the serial ports, thereby breaking my system.  This didn't seem to be in the release notes - very annoying!
  • /dev/ttyd0 is now /dev/ttyu0
  • /dev/cuad0 is now /dev/cuau0
So after using csup to update to RELENG_8_1, and issuing the usual update command "make buildworld && make buildkernel && make installkernel", you will need to edit /etc/ttys before you reboot.

In /etc/ttys, change:
    ttyd0 "/usr/libexec/getty std.115200" xterm on secure
to
    ttyu0 "/usr/libexec/getty std.115200" xterm on secure

That will make the serial console work when you boot into 8.1.

You might also need to edit /etc/remote if you connect out to other systems.

UPDATE: I tried to get it right first time today, updating another box from 7.1 to 8.1.  It even with both ttyd0 and ttyu0 in the /etc/ttys file, the serial console doesn't start after the initial boot prompt, the first time you boot into 8.1.  Presumably the system gets confused by the 8.1 kernel combined with the 7.1 userland. Anyhow, a workaround is to let the system boot multi-user, then do the "mergemaster -p ; make installworld; mergemaster -F" from there.   The serial console should work again once the 8.1 userland is installed.  NB the mergemaster -F option is recommended to avoid those tedious prompts about config files where only the VCSID has changed.

Losing access to the serial console (even if only temporarily) is potentially risky.  All things considered, perhaps it wasn't a good idea for FreeBSD's engineers to rename all the serial ports on what is primarily a server OS.

UPDATE 2: It isn't necessary to rebuild your ports immediately (7.x binaries run happily on an 8.x system).  However, once you do start updating ports or installing new ones, it seems to be best to use "portupgrade -rRfa" to forcibly rebuild all your ports, as some of them have OSTYPE baked into them at build time, which can cause problems later on (e.g. causing "portupgrade portupgrade" to break).

No comments:

Post a Comment

Spammers: please stop wasting my time. All comments are moderated before publication.