OpenBSD Soekris Read Only Root

From WTFwiki
Revision as of 15:48, 20 November 2008 by Jontow (talk | contribs) (beginnings of soekris/openbsd page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Running OpenBSD on a Soekris net4801

Introduction/Theory

A number of ways exist to do this, I've chosen the slightly more complicated but fairly rewarding method of
running with the root (only) filesystem mounted read-only. This means the compact-flash card will live a
little longer, not enduring the write cycles that are fabled to kill them, and if someone trips over the power
cord, you don't lose anything on the filesystems. You also never need to endure the delay of a length fsck(8).

All the bonuses out of the way: it's kind of a bastard to setup.. I'll try my best to detail it, including a
patch(1) file for '/etc/rc'. There are a number of "neat" tricks to play with symbolic links and MFS style
RAM-disks.

Installation

I usually go with the PXE boot method, its really the easiest on a soekris, since you need a small network with
internet connectivity (or a local FTP/HTTP mirror), a DHCP server and a TFTP server. OpenBSD already comes with
all of this capability, so a random crap PC on your network running it will do.

dhcpd.conf: You need to add 'next-server <IP of TFTP server>' and 'filename "pxeboot"' to your 'subnet' declaration.. thats it.

inetd.conf: Uncomment the IPv4 TFTP line and 'pkill -9 inetd && inetd'.

Once that's done, get 'pxeboot' and 'bsd.rd' from your desired version of OpenBSD (4.4, in my case) and put it in
'/tftpboot' on the TFTP server, make sure permissions are set world-readable.

Power on your soekris with a serial console connected. They use a standard DB9M connector, and supply 19200 baud, 8n1.
If you don't know what that means, figure it out via google or wikipedia.

At some point, the soekris' BIOS will ask you to hit Ctrl+P to interrupt the boot and enter the monitor, do so, and at
the prompt, type "boot F0". "F0" is the name of the first ethernet port on the device.

You should see the soekris come up with an address via DHCP, and put you at an OpenBSD PXE boot loader prompt, you should
type the following to ensure a successful boot.. order matters:

 > stty com0 19200
 > set tty com0
 > boot bsd.rd


You should see the kernel boot, just wait until it comes to the Install, Upgrade, etc menu; it will take a minute or a few.

Choose 'Install', and proceed as any normal OpenBSD install would; you'll make modifications when its booted multi-user.