Differences between revisions 5 and 6
Revision 5 as of 2005-12-03 17:47:40
Size: 20168
Comment: adding bootstrap instructions
Revision 6 as of 2005-12-04 04:31:10
Size: 24067
Comment: completing flash instructions
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== Firmware Image ==
The image for the Metrix boxen is at http://cornerstone.personaltelco.net/~brj/metrix-missnet.img
It is setup with all 3 interfaces bridged, and br0 set to 10.11.104.5/22.

To flash:
 * Setup a sarge installer pxeboot environment.
  * Instructions at http://www.debian.org/releases/stable/i386/ch04s06.html.en
  * The pxelinux included with debian tries to use both the VGA emulation and the serial console. This causes problems. Use pxelinux.0 from http://centerclick.org/net4801/pxelinux/ instead.
  * Use the serial console pxeboot config.
  * Change all the 9600 to 19200 in the config.
  * You probably want to add DEBIAN_FRONTEND=text to the boot options of the kernel you'll use. Use expert26.
 * Netboot the metrix into the installer
  * Attach a serial terminal.
  * 19200 baud, 1 bit parity, no flow control
  * Press ctrl+p at the prompt to get to the BIOS
  * {{{boot f0}}}
  * Use expert26. You don't need any extra options.
 * Go through the installer up through step 9 (Download installer components). This is where device drivers are loaded.
 * After the drivers are loaded, go to a shell.
 * {{{wget -O - http://somewhere/foo/metrix-missnet.img | dd of=/dev/discs/disc0/disc bs=1M}}} (don't get it straight from cornerstone, copy it to your machine first)
 * Reboot

Note: as of 2005-10-11 this process isn't working for me. The Metrix stalls during the PXELINUX stuff. I think it's probably just an issue with my setup but I've got it working fine using the documentation from Metrix. (- KeeganQuinn)

The way the Metrix website says to do it is actually better. When I was working on the metrixes, though, that documentation didn't exist, to my memory. The debian netboot was simply the easiest way I could find to get a shell netbooted. (- BenjaminJencks)

Can KeeganQuinn or BenjaminJencks please point at or reiterate the referred-to Metrix documentation here? --RussellSenior
Line 31: Line 3:
The following is a description of how RussellSenior has been working on the software running on the metrixes. When I encountered them, all of the metrixes already had the BenjaminJencks firmware, referenced above. The following is a description of how RussellSenior has been working on the software running on the metrixes. When I encountered them, all of the metrixes already had the BenjaminJencks firmware, http://cornerstone.personaltelco.net/~brj/metrix-missnet.img.
It is setup with all 3 interfaces bridged, and br0 set to 10.11.104.5/22.
referenced above.
Line 66: Line 39:
  $ mkdir /src/mississippi
  $ cd /src/mississippi
  $ wget http://cornerstone.personaltelco.net/~brj/metrix-missnet.img
  }}}
$ mkdir /src/mississippi
$ cd /src/mississippi
$ wget http://cornerstone.personaltelco.net/~brj/metrix-missnet.img
}}}
Line 74: Line 47:
  $ losetup /dev/loop0 metrix-missnet.img
  }}}
$ losetup /dev/loop0 metrix-missnet.img
}}}
Line 80: Line 53:
  $ fdisk -u /dev/loop0

  
Command (m for help): p

  Disk /dev/loop0: 64 MB, 64028672 bytes
  4 heads, 32 sectors/track, 977 cylinders, total 125056 sectors
  Units = sectors of 1 * 512 = 512 bytes

        Device Boot Start End Blocks Id System
  /dev/loop0p1 32 125055 62512 83 Linux

  Command (m for help): q
  }}}
$ fdisk -u /dev/loop0
  Command (m for help): p

Disk /dev/loop0: 64 MB, 64028672 bytes
4 heads, 32 sectors/track, 977 cylinders, total 125056 sectors
Units = sectors of 1 * 512 = 512 bytes

      Device Boot Start End Blocks Id System
/dev/loop0p1 32 125055 62512 83 Linux

Command (m for help): q
}}}
Line 97: Line 70:
  $ losetup -d /dev/loop0
  }}}
$ losetup -d /dev/loop0
}}}
Line 103: Line 76:
  $ losetup -o 16384 /dev/loop0 metrix-missnet.img
  $ mkdir metrix-missnet
  $ su
  # mount /dev/loop0 metrix-missnet
  }}}
$ losetup -o 16384 /dev/loop0 metrix-missnet.img
$ mkdir metrix-missnet
$ su
# mount /dev/loop0 metrix-missnet
}}}
Line 112: Line 85:
  $ dd if=metrix-missnet.img of=metrix-missnet-part1.img skip=32
  125024+0 records in
  125024+0 records out
  64012288 bytes (64 MB) copied, 7.40427 seconds, 8.6 MB/s
  $ mkdir metrix-missnet
  $ su
  # mount -o loop metrix-missnet-part1.img metrix-missnet
  }}}
$ dd if=metrix-missnet.img of=metrix-missnet-part1.img skip=32
125024+0 records in
125024+0 records out
64012288 bytes (64 MB) copied, 7.40427 seconds, 8.6 MB/s
$ mkdir metrix-missnet
$ su
# mount -o loop metrix-missnet-part1.img metrix-missnet
}}}
Line 126: Line 99:
  # rsync -v -a -H metrix-missnet/ metrix-missnet-build-env/
  # chroot metrix-missnet-build-env
  }}}
# rsync -v -a -H metrix-missnet/ metrix-missnet-build-env/
# chroot metrix-missnet-build-env
}}}
Line 135: Line 108:
  # rsync -v -a -H /ro/ /rw/
  # vi /etc/resolv.conf (as appropriate)
  }}}
# rsync -v -a -H /ro/ /rw/
# vi /etc/resolv.conf (as appropriate)
}}}
Line 142: Line 115:
  # ping www.google.com
  PING www.l.google.com (66.102.7.147): 56 data bytes
  64 bytes from 66.102.7.147: icmp_seq=0 ttl=238 time=56.0 ms
  64 bytes from 66.102.7.147: icmp_seq=1 ttl=238 time=56.4 ms
  64 bytes from 66.102.7.147: icmp_seq=2 ttl=238 time=60.8 ms
  64 bytes from 66.102.7.147: icmp_seq=3 ttl=238 time=59.7 ms

  --- www.l.google.com ping statistics ---
  4 packets transmitted, 4 packets received, 0% packet loss
  round-trip min/avg/max = 56.0/58.2/60.8 ms
  }}}
# ping www.google.com
PING www.l.google.com (66.102.7.147): 56 data bytes
64 bytes from 66.102.7.147: icmp_seq=0 ttl=238 time=56.0 ms
64 bytes from 66.102.7.147: icmp_seq=1 ttl=238 time=56.4 ms
64 bytes from 66.102.7.147: icmp_seq=2 ttl=238 time=60.8 ms
64 bytes from 66.102.7.147: icmp_seq=3 ttl=238 time=59.7 ms

