English version

FreeBSD on a Soekris net4801

This page describes the installation and configuration of FreeBSD 5.2.1 on a Soekris net4801 fanless computer.

Hardware configuration

The Soekris net4801 computer used for this installation had an additional Hitachi Travelstar 40Go 2.5" hard-drive. Note that I do not recommend this hard-drive, as mine suffered from the so-called click of death and died after less than one week.

I now use a compact-flash card instead of a disk. The card I used are reported as:

I use the second one (Lexar 256MB) in production without any problem. Failures to activate read and write caches are reported at boot time, but this does not impact the operations.

Preparation of the installation

The installation was prepared on a host computer running FreeBSD. First, a mini-iso of FreeBSD 5.2.1 was downloaded and mounted as /cdrom on the host machine (willow). The cdrom was exported to the local network using the following line in /etc/exports:

/cdrom 10.1.0.4

where 10.1.0.4 is the address of the Soekris computer to be installed (anyanka). Also, the program /cdrom/boot/pxeboot was copied into /tftpboot on willow.

The DHCP server on willow has been set up to give anyanka a fixed IP address as well as some indications on how to retrieve its root file system. Here is the relevant excerpt from /usr/local/etc/dhcpd.conf:

host anyanka {
  hardware ethernet 00:00:24:c1:ce:4c;
  fixed-address 10.1.0.4;
  option root-path "/cdrom";
  filename "pxeboot";
}

As a final step, tftp was enabled in /etc/inetd.conf with a root of /tftpboot.

Installing the system

The Soekris net4801 is able to boot using the PXE network protocol on its first interface, called sis0 under FreeBSD. The monitor can be accessed on the serial port at 19200 bauds.

Before starting the FreeBSD installation, set your speed to 9600 bauds by issuing set conspeed=9600 then reboot. With a terminal emulator now set to 9600 bauds, reconnect to your net4801. To boot your ready-to-be-installed system, issue a boot f0 command at the prompt.

Fetching the installation system using NFS over PXE takes a long time (5 to 10 minutes). You will notice a lot of network activities, but no useful progress indication. Just be patient. The normal FreeBSD installer will appear and you will be able to setup your system and do a network installation as usual. Olivier Beyssac reported that the only mode in which the system could be installed correctly on the Hitachi Travelstar drive was the custom mode (which is the one I happened to use), and that other modes are failing to detect a usable disk geometry.

Before rebooting your newly installed system

Before rebooting your newly installed system, you have to perform a serie of steps to be able to log on when it goes standalone:

With those steps, you should be able to log on using ssh once the system goes standalone. You will also be able to access it using the serial console should you need it.

Recompiling a kernel

I recommend recompiling a stripped down kernel with only the necessary drivers. This brings the kernel under the 3MB instead of almost 6MB and frees some memory. Do not forget to add the options CPU_SOEKRIS line to get the maximum out of your Soekris box. Class is i386 and processor looks like a 586.

For a better firewall, which supports NAT, firewalling, IPv4 and IPv6 as well as traffic shaping all connected together, you should apply the http://www.nipsi.de/altq/index.html patch and install the security/pf port, which contains the powerful OpenBSD packet filter. If you plan to play with HFSC scheduling, the patch at http://monkey.org/openbsd/archive/misc/0402/msg00857.html allows you to specify a 0% linkshare factor if you want a queue that does not borrow bandwidth from its parent queue.

Also, to allow my root filesystem to be on any kind of compact flash card or disk regardless of whether it gets viewed as ad0 or ad1, I use Thomas Quinot's DEVFS_ROOTDEV patch. I have labelled my root filesystem by doing: tunefs -L root /dev/ad1s1a.

My kernel configuration file is available here.

Tweaking the system

I found it necessary to increase the number of NMBCLUSTERS to sustain the upload rate while using ALTQ and packet filter. This can be done without recompiling a kernel by adding kern.ipc.nmbclusters="32768" into /boot/loader.conf.