Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. |
IEEE 802.11 Wireless AP using a Soekris SBCAfter having tossed several plug-and-play solutions to get IEEE 802.11 wireless connectivity at home, at chat with the folks of the Wireless Leiden initiative (hi Rudi!) drew my attention to the Soekris Engineering Single Board Computers (SBC). These SBC's are compact (easy to fit almost anywhere), low-power, low-cost and can be expanded using a MiniPCI type III board and up to two PC-Card adaptors. My pick: the net4521.
BACK
With the hardware picture now clear, I decided to also throw out the big, old, noisy, power-consuming PC that manages my ADSL line, in favour of the Soekris SBC (the latter comes with two built-in 10/100 Mbps Ethernet RJ-45 UTP ports). Fortunately, the entry point of the ADSL cable is also the best location to fit a small omni-directional antenna to cover most part of the house and the backyard. The advantage of this do-it-yourself project over a turn-key solution, is that you can get a finer grain of control ranging from wireless interface and/or radio settings to the ability to run IPsec or IPv6, which you usually don't find in the low-cost SOHO market products. And... it's way more fun! Installing FreeBSD on the Soekris "net4521" SBC
One of the best things of the Soekris "net4521" SBC is that it is
designed for FreeBSD :-) Well, that's fine,
but how do you get a FreeBSD installation on a box that had neither CD-ROM nor floppy drive
and whose storage is a Compact Flash card... The answer: via the network!
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) 1. Prepare PXEBOOT and the LOADER
The pxeboot program can fetch loader and kernel via TFTP or NFS. If you, like me, 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 SBC, 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 a kernel and a (small) root filesystem in memory: a MFS filesystem mounted as the root filesystem. I call the package that builds both, the PBI (PXE Boot Image). 2.1 PBI: the kernelA custom kernel build is required to get a small kernel, tailored to the Soekris hardware, although one could probably get away with booting the GENERIC kernel. Have a peek at the kernel config that I use and proceed to 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 6 KB or so). # cd /some/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 PXEROOT?= /tftpboot # TFTP root directory
The file # 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 524323 Aug 16 16:54 kernel.gz*
-rw-r--r-- 1 root wheel 2560000 Aug 16 16:54 mfsimage.bin
-rw-r--r-- 1 root wheel 157696 Apr 19 10:13 pxeboot
/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 85 Aug 16 16:54 loader.conf
-rw-r--r-- 1 root wheel 31 Aug 16 16:54 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
2.3 Boot the Soekris SBCTo 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 (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 Soekris boot messages from my system.
At this point, we're running FreeBSD and we can type commands (do a " # setup 3 CFFS: Compactflash FreeBSD Filesystem(todo) 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:07:02 (CET)