Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. |
Running FreeBSD 4.8 on the Soekris "net4801"
After having only positive experience with the Soekris "net4521" that I used
to create a IEEE 802.11 wireless access point,
I couldn't wait to get my hands on the brand new model "net4801". The main reason
was that I wanted to get rid of the fat, noisy and power hungry (126W)
AMD Athlon based PC that I had switched on 24x7, just to receive email, keep
a CVS server up-to-date and serve out some (static) web content.
Making friends with FreeBSD and the Soekris "net4801"The National Semiconductor Geode® SC1100 chipset used in the "net4801" has a few quirks that require some hacking in the FreeBSD kernel. On the Soekris web site, the issues are explained and fixes suggested. I've taken a slightly different path: I MFC-ed a few fixed and made some configurable through the kernel config file. Speaking about MFC-ing: FreeBSD 5.x-current runs well on the "net4801", but if you want 5.1-RELEASE, you have some work to do too.
My interest, for now, is FreeBSD 4.8, so the rest of this document explains how to get
FreeBSD 4.8 running on the Soekris "net4801" (and it's likely to apply to 4-STABLE as
well).
Before you proceed, make sure you have a fairly recent FreeBSD system with full sources
installed. This document is written for pseudo-device vn # Vnode driver (turns a file into a device) Since the net4801 has neither CD-ROM nor floppy drive, it's likely that you have to do the initial install over the network, unless you have a notebook that you can swap disks with and use that one for staging the installation. The "net4801" (and other models) contain a smart boot ROM that contains Intel's Preboot eXecution Environment (PXE). FreeBSD supports this with pxeboot, a modified version of the system third-stage bootstrap. After DHCP configuration, pxeboot retrieves the kernel, modules, and other files either via NFS or TFTP. 1. Prepare PXEBOOT, LOADER and DHCP/TFTP
The pxeboot program can fetch loader and kernel via TFTP or NFS. If you want to avoid
having to set up NFS on your server, you can re-compile pxeboot to use TFTP only. Additionally,
pxeboot and the loader by default try to emulate a
# vi /etc/make.conf
LOADER_TFTP_SUPPORT= YES
# cd /usr/src/sys/boot/i386/libi386
# vi Makefile
#dont#CFLAGS+= -DTERM_EMU
# cd /usr/src/sys/boot
# make clean depend all install
1.1 Prepare the DHCP and TFTP serverIf you don't have a running DHCP server already, build isc-dhcp3 from the ports collection: # cd /usr/ports/net/isc-dhcp3 # make all install clean
PXE needs two additional directives from the DHCP server: the next-server it will query
and the root-path of the tree where to find the files it is supposed to retrieve. Here's
a sample entry from the DHCP configuration file
# vi /usr/local/etc/dhcpd.conf
host soekris {
hardware ethernet 0:0:24:aa:bb:cc;
fixed-address soekris.example.net;
filename "pxeboot";
next-server 192.168.1.2;
option root-path "/tftpboot";
}
To enable the TFTP server, uncomment the tftp dgram udp wait root /usr/libexec/tftpd tftpd -s /tftpboot
Don't forget to restart # kill -HUP `cat /var/run/inetd.pid` 2. PBI: PXE Boot ImageIn order to be able to do anything useful on the Soekris, aside from staring at the little box, admiring its color, we must find a way to tell it to boot FreeBSD and give us a shell prompt. Basically, there are just a few things we really want to do in the early stages, like:
Our goal is to build both kernel and a (small) root filesystem. The latter will
load in memory (MFS filesystem) and mounted on 2.1 PBI: the kernelThe most visible problem with the SC1100 chipset is that the kernel will hang in the PCI probe. This implies also that you cannot boot a pre-built GENERIC kernel as distributed on the CD-ROM. From here, there's basically two ways you can go: for the fast route, skip to the end of section 2.2 and download the kernel and MFS root image that I created, or, for the more adventurous trip, patch the kernel source tree and build a kernel yourself. 2.1.1 patching the kernel source treeThere are several slightly different patches around for the SC1100 quirks. I use this set of diffs against RELENG_4_8. To apply these patches, CVSup/usr/src to the latest RELENG_4_8
and run:
# cd /usr/src # patch < 4.8-SOEKRIS_NET4801.diff 2.1.2 kernel configuration fileSome of the modifications to 4.8 enabled with this patch, may be configured through the kernel configuration file: SOEKRIS_NET48xx.options CLK_TSC_IS_BROKEN #Local hack (16/Aug/2003 EHK) options ATA_NSC_GEODE_SC1100 #Local hack (16/Aug/2003 EHK) 2.1.3 building the kernelExperienced FreeBSD developers may choose to build a kernel the way they're used to, or they may prefer to read on and have all of the work done by a simplemake command in the next section.
2.2 PBI: the MFS root filesystem
Creating a MFS root filesystem is a bit more work, but the good news is that it's just a matter
of simply running Download the tarball pbi-4.8.tar.gz and unpack it in a directory of your choice. If you prefer, you can browse the PBI tree before downloading the gzipped tarball (which is actually only 10 KB or so). # cd /where/i/want/it # tar zxpvf pbi-4.8.tar.gz
Take a few minutes to walk yourself through the files in the "pbi" directory. You'll see that
the
If the home directory of your TFTP server is
not PXEROOT?= /tftpboot # TFTP root directory
The file atacontrol, boot0cfg, cat, chmod, clri, cp, crunch, dd, df, disklabel, dmesg, echo, expr, fdisk, fetch, fsck, gzip, halt, ifconfig, ipf, ipfstat, ipnat, kill, ln, ls, mkdir, mknod, mount, mount_mfs, mount_std, mtree, newfs, oinit, pax, ping, ps, pwd, reboot, rm, route, sh, sysctl, tar, test, traceroute, tunefs, umount, vi, /stand/sysinstall If you're confident enough to start the build, simply run make (as 'root' !) in the "pbi" directory: # cd pbi && make
This will do the complete build (kernel + root mfs) and install the results (with the 'pxeboot'
modified in chapter 1) in the directory
/tftpboot:
drwxr-xr-x 3 root wheel 512 Jan 6 21:52 boot
-rwxr-xr-x 1 root wheel 995264 Oct 12 16:09 kernel.gz [kernel.gz.asc]
-rw-r--r-- 1 root wheel 6144000 Oct 12 16:09 mfsimage.bin [mfsimage.bin.asc]
/tftpboot/boot:
drwxr-xr-x 2 root wheel 512 Jan 6 21:52 defaults
-r-xr-xr-x 1 root wheel 155648 Aug 16 16:53 loader*
-r--r--r-- 1 root wheel 9237 Apr 3 10:55 loader.4th
-rw-r--r-- 1 root wheel 154 Sep 21 23:23 loader.conf
-rw-r--r-- 1 root wheel 31 Sep 7 16:42 loader.rc
-r--r--r-- 1 root wheel 25121 Apr 3 10:55 support.4th
/tftpboot/boot/defaults:
-r--r--r-- 1 root wheel 11067 Oct 11 21:42 loader.conf
Even if you prefer another procedure to install, you most likely want to download the kernel from the listing above, to get past the kernel hang on PCI probe challenge.
Alternatively, you may choose to download the mfsroot.bin.gz
image which is in fact the content of the FreeBSD-4.8-RELEASE second boot floppy. If you
do, copy this one to 2.3 Boot the SoekrisTo connect the serial line of another PC to the serial port of the Soekris, you need a DB-9 female-female null-modem cable. Here's the pinout of the one I made: 1 /--o o--\ 1 although you might get 1 o o 1 2 | o -------- o | 3 away with just this : 2 o -------- o 3 3 | o -------- o | 2 3 o -------- o 2 4 +--o o--+ 4 4 o o 4 5 | o -------- o | 5 5 o -------- o 5 6 \--o o--/ 6 6 o o 6 7 o -------- o 8 7 o o 8 8 o -------- o 7 8 o o 7 9 o o 9 9 o o 9 Assuming that you have the serial ports connected, you can power-on the Soekris and watch it start up. Stay awake to Press Ctrl-P for entering Monitor in time and boot from the network (the port labelled "Eth0"): > boot f0 If DHCP is working on your server and the TFTP server enabled, it should now retrieve the kernel and MFS and start executing it. Here's a transcript of the boot messages from my system.
At this point, we've succesfully booted FreeBSD. You may now proceed with
a normal FreeBSD install, e.g. by starting # set TERM=vt100 # /stand/sysinstall 2.3.1 Before RebootingWarning: at the end of a normal sysinstall, a GENERIC kernel will be installed in the root directory. Recall that this one won't boot on the Soekris. So, once the installation is finished, but before rebooting the system, fetch and install the same kernel you used to get the PBI bootstrap to boot! 3. Normal OperationThere's a few things you might want to fine tune during normal operation:
4. References
|
| Contact: webmaster -at- xinu.nl | UNIX is a registered trademark in the USA and other countries, licensed exclusively through X/Open Company Limited. |
This page was last updated on Sunday, January 01 2006 23:11:21 (CET)