Updating BIOS automatically with PXE and FreeDOS

To update the BIOS on all machines, the easiest thing to do is create a bootable disk that runs the flasher and reboots. We can load this all up over the network via PXE and re-flash a whole hoard of nodes in one go.

Since the X8SIT BIOS image is about 4MB uncompressed, it won't fit on a floppy in that form. Fortunately, however, the zipped file is much smaller, so we can use a 2.88MB boot disk that contains unzip.exe and the flashing utility. We then create a ram disk, unzip the new bios there, and run. Making our own boot disks is a bit of a chore, but fortunately some other enterprising folks did this already for their cluster:

http://www.lsc-group.phys.uwm.edu/beowulf/nemo/construction/BIOS-imaging.html

We'll just use that image and modify the contents to suit our needs.

Steps:

  1. Grab the http://www.lsc-group.phys.uwm.edu/beowulf/nemo/construction/BIOS/Nemo-node-config.img FreeDOS 2.88MB bootable floppy image.
  2. Mount it (mount -o loop node-config.img /mnt)
  3. Copy the bios zip file to /mnt
  4. Edit config.sys to create a larger ramdisk (8192KB is fine for our machines)
  5. Edit autoexec.bat to copy/extract the right files to the ramdisk and call the right bios flashing script.
  6. Add a pxelinux config file that loads and runs the boot disk (via memdisk)

 

Below is an example boot disk for our X8SIT supermicro servers that updates to bios rev 1.2.

 

The boot disk (x8sit_1.2bios_updater.img) contains:

TDSK.EXE
X8SIT1.C22.zip
autoexec.bat
command.com
config.sys
fdxms.sys
kernel.sys
set.img
setboot.exe
shutdown.com
unzip.exe

 

config.sys contains:

DEVICE=FDXMS.SYS
DEVICE = TDSK.EXE 8192

 

autoexec.bat contains:

@echo off
PROMPT $P$G
VERIFY ON
BREAK ON
SET RAMDRIVE=C:
echo Running setboot.exe
setboot.exe
COPY *.ZIP C:\
echo Copying unzip.exe to c:
COPY unzip.exe c:\
echo CWD c:
c:
echo Unpacking *.zip
unzip -x *.zip
echo Flashing Bios
CALL ami.bat X8SIT1.C22
a:
shutdown.com R

 

The TFTP server's pxelinux config is as follows:

default x8sit-bios-update
label x8sit-bios-update
 kernel memdisk
 append initrd=x8sit_1.2bios_updater.img floppy raw