BIOS update by extracting HD image from ISO

Thursday, January 14. 2010, 21:16
Today I faced an interesting Linux problem that made me learn a couple of things I'd like to share. At first, we found an issue on a Thinkpad X301 notebook that was fixed in a newer BIOS version. So we wanted to do a BIOS update. Lenovo provides BIOS updates either for Windows or as bootable ISO CD-images. But the device had no CD-drive and only Linux installed. First we tried unetbootin, a tool to create bootable USB sticks out of ISO-Images. That didn't work.
So I had a deeper look at the ISO. What puzzled me was that when mounting it as a loopback device, there were no files on it. After some research I learned that there are different ways to create bootable CDs and one of them is the El Torito extension. It places an image of a harddisk on the CD, when booting, the image is loaded into memory and an OS can be executed (this probably only works for quite simple OSes like DOS, the Lenovo BIOS Upgrade disk is based on PC-DOS). There's a small PERL-script called geteltorito that is able to extract such images from ISO files.
It's possible to boot such harddisk images with grub and memdisk (part of syslinux). Install syslinux, place the file memdisk into /boot (found in /usr/lib/syslinux/ or /usr/share/syslinux/) and add something like this to your grub config:
title HD Image
root (hd0,0)
kernel /boot/memdisk
initrd /boot/image.img

Or for grub2:
menuentry "HD Image" {
set root=(hd0,2)
linux16 /boot/memdisk
initrd16 /boot/hdimage.img
}

Now you can select bios update in your boot menu and it should boot the BIOS upgrade utility.

(Note that this does not work for all Lenovo BIOS updates, only for those using an El Torito harddisk image - you can mount your iso with mount -o loop [path_to_iso] [mount_path] to check, if there are any files, this method is not for you)

Trackbacks

No Trackbacks

Comments
Display comments as (Linear | Threaded)

Hi Hanno,

in order to get the BIOS updated, you don't even have to extract anything from the iso.
You can use the "raw" parameter for memdisk and boot the whole iso files.
I did some BIOS updates on my ThinkPad this way and it has always worked fine.
#1 thomasg on 2010-01-15 01:44 (Reply)
You can also use memdisk with LILO... a snip from my lilo.conf that uses freedos for BIOS updates

image=/boot/dos/memdisk
label=dos
initrd=/boot/dos/FDOEM.144
#2 saellaven on 2010-01-15 07:49 (Reply)
It might not be the best idea for notebook, but I used it to update BIOS on a cuple of motherboards without a problem...
#3 How about using flashrom ? on 2010-01-15 10:38 (Reply)
Hi,
you can use freedos on a USB stick with BIOS downloaded to boot on USB and update the BIOS
see you
Loux
#4 Loux on 2010-01-16 13:54 (Reply)
If you can get at the raw BIOS image, you can use flashrom (http://www.flashrom.org/Flashrom) and you don't even need to reboot.
#5 dolphinling (Link) on 2010-01-16 14:14 (Reply)
Add any discoveries to http://www.thinkwiki.org/wiki/BIOS_Upgrade please.
#6 jidanni (Link) on 2010-01-20 07:21 (Reply)

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.