Flashing your BIOS from Linux with flashrom

Sometimes in Linux things are easier than you think. I needed to upgrade the BIOS of a Linux machine and I was not optimistic. On top of the usual issue—what to do in Linux with the Windows executables that motherboard manufacturers provide—, the machine did not have a CD-ROM drive or a floppy drive.

But then we have search engines. A quick search led me to a promising howto by Uwe Hermann. There I learned about flashrom.

flashrom, to quote its man page,

is a utility for detecting, reading, writing, verifying and erasing flash chips. It’s often used to flash BIOS/EFI/coreboot/firmware images in-system using a supported mainboard, but it also supports flashing of network cards (NICs), SATA controller cards, and other external devices which can program flash chips.

It supports a wide range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32, TSOP40, and TSOP48 chips, which use various protocols such as LPC, FWH, parallel flash, or SPI.

Intriguing stuff, especially the “in-system” bit. More so for someone lazy like me. I had to try it!

Here is what it took...

The latest BIOS update I had downloaded from the manufacturer’s website was a self-extracting Windows executable. I extracted it manually with 7zr:

$ 7zr e motherboard-bios-ga-k8vt800(rev1.x)-f13.exe

The extraction revealed three files: One EXE and one BAT (which are not needed in Linux) and the BIOS image I needed for the operation: k8vt800.f13.

Next I installed flashrom using the package manager of the system:

$ sudo apt-get install flashrom

And I run flashrom to see what it knew about my hardware:

$ sudo flashrom

It seemed to recognize everything correctly. So, I proceeded to the next step, making a backup copy of the current BIOS image:

$ sudo flashrom --read bios.bak

Lastly, I flashed the BIOS with the image from the motherboard manufacturer:

$ sudo flashrom --write k8vt800.f13

The last step, writing and verifying the new image, took a few seconds and was completed successfully.

I was left with a big smile and with admiration and gratitude for the people who make flashrom.

Learn more about flashrom: flashrom.org

WARNING. An unsuccessful flashing operation with flashrom or with any other flashing method can leave your system inoperable. Don’t try this in a critical system unless you know what you are doing!

Thank you for reading.

Write a comment

Your email address will not be published. Required fields are marked *