In my last entry I showed how to make the Linux distro SystemRescueCD PXE bootable. In this entry I'm going to give you 2 examples of making boot images that you can boot over the network with PXE. The first image we are going to make is a bootable version of the Seatools diagnostic software to test hard drives from Seagate. The second image we are going to make is a generic dos bootable PXE image.
The images we make will be loaded by the syslinux bootloader. The installation and setup of syslinux was covered in the entry "Making SystemRescueCD PXE bootable".
The first image we are going to make one for Seatools. Seatools is diagnostic software given out by Seagate to test/fix their hard drives. To make a this image you will need access to a windows machine. Either boot into a windows virtual machine or just use a actual windows machine. First, go to the Seagate website and go to the support section. In there you will see the downloads section. Look for the software "Seatools for DOS". Follow the links to the download section. When offered the choice of text or graphical choose either one they both work. Now choose the "Floppy Diskette Creator" and download that to the windows machine. It will be a windows executable. This is what we will need to make the floppy disk for us.
The next thing we need to download is the software that will emulate a floppy disk drive for us. Download the free software called Virtual Floppy Drive for Windows. Unzip it and run the vfdwin.exe executable. Click the driver tab and click the Start button to load the virtual floppy driver. Then click the Drive0 tab. Click the Change button and select a drive letter to be the virtual floppy drive. Then click the Open/Create button and click the browse button. Type the name of an image file you want to make. Make sure you give the filename the extention .img. Then click the Open button to finish the selection. Media type should be 3.5 1.44MB. Disk type should be set to FILE. Then click the create button. Now, Run the Seatools software you downloaded and if it asks point it to the floppy drive. It might not ask. Just click the "Create Floppy" button. After its done writing click the close button under the Drive0 tab to finish the floppy image. Now take the .img file you just made and put it on the tftp server with the other PXE boot images you have. Edit your PXE boot menu and put in an entry for this image. Below is the entry for my syslinux PXE boot menu.
label seatools kernel memdisk append initrd=seatools.img floppy
On next boot you should be able to type "seatools" at the PXE boot prompt and seatools should load
Now lets look at creating a generic dos boot image. With this dos boot image you can do things like flash a bios of a machine that does not have a cdrom or floppy disk. You can run lots of dos programs you need right from the PXE boot prompt. First, we need to download a dos floppy disk image from somewhere. This is just generic dos boot disk made by using dd on linux to copy it to a file. Like "dd if=/dev/fd0 of=/tmp/floppy.img bs=10240". If you have a favorite dos floppy you can make an boot image of it with that last command. Then copy the image over to the tftp directory where the other images are and put in a boot menu item for it. It just might boot.
I choose to take an already made dos boot image and put my own software on it. I downloaded a clean version of a 2.88MB FreeDOS boot disk. It was made by a Sourceforge project called FreeDOS Odin. So go there and download one yourself. Save a copy of the downloaded image file somewhere so you can keep reusing it. Now we are going to add our own software to the dos boot disk image we just downloaded. I made a copy of my downloaded image and called it dosboot.img. We are going to mount that file and copy the files we need to the disk image. The example below will copy the file dosbin.exe as an example.
mkdir /tmp/dos
sudo mount -o loop dosboot.img /tmp/dos/
sudo cp dosbin.exe /tmp/dos
sudo umount /tmp/dos
Now copy the dosboot.img file back up to the tftp boot dir. Edit the PXE menu file and put in a new line for the DOS floppy image. Look at the example above for a reference. Save the file and boot your new PXE image.