You would rather install Pyramid Linux via PXE boot because you have several routerboards to install, or you have onboard nonremovable Compact Flash, or you just prefer to do it this way. Your installation server runs Debian.
No problem, you can do this because the Soekris boards (and PC Engines and all their little cousins) support netbooting. While the HTTP, TFTP, and DHCP services in this recipe can be on different machines, the examples here assume they are all on a single PC. Any PC will do (e.g., a workstation, your special network administrator laptop, anything).
To get started, first download the latest Pyramid dd image or tarball from http://metrix.net/support/dist/ into the directory of your choice:
$ wget http://metrix.net/support/dist/pyramid-1.0b2.img.gz
Then, you need these services installed:
DHCPD
TFTP
HTTP
Subversion
You don't need a big old heavyweight HTTP server like Apache. Lighttpd is great for lightweight applications like this. Install them with this command:
# apt-get install lighttpd lighttpd-doc tftpd-hpa dhcp3-server subversion
Copy this /etc/dhcp3/dhcpd.conf file exactly:
##/etc/dhcp3/dhcpd.conf subnet 192.168.200.0 netmask 255.255.255.0 { range 192.168.200.100 192.168.200.200; allow booting; allow bootp; next-server 192.168.200.1; filename "PXE/pxelinux.0"; max-lease-time 60; default-lease-time 60; }
next-server
is the IP address
of the boot server; it must be 192.168.200.1.
Next, configure tftpd by editing /etc/default/tftpd-hpa like this:
##/etc/default/tftpd-hpa RUN_DAEMON="yes" OPTIONS="-a 192.168.200.1:69 -l -s -vv /var/lib/tftpboot/"
Change your working directory to /var/lib/tftpboot and download the PXE environment from Metrix's Subversion repository:
root@xena:/var/lib/tftpboot # svn export http://pyramid.metrix.net/svn/PXE
This is about a 45 MB download.
Next, inside your httpd document root directory, /var/www, make a symlink to the Pyramid tarball or image you downloaded and name it "os":
root@xena:/var/www # ln -s /home/carla/downloads/pyramid-1.0b2.tar.gz os
Then, temporarily change the IP address of your installation server with this command:
# ifconfig eth0 192.168.200.1 netmask 255.255.255.0 broadcast 192.168.200.255
Now, start all these services:
# cd /etc/init.d # dhcp3-server start && lighttpd start && tftpd-hpa start
Install the CF card, then connect the serial and Ethernet cables
to your Soekris board, and fire up Minicom. It doesn't matter if
something is already installed on the CF card. Power up the board, and
enter the comBIOS by pressing Ctrl-P when prompted. Then, enter
boot F0:
comBIOS Monitor. Press ? for help.
> boot F0
You'll see it acquire a DHCP lease, a quick TFTP blink, and then you'll be in the installation menu:
Choose from one of the following: 1. Start the automated Pyramid Linux install process via dd image file 2. Start the automated Pyramid Linux install process via fdisk and tarball 3. Boot the Pyramid Linux kernel with a shell prompt 4. Boot the Pebble Linux install process 5. Boot the Pebble Linux kernel with a shell 6. Install the latest snapshot
Select either 1 or 2, according to what you downloaded. Go have a nice healthy walk, and in 10 minutes, you'll have a fresh Pyramid installation all ready to go.
Finally, restore your server's IP address with ifupdown:
# ifdown eth0
# ifup eth0
A slick way to do this is to put it all on your special netadmin laptop. It's portable, and you can easily isolate it from the other servers on your network. You especially don't want to conflict with any existing DHCP servers. Just connect the routerboard and laptop with a crossover Ethernet cable and null modem cable, and away you go.
If you're using a LAN PC for this, you might want to configure the HTTP, DHCP, and TFTP servers so that they do not automatically start at boot, especially the DHCP server.
Pay close attention to your filepaths; this is the most common source of errors.
You should still have a CF writer handy in case of problems. For example, if a non-Linux operating system is already installed on it, you'll probably have to manually zero out the Master Boot Record (MBR). So, you'll need to be able to mount the card in a CF writer, then use dd to erase the MBR. In this example, the Flash card is /dev/hdc:
# dd if=/dev/zero of=/dev/hdc bs=512 count=1
Check your HTTP server configuration file for the location of
the server's documentation root directory. On Apache, this is the
DocumentRoot
directive. Currently,
you'll find this in
/etc/apache2/sites-available/default. On
Lighttpd, look for the server.document-root
directive in
/etc/lighttpd/lighttpd.conf.
When your Pyramid image file or tarball is copied to your HTTP root directory, verify that it's in the correct location by going to 192.168.200.1/os. It should try to download the file into your web browser, which will appear as a big gob of binary gibberish.
Pyramid Linux home page: http://pyramid.metrix.net/
man 8 tftpd
man 8 dhcpd
/usr/share/doc/lighttpd-doc/