--- www.l.google.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 56.0/58.2/60.8 ms
}}}
Line 159: Line 132:
  deb http://www.backports.org/debian/ stable kernel-2.6 subversion
  }}}
deb http://www.backports.org/debian/ stable kernel-2.6 subversion
}}}
Line 165: Line 138:
  # apt-get update
  Hit http://debian.oregonstate.edu woody/main Packages
  Hit http://debian.oregonstate.edu woody/main Release
  Get:1 http://security.debian.org woody/updates/main Packages [245kB]
  Hit http://www.backports.org stable/kernel-2.6 Packages
  Hit http://www.backports.org stable/kernel-2.6 Release
  Get:2 http://www.backports.org stable/subversion Packages [8729B]
  Get:3 http://security.debian.org woody/updates/main Release [113B]
  Get:4 http://www.backports.org stable/subversion Release [141B]
  Fetched 254kB in 1s (186kB/s)
  Reading Package Lists...
  Building Dependency Tree...
  # apt-get upgrade
  Reading Package Lists...
  Building Dependency Tree...
  7 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  Need to get 1259kB of archives. After unpacking 61.4kB will be used.
  Do you want to continue? [Y/n] y
# apt-get update
Hit http://debian.oregonstate.edu woody/main Packages
Hit http://debian.oregonstate.edu woody/main Release
Get:1 http://security.debian.org woody/updates/main Packages [245kB]
Hit http://www.backports.org stable/kernel-2.6 Packages
Hit http://www.backports.org stable/kernel-2.6 Release
Get:2 http://www.backports.org stable/subversion Packages [8729B]
Get:3 http://security.debian.org woody/updates/main Release [113B]
Get:4 http://www.backports.org stable/subversion Release [141B]
Fetched 254kB in 1s (186kB/s)
Reading Package Lists...
Building Dependency Tree...
# apt-get upgrade
Reading Package Lists...
Building Dependency Tree...
7 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 1259kB of archives. After unpacking 61.4kB will be used.
Do you want to continue? [Y/n] y
Line 188: Line 161:
  # apt-get install make gcc libncurses5-dev subversion sharutils
  Reading Package Lists...
  Building Dependency Tree...
  The following extra packages will be installed:
   binutils cpp cpp-2.95 db4.2-util gcc-2.95 libapr0 libc6-dev libdb4.2
    libexpat1 libldap2 libneon24 libpcre3 libsasl7 libsvn0 libswig1.3.22 libxml2
    patch python python2.1
  The following NEW packages will be installed:
    binutils cpp cpp-2.95 db4.2-util gcc gcc-2.95 libapr0 libc6-dev libdb4.2
    libexpat1 libldap2 libncurses5-dev libneon24 libpcre3 libsasl7 libsvn0
   libswig1.3.22 libxml2 make patch python python2.1 sharutils subversion
  0 packages upgraded, 24 newly installed, 0 to remove and 0 not upgraded.
  Need to get 11.7MB of archives. After unpacking 40.4MB will be used.
  Do you want to continue? [Y/n] y
  }}}
# apt-get install make gcc libncurses5-dev subversion sharutils
Reading Package Lists...
Building Dependency Tree...
The following extra packages will be installed:
  binutils cpp cpp-2.95 db4.2-util gcc-2.95 libapr0 libc6-dev libdb4.2
  libexpat1 libldap2 libneon24 libpcre3 libsasl7 libsvn0 libswig1.3.22 libxml2
  patch python python2.1
The following NEW packages will be installed:
  binutils cpp cpp-2.95 db4.2-util gcc gcc-2.95 libapr0 libc6-dev libdb4.2
  libexpat1 libldap2 libncurses5-dev libneon24 libpcre3 libsasl7 libsvn0
  libswig1.3.22 libxml2 make patch python python2.1 sharutils subversion
0 packages upgraded, 24 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.7MB of archives. After unpacking 40.4MB will be used.
Do you want to continue? [Y/n] y
}}}
Line 212: Line 185:
  # cd /usr/src
  # wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.14.2.tar.bz2
  # tar xjvf linux-2.6.14.2.tar.bz2
  }}}
# cd /usr/src
# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.14.2.tar.bz2
# tar xjvf linux-2.6.14.2.tar.bz2
}}}
Line 220: Line 193:
  # cd linux-2.6.14.2
  # cp /boot/config-2.6.12.3-metrix .config
  # make oldconfig
  }}}
# cd linux-2.6.14.2
# cp /boot/config-2.6.12.3-metrix .config
# make oldconfig
}}}
Line 234: Line 207:
  CPU: AMD 486 DX/4-WB stepping 04
  Kernel panic - not syncing: Kernel compiled for Pentium+, requires TSC feature!
  }}}
CPU: AMD 486 DX/4-WB stepping 04
Kernel panic - not syncing: Kernel compiled for Pentium+, requires TSC feature!
}}}
Line 241: Line 214:
  # make
  # make install
  # make modules_install
  }}}
# make
# make install
# make modules_install
}}}
Line 249: Line 222:
  title Debian GNU/Linux, kernel 2.6.14.2-metrix
  root (hd0,0)
  kernel /boot/vmlinuz-2.6.14.2-metrix root=/dev/hda1 ro console=ttyS0,19200n8 panic=5
  savedefault
  }}}
title Debian GNU/Linux, kernel 2.6.14.2-metrix
root (hd0,0)
kernel /boot/vmlinuz-2.6.14.2-metrix root=/dev/hda1 ro console=ttyS0,19200n8 panic=5
savedefault
}}}
Line 262: Line 235:
  # cd /usr/src
  # svn checkout http://svn.madwifi.org/trunk madwifi-ng
  # cd /usr/src/madwifi-ng
  }}}
# cd /usr/src
# svn checkout http://svn.madwifi.org/trunk madwifi-ng
# cd /usr/src/madwifi-ng
}}}
Line 270: Line 243:
   (export MODULEPATH=${MODULEPATH}; depmod -ae ${KERNELVERSION})
  }}}

  [oops need to install package "sharutils" for uudecode too ... ought to move all of the apt-get installs to the beginning]
        (export MODULEPATH=${MODULEPATH}; depmod -ae ${KERNELVERSION})
}}}
Line 278: Line 249:
  # KERNELVERSION=2.6.14.2-metrix KERNELPATH=/usr/src/linux-2.6.14.2 make
  # KERNELVERSION=2.6.14.2-metrix KERNELPATH=/usr/src/linux-2.6.14.2 make install
  }}}
