- mkisofs or genisoimage
- unzip utility for Linux
- unix2dos (part of dos2unix packages)
This guide will cover creating DOS bootable ISO files to assist with simple and automated firmware updates for the most frequently updated components. The completed CD image can be burned to a CD, copied to a USB drive using Rufus or dd, or can be mounted with IPMI virtual media.
Why do we need this?
Simplicity, and to save space. DOS is fairly portable, and creating your own ISO files allows you to bundle flashing utilities along with firmware to avoid having to write up a separate tutorial for the customer. The customer can simply boot it, and scripted autorun utilities take care of the rest.
1. Download the attached FreeDOS OEM iso creator utility. This package includes a pre-formatted MOTD on boot for customer-facing DOS .iso files.
2. Extract the files and navigate to the CDROOT folder.
- # unzip FDOEMCD.builder.zip
- # cd FDOEMCD/CDROOT/
3. Copy/paste the necessary update files to CDROOT, and add an entry in the AUTORUN.BAT file for automatic flash on boot. The files you use will depend on what type of firmware or BIOS update you wish to run.
- For a SuperMicro BIOS update, copy over the following files:
- # cp <bios update path>/afudos.smc /FDOEMCD/CDROOT/
- # cp <bios update path>/DM82A229.ROM /FDOEMCD/CDROOT/
- Check the readme and the contents of the BIOS update download from SuperMicro. If the BIOS update includes a .bat file to assist with the flash, open it and examine its contents.
- # cat <bios update path>/flash.bat
- The basic commands of a BIOS update batch executable are broken down like this:
- Hide commands internal to the script from showing on the command line.
- @echo off
- Rename afudos.smc to afudos.exe. Prevents users from accidentally running executable outside of the batch script.
- REN AFUDOS.SMC AFUDOS.EXE
- Run flash command, where %1 corresponds to user-inputted file name.
- AFUDOS.EXE %1 /P /B /N /C
- Rename afudos.exe back to afudos.smc
- REN AFUDOS.EXE AFUDOS.SMC
- Open up AUTORUN.BAT as well, and copy over the flash command found in “flash.bat”. Change the “%1” to the name of the firmware ROM file.
- # cd /FDOEMCD/CDROOT
- # echo “AFUDOS.EXE DM82A229.ROM /P /B /N /C” >> AUTORUN.BAT
- Make note of any commands in the original flash.bat that rename files. The .iso file is a read-only file system, so rename commands will subsequently fail. Instead, we can rename afudos.smc to afudos.exe outside of the boot environment.
- # mv afudos.smc afudos.exe
- Note that DOS is not case-sensitive, so “afudos.exe” is the same as “AFUDOS.EXE” for the purpose of batch scripts.
- For a LSI MegaRAID firmware, copy over the following files:
- # cp <DOS MegaCli path>/MegaCli.exe /FDOEMCD/CDROOT/
- # cp <firmware update path>/mr2208fw.rom /FDOEMCD/CDROOT/
- If the system contains only a single RAID controller, then you can auto flash all detected controllers in the system by adding the command to AUTORUN.BAT:
- # cd /FDOEMCD/CDROOT
- # echo “MegaCli -adpfwflash -f mr2208fw.rom aALL” >> AUTORUN.BAT
- If there are multiple LSI controllers in a system, do not set AUTORUN.BAT to auto flash firmware. Instead, provide a blank AUTORUN.BAT and manually instruct the customer on how to update firmware with the adpfwflash command.
- From DOS, list detected controllers in the system:
- C:\ MegaCli -adpCount
- Flash firmware to a single controller:
- C:\ MegaCli -adpfwflash -f mr2208fw.rom -aN
- For IPMI firmware, copy over the following files:
- # cp <firmware update path>/RKCSFlsh.exe /FDOEMCD/CDROOT/
- # cp <firmware update path>/<firmware>.ima /FDOEMCD/CDROOT/
- Add a command to auto flash the IPMI firmware on boot:
- # cd /FDOEMCD/CDROOT
- # echo “RKCSFlsh.exe <firmware.ima>” >> AUTORUN.BAT
4. Once you've copied over the necessary files and edited your autorun batch file, note that this script must use DOS newlines, so if you added new lines to AUTORUN.BAT you need to convert the script from UNIX to DOS.
- # unix2dos AUTORUN.BAT
5. Navigate up one directory to FDOEMCD and create your .iso file.
- # cd ..
- # mkisofs -o fdoem.iso -p "Silicon Mechanics Support" -publisher "www.siliconmechanics.com" -V "SiMech OEM CD" -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -N -J -r -c boot.catalog -hide boot.catalog -hide-joliet boot.catalog CDROOT
6. The finished file will be named as fdoem.iso in the FDOEMCD directory.
You can then upload to Google Drive, FTP, or, depending on the size of the file, attach directly to an email for the customer.
- In all cases where modifications are made to the AUTORUN.BAT file, a MOTD has been provided by default in the AUTORUN.BAT. Do not remove this for customer-facing BIOS and firmware update .iso files.
- If your distribution does not have a mkisofs installation candidate (such as Debian Wheezy), you can substitute the exact command parameters with genisoimage.
- For the expertly lazy, you can also link genisoimage directly to mkisofs, and this will also enable compatibility with other legacy .iso creation utilities:
- # ln -s /usr/bin/genisoimage /usr/bin/mkisofs