You can use PXE Boot for a wide variety of purposes. My motivation on this occasion was to write a new image the CF card that my Soekris NET5501 AskoziaPBX Asterisk server boots from, without having to unbolt the server from the rack.
To install a full FreeBSD system, see :-
http://jdc.parodius.com/freebsd/pxeboot_serial_install.html
http://wiki.soekris.info/Installing_FreeBSD
http://wiki.soekris.info/Installing_FreeBSD#Patch_for_PATA_hard_disk_errors_on_FreeBSD_7.x
To install other operating systems, see:-
http://wiki.soekris.info/Main_Page#Operating_Systems .
To load an embedded "appliance" distribution (Monowall, pfSense, AskoziaPBX, FreeNAS?) the procedure is much simpler, and should only take a couple of minutes. During installation, we'll use a special-purpose LiveCD to avoid having to configure anything by hand, with a standalone Ethernet cable to avoid conflicts with existing network configurations.
Prerequisites:
- Working serial console access to the Soekris computer (9600-N-8-1 with no handshaking).
- A temporary PC or a VMware server, to boot a LiveCD as your PXE server.
- An Ethernet cable from the LiveCD PXE server to the first Ethernet port on the Soekris.
- A USB memory stick containing the image you want to install to the Soekris.
Procedure:
- Download the Voyage Linux Live CD ISO from http://linux.voyage.hk. (I used 0.6.5.)
- Boot the Live CD on a spare PC, or under VMware. Use a standalone network (e.g. just one Ethernet cable) because Voyage Linux will start its own DHCP and TFTP servers.
- Login to the Live CD system: user "root", password "voyage". Execute the commands:
Start the Soekris machine. When prompted, type Control-P to enter the ComBIOS monitor. Now type: 'boot f0' (that's f, then zero) to begin the PXE Boot process.remountrw[Optional: To change the IP address range: vi /etc/dnsmasq.pxe.conf /etc/exports /etc/init.d/voyage-pxe /tftpboot/pxelinux.cfg/default and change 192.168.1. Do not reboot! The changes are volatile! ]
/etc/init.d/dnsmasq restart/etc/init.d/voyage-pxe start
- Keep an eye on the Soekris serial console. After the Linux kernel has booted, if you're lucky you'll get a login prompt. Log in as user "root", password "voyage".
- If instead of a login prompt, you get repeated "mount call failed: 13" errors, just wait for a minute. You will be dropped into a BusyBox shell with the prompt "(initramfs)", which is good enough for most purposes.
- Now plug the USB memory stick into the Soekris PC.
- Use this command sequence to load the image onto the Soekris (your mileage may vary slightly) :-
mkdir /tmp/usbThis assumes that your .img file has already been decompressed using gzip. If not, you should be able to get away with "gzip -dc /tmp/usb/fred.img >/dev/hda" although this will be a bit slow.
mount -t vfat /dev/sda1 /tmp/usb
dd if=/tmp/usb/fred.img of=/dev/hda bs=16k
You may need to tweak the /dev entries to match your hardware, depending on the type of disks you have. It may be helpful to use the 'ls' command to check for /dev/hd* and /dev/sd* before you plug in the USB memory stick, so that you can be sure which device is which. For example the hard disk may be /dev/hdb on some systems.
Excellent documentation. Works like a charm. THANK YOU.
ReplyDelete