# KERNELVERSION=2.6.14.2-metrix KERNELPATH=/usr/src/linux-2.6.14.2 make
# KERNELVERSION=2.6.14.2-metrix KERNELPATH=/usr/src/linux-2.6.14.2 make install
}}}
Line 287: Line 258:
  auto lo
  
iface lo inet loopback
  iface lo inet6 loopback

  auto br0
  iface br0 inet static
  
address 10.11.104.4
          netmask 255.255.252.0
          broadcast 10.11.107.255
          gateway 10.11.104.1
          bridge_ports eth0
          bridge_stp on
          bridge_maxwait 0

  auto ath0
  iface ath0 inet static
          address 1.0.0.0
  
netmask 255.255.255.255
          broadcast 255.255.255.255
  
pre-up modprobe ath-pci
   pre-up wlanconfig ath0 create wlandev wifi0 wlanmode sta || true
          pre-up iwpriv ath0 wds 1 || true
          pre-up iwpriv ath0 mode 1
          up brctl addif br0 ath0
          down brctl delif br0 ath0
  
post-down wlanconfig ath0 destroy
          wireless_mode managed
          wireless_essid backhaul

  auto ath1
  iface ath1 inet static
          address 1.0.0.0
  
netmask 255.255.255.255
          broadcast 255.255.255.255
  
pre-up modprobe ath-pci
   pre-up wlanconfig ath1 create wlandev wifi1 wlanmode ap || true
          pre-up iwpriv ath1 mode 3
          up brctl addif br0 ath1
          down brctl delif br0 ath1
  
post-down wlanconfig ath1 destroy
          wireless_mode master
          wireless_essid www.personaltelco.net
          wireless_channel 1
  }}}
auto lo
iface lo inet loopback
iface lo inet6 loopback
  auto br0
iface br0 inet static
address 10.11.104.4
        netmask 255.255.252.0
        broadcast 10.11.107.255
        gateway 10.11.104.1
        bridge_ports eth0
        bridge_stp on
        bridge_maxwait 0

auto ath0
iface ath0 inet static
        address 1.0.0.0
netmask 255.255.255.255
        broadcast 255.255.255.255
pre-up modprobe ath-pci
        pre-up wlanconfig ath0 create wlandev wifi0 wlanmode sta || true
        pre-up iwpriv ath0 wds 1 || true
        pre-up iwpriv ath0 mode 1
        up brctl addif br0 ath0
        down brctl delif br0 ath0
post-down wlanconfig ath0 destroy
        wireless_mode managed
        wireless_essid backhaul

auto ath1
iface ath1 inet static
        address 1.0.0.0
netmask 255.255.255.255
        broadcast 255.255.255.255
pre-up modprobe ath-pci
        pre-up wlanconfig ath1 create wlandev wifi1 wlanmode ap || true
        pre-up iwpriv ath1 mode 3
        up brctl addif br0 ath1
        down brctl delif br0 ath1
post-down wlanconfig ath1 destroy
        wireless_mode master
        wireless_essid www.personaltelco.net
        wireless_channel 1
}}}
Line 335: Line 306:
  auto ath0
  iface ath0 inet static
  
address 1.0.0.0
          netmask 255.255.255.255
          broadcast 255.255.255.255
  
pre-up modprobe ath-pci
   pre-up wlanconfig ath0 create wlandev wifi0 wlanmode ap || true
          pre-up iwpriv ath0 wds 1 || true
          pre-up iwpriv ath0 mode 1
          up brctl addif br0 ath0
          down brctl delif br0 ath0
  
post-down wlanconfig ath0 destroy
          wireless_mode master
          wireless_essid backhaul
   wireless_channel 165
  }}}
auto ath0
iface ath0 inet static
address 1.0.0.0
        netmask 255.255.255.255
        broadcast 255.255.255.255
pre-up modprobe ath-pci
        pre-up wlanconfig ath0 create wlandev wifi0 wlanmode ap || true
        pre-up iwpriv ath0 wds 1 || true
        pre-up iwpriv ath0 mode 1
        up brctl addif br0 ath0
        down brctl delif br0 ath0
post-down wlanconfig ath0 destroy
        wireless_mode master
        wireless_essid backhaul
        wireless_channel 165
}}}

  We are now finished with the chroot and can exit from it:

  {{{
# exit
}}}
Line 354: Line 331:
  We are now finished with the chroot and can exit from it:

  {{{
  # exit
  }}}
Line 363: Line 334:
  $ slogin buick.personaltelco.net
  $ slogin root@metrix-foo
  # remountrw
  # rsync -v -a -H username@hostname:/src/mississippi/metrix-missnet-build-env/boot/ /boot/
  # rsync -v -a -H username@hostname:/src/mississippi/metrix-missnet-build-env/lib/modules/ /lib/modules/
  # rsync -v -a -H username@hostname:/src/mississippi/metrix-missnet-build-env/usr/local/ /usr/local/
  # scp username@hostname:/src/mississippi/metrix-missnet-build-env/etc/network/interfaces /etc/network/interfaces
  # remountro
  
}}}
$ slogin buick.personaltelco.net
$ slogin root@metrix-foo
# remountrw
# rsync -v -a -H username@hostname:/src/mississippi/metrix-missnet-build-env/boot/ /boot/
# rsync -v -a -H username@hostname:/src/mississippi/metrix-missnet-build-env/lib/modules/ /lib/modules/
# rsync -v -a -H username@hostname:/src/mississippi/metrix-missnet-build-env/usr/local/ /usr/local/
# scp username@hostname:/src/mississippi/metrix-missnet-build-env/etc/network/interfaces /etc/network/interfaces
# remountro
}}}
Line 378: Line 349:
  # rsync -v -a -H /src/mississippi/metrix-missnet-build-env/boot/ /src/mississippi/metrix-missnet/boot/
  # rsync -v -a -H /src/mississippi/metrix-missnet-build-env/lib/modules/ /src/mississippi/metrix-missnet/lib/modules/
  # rsync -v -a -H /src/mississippi/metrix-missnet-build-env/usr/local/ /src/mississippi/metrix-missnet/usr/local/
  # cp /src/mississippi/metrix-missnet-build-env/etc/network/interfaces /src/mississippi/metrix-missnet/etc/network/interfaces
  }}}
# rsync -v -a -H /src/mississippi/metrix-missnet-build-env/boot/ /src/mississippi/metrix-missnet/boot/
# rsync -v -a -H /src/mississippi/metrix-missnet-build-env/lib/modules/ /src/mississippi/metrix-missnet/lib/modules/
# rsync -v -a -H /src/mississippi/metrix-missnet-build-env/usr/local/ /src/mississippi/metrix-missnet/usr/local/
# cp /src/mississippi/metrix-missnet-build-env/etc/network/interfaces /src/mississippi/metrix-missnet/etc/network/interfaces
}}}
Line 387: Line 358:
  # cd /src/mississippi
  # umount metrix-missnet
  }}}
