FreeBSD/arm for Linksys NSLU2 (aka the slug)

This procedure has been tested on a FreeBSD HEAD system. Please note: This is not quite true yet... Some patches are needed that aren't listed here or are in the tree yet... This page is here for people helping me...

Build world

make TARGET=arm TARGET_CPUTYPE=xscale TARGET_BIG_ENDIAN=true buildworld 

Setup an NFS root

make DESTDIR=$ROOT installworld
make DESTDIR=$ROOT distrib-dirs
make DESTDIR=$ROOT distribution
echo "hostname=slug" > $ROOT/etc/rc.conf
echo "ifconfig_DEFAULT=DHCP" >> $ROOT/etc/rc.conf
echo "10.0.x.x:/roots/slug / nfs rw 0 0" > $ROOT/etc/fstab

Note: mergemaster will fail if used to install HEAD on a RELENG_6 system unless /usr/share/mk on the host system has been updated w/ changes to the build infrastructure.

Configure the NFS root for diskless use

Consult diskless(8).

Build and install a kernel

make TARGET=arm KERNCONF=AVILA buildkernel
make TARGET=arm KERNCONF=AVILA DESTDIR=$ROOT installkernel  

Note: the AVILA kernel is configured with the root filesystem mounted via NFS over the npe0 wired interface. You should now have an NFS-mountable root filesystem with a kernel. The final step is to setup network diskless booting from the board. It is assumed you have a DHCP server operating on your network and the server is configured to supply the necessary information in the DHCP lease. If you run the ISC DHCP server the following configuration information is an example of how to do this:

   option root-opts code 130 = string; # NFS / mount options
   host slug1 {
       hardware ethernet 00:d0:12:02:47:68;
       fixed-address 10.0.0.y;
       next-server 10.0.0.x;
       filename  "kernel-slug.nfs";
       option root-path "10.0.0.x:/data/freebsd/roots/gateworks";
       option root-opts "nolockd";

Note: the root-opts item specifies the root filesystem should be mounted with the nolocked option; this just short-circuits file locking requests so you don't get complaints from programs that use the pidfile(3) routine (e.g. devd).

Move Kernel to TFTP area

Place the kernel in the TFTP area for booting from the prom monitor. If your TFTP server returns file from /tftpboot (default) then do something like:

   cp $ROOT/boot/kernel/kernel /tftpboot/kernel-slug.nfs 

Boot the kernel from redboot

Boot the kernel from redboot:

   RedBoot> ip -h 10.0.0.x -l 10.0.0.y
   IP: 10.0.0.y/ Gateway:
   Default server: 10.0.0.x
   RedBoot> load -b 0x200000 kernel-slug.nfs
   Using default protocol (TFTP)
   Address offset = 0x40000000
   Entry point: 0x00200100, address range: 0x00200000-0x004db2d4
   RedBoot> go 

FreeBSDSlug (last edited 2008-06-17 21:38:27 by localhost)