PXE Imager

about | archive


[ 2006-February-10 11:36 ]

This is a tool for automating the installation of Linux systems over a network. The system does a network boot and presents a list of available images. The selected image is downloaded and configured automatically, and finally the system reboots. I use this tool to write various configurations to my Soekris Net4526 and PC Engines WRAP embedded systems, although there is no reason it can't be used for regular PCs.

Install: pxeimager-tftpboot.tar.bz

Source: pxeimager.tar.bz

Installing

First, extract the install image. This will create a tftpboot directory. Next, configure a DHCP server to instruct clients to download the pxelinux.0 file, and configure a TFTP server to use the tftpboot directory as its root. If you do not know how to do this, detailed directions can be found elsewhere on the Internet. For example, Debian's network booting directions are pretty good.

Now, boot your system. You should see PXELinux start, and it will download the pxeimager.img.gz disk image, and boot. Finally, you will be presented with a menu with two example images listed. If you get this far, everything is working and you need to configure and prepare some images.

Configuring

You need to edit the tftpboot/images file to list all the available images. Detailed instructions are included in the comments in that file. Additionally, the tftpboot/example directory contains sample scripts that you can use as a starting point.

Images

Installing an image is a three stage process. First, an init script is run. This script needs to partition the disk(s), format the partition(s), and finally mount the filesystem(s) on /mnt. Next, the image.tar archive is extracted into /mnt. Thus, this archive must contain all the files for your system. Finally, the post script is run. This script must end by making the system bootable (eg. by running lilo). After this,the system is rebooted.

Technical Details

The PXE Imager is a stripped down Debian 3.0r1 image. I have detailed directions about how I created this image. Using Debian has two advantages. First, it has been widely tested, and second, I can use their package management tools. It has one disadvantage: the image is much larger than it could be. The image uses Debian's hardware detection framework. Hopefully, this is sufficient to find a driver for whatever network card is on the system. Finally, the actual menu system is driven by a simple Python script. The source package contains the original Debian image (not stripped down), the Python script, and a script that removes unneeded files and creates a disk image.