# cd /src/mississippi
# umount metrix-missnet
}}}
Line 396: Line 367:
  $ dd if=/src/mississippi/metrix-missnet.img of=/src/mississippi/metrix-missnet-new.img count=32
  32+0 records in
  32+0 records out
  16384 bytes (16 kB) copied, 0.044728 seconds, 366 kB/s
  $ dd if=/src/mississippi/metrix-missnet-part1.img of=/src/mississippi/metrix-missnet-new.img seek=32
  125024+0 records in
  125024+0 records out
  64012288 bytes (64 MB) copied, 6.51654 seconds, 9.8 MB/s
  }}}
$ dd if=/src/mississippi/metrix-missnet.img of=/src/mississippi/metrix-missnet-new.img count=32
32+0 records in
32+0 records out
16384 bytes (16 kB) copied, 0.044728 seconds, 366 kB/s
$ dd if=/src/mississippi/metrix-missnet-part1.img of=/src/mississippi/metrix-missnet-new.img seek=32
125024+0 records in
125024+0 records out
64012288 bytes (64 MB) copied, 6.51654 seconds, 9.8 MB/s
}}}
Line 410: Line 381:
  In the case that there is a running system on the device, the solution is easy. Log in to the device, leave /dev/hda1 mounted read-only, and execute something like this, where "hostname" is where the image lives and "username" is an account that has read access to that image:

  {{{
  # ssh username@hostname 'dd if=/src/mississippi/metrix-missnet-new.img' | dd of=/dev/hda1
  }}}

  Writing underneath a mounted filesystem is a little rude, but since it is read-only, the only likely result is the running system getting confused. Reboot immediately after the dd completes and you should be fine. If the running system doesn't have ssh, you can use wget instead. Something like:

  {{{
  wget -O - <url-of-metrix-missnet-new.img> | dd of=/dev/hda1
  }}}

  If the device does not have a running system, then things are a little more complex to bootstrap. Since the flash on the Soekris boards is soldered on, you can't simply remove it to program on a different machine. Basically, you need to netboot enough of a system to run one of the alternatives above. The approach I am going to take is to nfs-mount the root filesystem of the Soekris, and then dd directly from that nfs mount.
  In the case that there is a running system on the device, the solution is easy. Log in to the device, leave /dev/hda1 mounted read-only, and execute something like this, where "hostname" is the build machine and "username" is an account that has read access to that image:

  {{{
# ssh username@hostname 'dd if=/src/mississippi/metrix-missnet-new.img' | dd of=/dev/hda1
}}}

  Writing underneath a mounted filesystem is a little rude, but since it is read-only, the only bad result might be that the running system gets confused. Reboot immediately after the dd completes and you should be fine. If the running system doesn't have ssh, you can use wget instead. Something like:

  {{{
# wget -O - <url-of-metrix-missnet-new.img> | dd of=/dev/hda1
}}}

  ==== Flashing overview ====

  If the device does not have a running system, then we'll need to bootstrap. Since the flash on the Soekris boards is soldered on, you can't simply remove it to program on a different machine. Basically, you need to netboot enough of a system to dd the image onto the flash. The approach I took is to netboot the Soekris with an nfs-mounted root filesystem, and then dd directly from that nfs mount.

  We will need three services (dhcp, tftp, and nfs) and a serial console to perform this operation. We will need a kernel and a root filesystem. It goes something like this. With a serial console installed, we boot the metrix with ethernet connectivity to the services. We need the serial console in order to force a PXE boot. PXE requests information from the DHCP server, which hands it network configuration information as well as points it at the TFTP server and the bootloader. The TFTP server provides the pxelinux.0 bootloader and a LILO-like configuration file with the kernel boot parameters. The metrix loads the kernel via TFTP and mounts a root filesystem via NFS. Once thus booted, we can login and dd our image to /dev/hda.

    ==== Preparing a kernel for netbooting ====

    We need a kernel to netboot from that has NFS support, and furthermore we need a root filesystem with a user space sufficient to support the flashing. Luckily, we just built very nearly those things in the steps above. We just need to tweak them slightly and they'll be good to go. We'll need to chroot back into our build environment and make the kernel reconfiguration changes:

    {{{
# chroot /src/mississippi/metrix-missnet-build-env
# cd /usr/src/linux-2.6.14.2
# make menuconfig
}}}

    Turn on NFS support:

    {{{
File systems ---> Network File Systems ---> NFS file system support [Y]
File systems ---> Network File Systems ---> Provide NFSv3 client support [Y]
File systems ---> Network File Systems ---> Root file system on NFS [Y]
}}}

    Save the configuration and recompile the kernel and madwifi drivers for good measure, just to keep things in sync.

    {{{
# make
# make install
# make modules_install
# cd /usr/src/madwifi-ng
# KERNELVERSION=2.6.14.2-metrix KERNELPATH=/usr/src/linux-2.6.14.2 make clean
# KERNELVERSION=2.6.14.2-metrix KERNELPATH=/usr/src/linux-2.6.14.2 make install
# exit
}}}

    Upon leaving the chroot, push the changes into our partition image, mounting it if necessary.

    {{{
# mount -o loop /src/mississippi/metrix-missnet-part1.img /src/mississippi/metrix-missnet
# rsync -v -a -H /src/mississippi/metrix-missnet-build-env/boot/ /src/mississippi/metrix-missnet/boot/
# rsync -v -a -H /src/mississippi/metrix-missnet-build-env/lib/modules/ /src/mississippi/metrix-missnet/lib/modules/
# rsync -v -a -H /src/mississippi/metrix-missnet-build-env/usr/local/ /src/mississippi/metrix-missnet/usr/local/
# cp /src/mississippi/metrix-missnet-build-env/etc/network/interfaces /src/mississippi/metrix-missnet/etc/network/interfaces
}}}

    ==== Setting up services ====

     * DHCP: (using the dhcp3-server package) I added the following lines to my Debian /etc/dhcp3/dhcpd.conf file:

      {{{
allow booting;
allow bootp;

group {
        next-server <tftp-server-ip>;
        filename "pxelinux.0";
        option root-path "<nfs-server-ip>:/aux/metrix/rootfs";

        host metrix {
                hardware ethernet <metrix-eth0-macaddr>;
                fixed-address <metrix-ip>;
      }
}
}}}

     Then restart the service:

      {{{
# /etc/init.d/dhcp3-server restart
}}}

     * TFTP: (using the tftpd-hpa package)

      {{{
# cd /var/lib/tftpboot
# wget http://centerclick.org/net4801/pxelinux/pxelinux.0.gz
# gunzip pxelinux.0.gz
# mkdir pxelinux.cfg
# cat > pxelinux.cfg/default <<EOF
SERIAL 0 19200

PROMPT 1
TIMEOUT 40

# nfs root
DEFAULT metrix/vmlinuz console=ttyS0,19200n81 root=/dev/nfs rw ip=dhcp
EOF
# mkdir metrix
# scp username@hostname:/src/mississippi/metrix-missnet-build-env/boot/vmlinuz metrix/vmlinuz
}}}

     * NFS: (using the nfs-kernel-server package) Add an export for the metrix's rootfs:

      {{{
/aux/metrix/rootfs <metrix-ip>(rw,no_root_squash)
}}}

     Then restart the service:

      {{{
# /etc/init.d/nfs-kernel-server restart
}}}

     From the NFS server, copy the rootfs from the mounted (at /src/mississippi/metrix-missnet) metrix-missnet-part1.img, as well as the new image we want to flash.

      {{{
# rsync -v -a -H hostname:/src/mississippi/metrix-missnet/ /aux/metrix/rootfs/
# scp hostname:/src/mississippi/metrix-missnet-new.img /aux/metrix/rootfs/usr/src/
}}}

     The network configuration for flashing from an nfs-mounted rootfs is going to be different than what we want deployed. In the flashing configuration, auto configuring the eth0 interface with the field configuration is going to mess up the the nfs mount. So, comment out the existing auto's (br0, ath0, ath1) and insert this stanza in the NFS server's /aux/metrix/rootfs/etc/network/interfaces:

      {{{
auto eth0
iface eth0 inet dhcp
}}}

    ==== Netbooting ====

     * Attach a null-modem cable to the Soekris serial port;
     * Configure minicom (or similar) to 19200 baud, N81, no flow control;
     * Apply power to the device, and watch messages:

      {{{
comBIOS ver. 1.24 20040312 Copyright (C) 2000-2004 Soekris Engineering.

net45xx

0064 Mbyte Memory CPU 80486 133 Mhz

Pri Mas 064MB ATA Flash Disk LBA 977-4-32 62 Mbyte

PXE-M00: BootManage UNDI, PXE-2.0 (build 082)

Slot Vend Dev ClassRev Cmd Stat CL LT HT Base1 Base2 Int
-------------------------------------------------------------------
0:00:0 1022 3000 06000000 0006 2280 00 00 00 00000000 00000000 00
0:16:0 168C 0013 02000001 0116 0290 10 3C 00 A0000000 00000000 10
0:17:0 168C 0013 02000001 0116 0290 10 3C 00 A0010000 00000000 11
0:18:0 100B 0020 02000000 0107 0290 00 3F 00 0000E001 A0020000 05

 5 Seconds to automatic boot. Press Ctrl-P for entering Monitor.
}}}

     * When you see the Ctrl-P, press Ctrl-P to enter the comBIOS Monitor;
     * Boot PXE
      {{{
> boot f0
}}}
     * The metrix should boot, mount its rootfs over NFS and supply a login prompt on the serial console;
     * Login as root and flash the image:

      {{{
# dd if=/usr/src/metrix-missnet-new.img of=/dev/hda bs=64k
977+0 records in
977+0 records out
# reboot
}}}

     * Let it boot normally this time and you become the proud owner of a reflashed metrix. Happy Hacking!

