Valid HTML 4.01 Transitional
Prev: Windows Vista Service Pack Won't Install Next: Will Not Wake from Suspend to RAM or Disc
(Index)
Jim Carter's Bugfixes

Flash your BIOS from Linux

James F. Carter
2010-11-14
Symptom:

The vendor of your Linux box has a new BIOS version, or you suspect bit-rot in your BIOS, so you want to (re)install it. How can this be done without access to Microsoft Windows?

What's going on:

Normal vendors such as Dell are Windows-centric, and they provide the BIOS as a MS-DOS EXE file, including a flasher program with the payload attached. This of course is useless on Linux unless you do some major gyrations.

How to fix:

Do this on a machine having a CD burner.

Failed Approaches

The project to flash the BIOS had an unusually large number of blind alleys. Here's a list:

Dell's smbios-utils package

This RPM package and its various dependencies are normally very helpful on a Dell Intel box, but /usr/sbin/dellBiosUpdate (in smbios-utils-python) ultimately did not work out. See these links for documentation:

To extract the HDR file (payload) from the flasher EXE program, you need these packages from the above repository:

  • firmware-tools
  • firmware-extract
  • firmware-addon-dell
  • smbios-utils

How to use: see this posting. Assuming we're working with DM061-020400.EXE:

  • firmwaretool --extract --help #to review the options
  • firmwaretool --update --help
  • firmwaretool --extract --initdb #Only the first time
  • firmwaretool --extract DM061-020400.EXE #Says: unprocessed: whatever.EXE
  • firmwaretool --inventory #Lists the above file
  • firmwaretool --update #It knows which is the lastest one

The only problem is, firmwaretool (version 2.1.13 and previous) refuses to flash the same BIOS version that's already on the machine.

WINE

Several forum postings suggested to install and run this Windows emulator, and also qemu, but I decided to try other approaches before attempting these solutions.

FreeDOS

This is the approach that eventually worked, but burning a bootable CD or creating a bootable USB stick was not easy. Plan B: Download the zip file from Sourceforge, unzip in a temp directory, copy everything from ./bin to the root of the USB stick. So where's the boot sector?

Jeremy Visser's Procedure

See this howto by Jeremy Visser. The resulting USB stick will boot, announce FreeDOS, and hang. Obviously it can't find the kernel, which was in the root directory. I never did figure out this one.

Bootable ISO (I)

Erik says: download a FreeDOS bootable ISO (burn disc) and install from there. I downloaded Balder, and burned using this command line:
cdrecord -v -dao -dummy dev=/dev/sr0 -waiti fs=4m gracetime=2 -useinfo driveropts=burnfree,noforcespeed -data -pad - < $J/balder10.img

Unfortunately the resulting disc was not mountable and not bootable. This image file is for use on a floppy or for floppy emulation on a CD using the El Torito standard.

Back to the USB stick.

I downloaded sys-freedos-linux, a PERL script. nasm is required, available from the SuSE Build Service. Here's the procedure:
mkdosfs -I /dev/sdb #Substitute device for USB stick
fdisk -l -u /dev/sdb #Just for paranoia
sys-freedos.pl --disk=/dev/sdb
mount /dev/sdb /mnt
cp freedos/bin/* /mnt
umount /mnt

Upon booting, the boot sector announced "Freedos" and proceeded to just sit there.

Bootable ISO with Brasero

Let's try to burn a bootable ISO using Brasero. Oops, Brasero can't make bootable images de novo, though it can burn premade bootable images.

Bootable ISO with K3B

Bob Nelson STCHMAN (dated 2009-2010) has a procedure.

  • Download and unzip his DOS boot image, obtaining DosBootimage.IMA. (A similar procedure should work with balder10.img that was downloaded previously.)

  • Start the burner program k3b, which is the normal one for a KDE desktop environment and apparently is also standard on Ubuntu.

  • Start a data project.

  • There is a button on the project pane for Make Bootable. Hit it; hit New, select the above IMA file. It will do the El Torito thing involving a folder called boot.

  • Also drop your flasher EXE file in the root of the project.

  • Burn it. Oops, k3b-1.68.0 provides a nonexistent file to genisoimage and things go downhill from there; the complaint is can't determine the size of the ISO image and it burns nothing. Fails equally with balder10.img.

Bootable ISO, Image Only

Finally I thought that in MS-DOS you can swap floppies at arbitrary times, so maybe you can do the same with CD's. That turned out to work. Procedure is at the start of this tale of woe.


Prev: Windows Vista Service Pack Won't Install Next: Will Not Wake from Suspend to RAM or Disc
(Index)