Maintaining the Image

The following is a description of how RussellSenior has been working on the software running on the metrixes. When I encountered them, all of the metrixes already had the BenjaminJencks firmware, http://cornerstone.personaltelco.net/~brj/metrix-missnet.img. It is setup with all 3 interfaces bridged, and br0 set to 10.11.104.5/22.referenced above.

Updating in place

The metrix firmware is a minimized Debian distribution. The /etc/apt/sources.list include these archives:

deb http://www.backports.org/debian/ stable kernel-2.6
deb http://debian.oregonstate.edu/debian woody main
deb http://security.debian.org woody/updates main

As long as the metrix has access to the internet it can be updated using the standard Debian methods.

# remountrw
# apt-get update
# apt-get upgrade
# apt-get clean
# remountro

For my personal sanity, I have installed "less". For testing/debugging, I have installed "tcpdump", and to keep the clock remotely in sync I have installed "ntpdate" (this seems to be hanging briefly during bootup, not sure why).

Building Software

In order to incrementally build software (e.g., new kernels, madwifi drivers, utilities) for the metrix, one needs a build environment that corresponds to the one on the metrix. My initial attempt to build the madwifi utilities produced partially-broken results because I failed to do this (binaries were linked against symbols that didn't exist in the metrix-installed libraries). Here are the steps I went through to create and use the build environment.

The host for this work was a Debian/unstable system.

  • ==== Unpacking the Image ==== First, create a directory in which to work, e.g. /src/mississippi/ and download the starting image there:
    $ mkdir /src/mississippi
    $ cd /src/mississippi
    $ wget http://cornerstone.personaltelco.net/~brj/metrix-missnet.img
    The downloaded file is 64,028,672 bytes (125,056 512-byte sectors). This represents the /dev/hda flash device on the metrix. It includes the boot sector and partition table, and the root partition /dev/hda1. Grub is used as the boot loader (a rather old feature-missing version, which it would be nice to update, to, for example, be able to control the "next boot"). Before we can mount the first partition, we need to dissect the image a bit. We set up a loop block device associated with the image.
    $ losetup /dev/loop0 metrix-missnet.img
    Now, run fdisk on the loop device to figure out where the first partition begins. Use the -u option to fdisk in order to get sector units.
    $ fdisk -u /dev/loop0
     
    Command (m for help): p
    
    Disk /dev/loop0: 64 MB, 64028672 bytes
    4 heads, 32 sectors/track, 977 cylinders, total 125056 sectors
    Units = sectors of 1 * 512 = 512 bytes
    
          Device Boot      Start         End      Blocks   Id  System
    /dev/loop0p1              32      125055       62512   83  Linux
    
    Command (m for help): q
    Take particular note of the starting sector of the first partition. We'll need that in just a bit. Now disassociate /dev/loop0 from the image file.
    $ losetup -d /dev/loop0
    Now you have a choice. You can either make a copy of the first partition, which you can mount, or you can create a new loop block device offset to the start of first partition and modify it "in place". I chose the former in order to preserve the original, but for reference, you can create the offset loop device as follows. Note that 16384 bytes is the starting sector (32) multiplied by the sector size (512 bytes).
    $ losetup -o 16384 /dev/loop0 metrix-missnet.img
    $ mkdir metrix-missnet
    $ su
    # mount /dev/loop0 metrix-missnet
    Now, what I did instead:
    $ dd if=metrix-missnet.img of=metrix-missnet-part1.img skip=32
    125024+0 records in
    125024+0 records out
    64012288 bytes (64 MB) copied, 7.40427 seconds, 8.6 MB/s
    $ mkdir metrix-missnet
    $ su
    # mount -o loop metrix-missnet-part1.img metrix-missnet
    ==== Creating the Build Environment ==== Now you have access to the image's filesystem through the metrix-missnet mount point. However, the little 64Meg filesystem is too small for the build tool chain, so we are going to create a working copy next door, that we'll chroot into and install the software there. Because we're working with root owned files, we need to stay root here for a while.
    # rsync -v -a -H metrix-missnet/ metrix-missnet-build-env/
    # chroot metrix-missnet-build-env
    Now a little explanatory digression is necessary. The metrix-native environment runs with the filesystem mounted read-only. It copes with changing files by symlinking them to a /rw tmpfs filesystem. That /rw filesystem gets populated during boot from static versions in a /ro tree. You are going to be needing to install software from Debian archives, but your DNS resolution won't work until you modify the build environment's /etc/resolv.conf to something that works for you locally. However, /etc/resolv.conf is a symlink pointing at /rw/etc/resolv.conf. At this stage, that file doesn't exist, since /rw is just a mount point in the original. There are lots of potential solutions to this problem. I took the most direct one, effectively replicating what the metrix itself does:
    # rsync -v -a -H /ro/ /rw/
    # vi /etc/resolv.conf (as appropriate)
    Then ping some well-known host to confirm that your network is functioning in the chroot.
    # ping www.google.com
    PING www.l.google.com (66.102.7.147): 56 data bytes
    64 bytes from 66.102.7.147: icmp_seq=0 ttl=238 time=56.0 ms
    64 bytes from 66.102.7.147: icmp_seq=1 ttl=238 time=56.4 ms
    64 bytes from 66.102.7.147: icmp_seq=2 ttl=238 time=60.8 ms
    64 bytes from 66.102.7.147: icmp_seq=3 ttl=238 time=59.7 ms
    
    --- www.l.google.com ping statistics ---
    4 packets transmitted, 4 packets received, 0% packet loss
    round-trip min/avg/max = 56.0/58.2/60.8 ms
    ==== Install toolchain ==== For good measure, we'll sync up currently installed packages with the Debian archives, but first we'll modify the /etc/apt/sources.list to accomodate subversion we're going to need soon. Add subversion to the backports line:
    deb http://www.backports.org/debian/ stable kernel-2.6 subversion
    Then sync up:
    # apt-get update
    Hit http://debian.oregonstate.edu woody/main Packages
    Hit http://debian.oregonstate.edu woody/main Release
    Get:1 http://security.debian.org woody/updates/main Packages [245kB]
    Hit http://www.backports.org stable/kernel-2.6 Packages
    Hit http://www.backports.org stable/kernel-2.6 Release
    Get:2 http://www.backports.org stable/subversion Packages [8729B]
    Get:3 http://security.debian.org woody/updates/main Release [113B]
    Get:4 http://www.backports.org stable/subversion Release [141B]
    Fetched 254kB in 1s (186kB/s)
    Reading Package Lists...
    Building Dependency Tree...
    # apt-get upgrade
    Reading Package Lists...
    Building Dependency Tree...
    7 packages upgraded, 0 newly installed, 0 to remove and 0  not upgraded.
    Need to get 1259kB of archives. After unpacking 61.4kB will be used.
    Do you want to continue? [Y/n] y
    Say yes. Now, install the toolchain and a few tools we'll need:
    # apt-get install make gcc libncurses5-dev subversion sharutils
    Reading Package Lists...
    Building Dependency Tree...
    The following extra packages will be installed:
      binutils cpp cpp-2.95 db4.2-util gcc-2.95 libapr0 libc6-dev libdb4.2
      libexpat1 libldap2 libneon24 libpcre3 libsasl7 libsvn0 libswig1.3.22 libxml2
      patch python python2.1 
    The following NEW packages will be installed:
      binutils cpp cpp-2.95 db4.2-util gcc gcc-2.95 libapr0 libc6-dev libdb4.2
      libexpat1 libldap2 libncurses5-dev libneon24 libpcre3 libsasl7 libsvn0
      libswig1.3.22 libxml2 make patch python python2.1 sharutils subversion 
    0 packages upgraded, 24 newly installed, 0 to remove and 0  not upgraded.
    Need to get 11.7MB of archives. After unpacking 40.4MB will be used.
    Do you want to continue? [Y/n] y
    Say yes. You may get a warning while configuring binutils about a possible kernel link failure. It applies to older kernels, and we'll be using something newish, so it shouldn't affect us. ==== Building a Kernel ==== Now, download a kernel tarball and unpack. I'll use 2.6.14.2 here.
    # cd /usr/src
    # wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.14.2.tar.bz2
    # tar xjvf linux-2.6.14.2.tar.bz2
    Start with the existing kernel config in /boot:
    # cd linux-2.6.14.2
    # cp /boot/config-2.6.12.3-metrix .config
    # make oldconfig
    I selected defaults for everything, except:
    • Automatically append version information to the version string (LOCALVERSION_AUTO) [Y/n/?] (NEW) n
    • Dell Systems Management Base Driver (DCDBAS) [M/n/y/?] (NEW) n
    • Generic IEEE 802.11 Networking Stack (IEEE80211) [N/m/y/?] (NEW) y
    • Inotify file change notification support (INOTIFY) [Y/n/?] (NEW) n
    Note that this configuration is set up for a Metrix Mark II, with a Soekris 4826 board and a Geode GX1 CPU. In order to work with the Metrix Mark I, which uses a Soekris 4526 and an AMD 486 clone, you need to modify the configuration, e.g. using "make menuconfig". Trying to boot the 4526 with a Geode compiled kernel will choke as follows:
    CPU: AMD 486 DX/4-WB stepping 04
    Kernel panic - not syncing: Kernel compiled for Pentium+, requires TSC feature!
    Next, compile the kernel:
    # make
    # make install 
    # make modules_install 
    The modules are installed in /lib/modules/2.6.14.2-metrix. Edit /boot/grub/menu.lst, adding a stanza for the new kernel. For example:
    title           Debian GNU/Linux, kernel 2.6.14.2-metrix
    root            (hd0,0)
    kernel          /boot/vmlinuz-2.6.14.2-metrix root=/dev/hda1 ro console=ttyS0,19200n8 panic=5
    savedefault
    Since we have no consoles on the metrixes in the field, and no non-volatile storage is available to record any oops messages, there isn't much purpose served by having a panic just halt the device, so I've added the panic clause to the boot options in hopes that will recover the device in the case of a fault. ==== Building the Madwifi-ng modules and utilities ==== In order to build the madwifi-ng software, we first need to check it out from SVN:
    # cd /usr/src
    # svn checkout http://svn.madwifi.org/trunk madwifi-ng
    # cd /usr/src/madwifi-ng
    Then build the madwifi-ng code. Because you are building it for the newly compiled kernel rather than the one you are running, you need to set some environment variables. As of revision 1329, I also needed to hack the Makefile slightly to get depmod to do the right thing. Maybe not the right fix, but it worked for me. Change the line with depmod to this:
            (export MODULEPATH=${MODULEPATH}; depmod -ae ${KERNELVERSION})
    Now, build madwifi with make:
    # KERNELVERSION=2.6.14.2-metrix KERNELPATH=/usr/src/linux-2.6.14.2 make
    # KERNELVERSION=2.6.14.2-metrix KERNELPATH=/usr/src/linux-2.6.14.2 make install 
    ==== Modifying /etc/network/interfaces ====

    We also need to revise the /etc/network/interfaces file to support the new madwifi drivers. Some of this configuration (e.g. wlanconfig lines) are new with the madwifi-ng code, so we've added " || true" lines where the earlier madwifi drivers will fail. Eventually we'll just purge the old madwifi stuff and the armor can go at the same time. The br0 address (10.11.104.4) is a dummy value and will need to be modified on any deployed metrix.

    auto lo
    iface lo inet loopback
    iface lo inet6 loopback
     
    auto br0
    iface br0 inet static
            address 10.11.104.4
            netmask 255.255.252.0
            broadcast 10.11.107.255
            gateway 10.11.104.1
            bridge_ports eth0
            bridge_stp on
            bridge_maxwait 0
    
    auto ath0
    iface ath0 inet static
            address 1.0.0.0
            netmask 255.255.255.255
            broadcast 255.255.255.255
            pre-up modprobe ath-pci
            pre-up wlanconfig ath0 create wlandev wifi0 wlanmode sta || true
            pre-up iwpriv ath0 wds 1 || true
            pre-up iwpriv ath0 mode 1
            up brctl addif br0 ath0
            down brctl delif br0 ath0
            post-down wlanconfig ath0 destroy
            wireless_mode managed
            wireless_essid backhaul
    
    auto ath1
    iface ath1 inet static
            address 1.0.0.0
            netmask 255.255.255.255
            broadcast 255.255.255.255
            pre-up modprobe ath-pci
            pre-up wlanconfig ath1 create wlandev wifi1 wlanmode ap || true
            pre-up iwpriv ath1 mode 3
            up brctl addif br0 ath1
            down brctl delif br0 ath1
            post-down wlanconfig ath1 destroy
            wireless_mode master
            wireless_essid www.personaltelco.net
            wireless_channel 1
    In the case of new 802.11a master nodes, we'll need to modify the ath0 stanza to:
    auto ath0
    iface ath0 inet static
            address 1.0.0.0
            netmask 255.255.255.255
            broadcast 255.255.255.255
            pre-up modprobe ath-pci
            pre-up wlanconfig ath0 create wlandev wifi0 wlanmode ap || true
            pre-up iwpriv ath0 wds 1 || true
            pre-up iwpriv ath0 mode 1
            up brctl addif br0 ath0
            down brctl delif br0 ath0
            post-down wlanconfig ath0 destroy
            wireless_mode master
            wireless_essid backhaul
            wireless_channel 165
    We are now finished with the chroot and can exit from it:
    # exit
    ==== Installing the new software ==== The steps above have installed new software in /boot, /lib/modules, and /usr/local as well as the /etc/network/interfaces file we just changed in the last step. We can use rsync to put these changes into place, but we don't want to do an rsync from the root directory as our build environment has excessive cruft. Instead, we want to explicitly rsync the trees/files indicated above. If the target of the modification is a running metrix, then you should probably rsync from there over the network, like so:
    $ slogin buick.personaltelco.net
    $ slogin root@metrix-foo
    # remountrw
    # rsync -v -a -H username@hostname:/src/mississippi/metrix-missnet-build-env/boot/ /boot/
    # rsync -v -a -H username@hostname:/src/mississippi/metrix-missnet-build-env/lib/modules/ /lib/modules/
    # rsync -v -a -H username@hostname:/src/mississippi/metrix-missnet-build-env/usr/local/ /usr/local/
    # scp username@hostname:/src/mississippi/metrix-missnet-build-env/etc/network/interfaces /etc/network/interfaces
    # remountro
    You'll need to be a little careful with /etc/network/interfaces, in particular setting the br0 address correctly and making sure you've got ath0 master/managed mode configured correctly. To install in the locally-mounted (at /src/mississippi/metrix-missnet) partition image, do similarly:
    # rsync -v -a -H /src/mississippi/metrix-missnet-build-env/boot/ /src/mississippi/metrix-missnet/boot/
    # rsync -v -a -H /src/mississippi/metrix-missnet-build-env/lib/modules/ /src/mississippi/metrix-missnet/lib/modules/
    # rsync -v -a -H /src/mississippi/metrix-missnet-build-env/usr/local/ /src/mississippi/metrix-missnet/usr/local/
    # cp /src/mississippi/metrix-missnet-build-env/etc/network/interfaces /src/mississippi/metrix-missnet/etc/network/interfaces
    We are now finished with the loopback mounted partition, so we can unmount it.
    # cd /src/mississippi
    # umount metrix-missnet
    ==== Creating a new image ==== To create a new image, we can crib the first 32 sectors from the original image, then paste on our modified filesystem part. We can do this as non-root. Note, we got the 32 from our fdisk examination of the original image. Substitute a different value as necessary.
    $ dd if=/src/mississippi/metrix-missnet.img of=/src/mississippi/metrix-missnet-new.img count=32
    32+0 records in
    32+0 records out
    16384 bytes (16 kB) copied, 0.044728 seconds, 366 kB/s
    $ dd if=/src/mississippi/metrix-missnet-part1.img of=/src/mississippi/metrix-missnet-new.img seek=32
    125024+0 records in
    125024+0 records out
    64012288 bytes (64 MB) copied, 6.51654 seconds, 9.8 MB/s
    Viola! There's our new image, metrix-missnet-new.img, ready to install. ==== Installing an image ==== In the case that there is a running system on the device, the solution is easy. Log in to the device, leave /dev/hda1 mounted read-only, and execute something like this, where "hostname" is the build machine and "username" is an account that has read access to that image:
    # ssh username@hostname 'dd if=/src/mississippi/metrix-missnet-new.img' | dd of=/dev/hda1
    Writing underneath a mounted filesystem is a little rude, but since it is read-only, the only bad result might be that the running system gets confused. Reboot immediately after the dd completes and you should be fine. If the running system doesn't have ssh, you can use wget instead. Something like:
    # wget -O - <url-of-metrix-missnet-new.img> | dd of=/dev/hda1
    ==== Flashing overview ==== If the device does not have a running system, then we'll need to bootstrap. Since the flash on the Soekris boards is soldered on, you can't simply remove it to program on a different machine. Basically, you need to netboot enough of a system to dd the image onto the flash. The approach I took is to netboot the Soekris with an nfs-mounted root filesystem, and then dd directly from that nfs mount. We will need three services (dhcp, tftp, and nfs) and a serial console to perform this operation. We will need a kernel and a root filesystem. It goes something like this. With a serial console installed, we boot the metrix with ethernet connectivity to the services. We need the serial console in order to force a PXE boot. PXE requests information from the DHCP server, which hands it network configuration information as well as points it at the TFTP server and the bootloader. The TFTP server provides the pxelinux.0 bootloader and a LILO-like configuration file with the kernel boot parameters. The metrix loads the kernel via TFTP and mounts a root filesystem via NFS. Once thus booted, we can login and dd our image to /dev/hda.
    • ==== Preparing a kernel for netbooting ==== We need a kernel to netboot from that has NFS support, and furthermore we need a root filesystem with a user space sufficient to support the flashing. Luckily, we just built very nearly those things in the steps above. We just need to tweak them slightly and they'll be good to go. We'll need to chroot back into our build environment and make the kernel reconfiguration changes:
      # chroot /src/mississippi/metrix-missnet-build-env
      # cd /usr/src/linux-2.6.14.2
      # make menuconfig
      Turn on NFS support:
      File systems ---> Network File Systems ---> NFS file system support [Y]
      File systems ---> Network File Systems ---> Provide NFSv3 client support [Y]
      File systems ---> Network File Systems ---> Root file system on NFS [Y]
      Save the configuration and recompile the kernel and madwifi drivers for good measure, just to keep things in sync.
      # make
      # make install
      # make modules_install
      # cd /usr/src/madwifi-ng
      # KERNELVERSION=2.6.14.2-metrix KERNELPATH=/usr/src/linux-2.6.14.2 make clean
      # KERNELVERSION=2.6.14.2-metrix KERNELPATH=/usr/src/linux-2.6.14.2 make install
      # exit
      Upon leaving the chroot, push the changes into our partition image, mounting it if necessary.
      # mount -o loop /src/mississippi/metrix-missnet-part1.img /src/mississippi/metrix-missnet
      # rsync -v -a -H /src/mississippi/metrix-missnet-build-env/boot/ /src/mississippi/metrix-missnet/boot/
      # rsync -v -a -H /src/mississippi/metrix-missnet-build-env/lib/modules/ /src/mississippi/metrix-missnet/lib/modules/
      # rsync -v -a -H /src/mississippi/metrix-missnet-build-env/usr/local/ /src/mississippi/metrix-missnet/usr/local/
      # cp /src/mississippi/metrix-missnet-build-env/etc/network/interfaces /src/mississippi/metrix-missnet/etc/network/interfaces
      ==== Setting up services ====
      • DHCP: (using the dhcp3-server package) I added the following lines to my Debian /etc/dhcp3/dhcpd.conf file:
        • allow booting;
          allow bootp;
          
          group {
                  next-server <tftp-server-ip>;
                  filename "pxelinux.0";
                  option root-path "<nfs-server-ip>:/aux/metrix/rootfs";
          
                  host metrix {
                          hardware ethernet <metrix-eth0-macaddr>;
                          fixed-address <metrix-ip>;
                }
          }
        Then restart the service:
        • # /etc/init.d/dhcp3-server restart
      • TFTP: (using the tftpd-hpa package)
        • # cd /var/lib/tftpboot
          # wget http://centerclick.org/net4801/pxelinux/pxelinux.0.gz
          # gunzip pxelinux.0.gz
          # mkdir pxelinux.cfg
          # cat > pxelinux.cfg/default <<EOF
          SERIAL 0 19200
          
          PROMPT 1
          TIMEOUT 40
          
          # nfs root
          DEFAULT metrix/vmlinuz console=ttyS0,19200n81 root=/dev/nfs rw ip=dhcp
          EOF
          # mkdir metrix
          # scp username@hostname:/src/mississippi/metrix-missnet-build-env/boot/vmlinuz metrix/vmlinuz
      • NFS: (using the nfs-kernel-server package) Add an export for the metrix's rootfs:
        • /aux/metrix/rootfs      <metrix-ip>(rw,no_root_squash)
        Then restart the service:
        • # /etc/init.d/nfs-kernel-server restart
        From the NFS server, copy the rootfs from the mounted (at /src/mississippi/metrix-missnet) metrix-missnet-part1.img, as well as the new image we want to flash.
        • # rsync -v -a -H hostname:/src/mississippi/metrix-missnet/ /aux/metrix/rootfs/
          # scp hostname:/src/mississippi/metrix-missnet-new.img /aux/metrix/rootfs/usr/src/
        The network configuration for flashing from an nfs-mounted rootfs is going to be different than what we want deployed. In the flashing configuration, auto configuring the eth0 interface with the field configuration is going to mess up the the nfs mount. So, comment out the existing auto's (br0, ath0, ath1) and insert this stanza in the NFS server's /aux/metrix/rootfs/etc/network/interfaces:
        • auto eth0
          iface eth0 inet dhcp
      ==== Netbooting ====
      • Attach a null-modem cable to the Soekris serial port;
      • Configure minicom (or similar) to 19200 baud, N81, no flow control;
      • Apply power to the device, and watch messages:
        • comBIOS ver. 1.24  20040312  Copyright (C) 2000-2004 Soekris Engineering.
          
          net45xx
          
          0064 Mbyte Memory                        CPU 80486 133 Mhz 
          
          Pri Mas  064MB ATA Flash Disk            LBA 977-4-32  62 Mbyte
          
          PXE-M00: BootManage UNDI, PXE-2.0 (build 082)
          
          Slot   Vend Dev  ClassRev Cmd  Stat CL LT HT  Base1    Base2   Int 
          -------------------------------------------------------------------
          0:00:0 1022 3000 06000000 0006 2280 00 00 00 00000000 00000000 00
          0:16:0 168C 0013 02000001 0116 0290 10 3C 00 A0000000 00000000 10
          0:17:0 168C 0013 02000001 0116 0290 10 3C 00 A0010000 00000000 11
          0:18:0 100B 0020 02000000 0107 0290 00 3F 00 0000E001 A0020000 05
          
           5 Seconds to automatic boot.   Press Ctrl-P for entering Monitor.
      • When you see the Ctrl-P, press Ctrl-P to enter the comBIOS Monitor;
      • Boot PXE
        • > boot f0
      • The metrix should boot, mount its rootfs over NFS and supply a login prompt on the serial console;
      • Login as root and flash the image:
        • # dd if=/usr/src/metrix-missnet-new.img of=/dev/hda bs=64k
          977+0 records in
          977+0 records out
          # reboot
      • Let it boot normally this time and you become the proud owner of a reflashed metrix. Happy Hacking!


[CategoryDocumentation]

MississippiMetrixConfiguration (last edited 2009-01-31 02:10:15 by RussellSenior)