Logo

flashrom 

flashrom

flashrom is Linux program which, as the name implies, has been written to read/write the plethora of BIOS chips fitted to PCs. It isn't included in Tiny Core Linux (my preferred Linux distribution for Thin Clients) and so I have to compile it from source.

Back in July 2019 I had problems trying to get flashrom to run fully under Tiny Core 10. Using the 'internal' programmer option resulted in the program hanging as it started to probe for the BIOS flash chip. As a result I looked for an alternative solution and a discovered a cheap hardware programmer (the CH341A) that could also be used with flashrom.

However, since then, I have discovered (or was reminded) that my earlier build of flashrom under Tiny Core 8.2.1 worked perfectly and so have updated these pages. You may also find that flashrom works perfectly from your own preferred Linux distribution.

Anyway, I've left in the description of the hardware programmer as it's the only way you can recover if you have accidentally 'hosed' the BIOS chip by programming it with an incompatible BIOS.

Preparing the Pen Drive

Which ever approach you are taking you need to create a bootable pen drive with the flashrom tool on it together with the BIOS image file.

In outline:

  1. Create a bootable USB pen drive with Tiny Core 8.2.1 on it using a tool such as the LiLi USB Creator.
  2. Copy the flashrom binary to the pen drive (I just copied it to the root directory).
  3. Boot from the pen drive and use the App Browser to add the libraries: pci-utils.tcz, usbutils.tcz, and dmidecode.tcz.
  4. Clearly label the pen drive as 'flashrom', 'bios programmer ' or whatever.

Finally add the BIOS image you wish to program (eg D10G_bios.bin). As this tool should work on many Thin Clients you might like to create subdirectories to identify the machine they are for.

For Tiny Core 8.2.1 you can download the flashrom binary here, and the Tiny Core distribution from the archive here.

Running flashrom (internal programmer)

Once you've booted from the pen drive on the thin client, move to the root directory on the pen drive.

cd /mnt/sdb1

NB adjust the drive as necessary. If you've got a single flash drive in the thin client then the pen drive will appear as /dev/sdb.

Check everything is ok by making a copy of the existing BIOS:

sudo ./flashrom -c "MX25L1605A/MX25L1606E/MX25L1608E" -p internal:laptop=this_is_not_a_laptop -r OldBios.bin

NB: The -c parameter is the one for the Wyse D class and Wyse Z class Thin Clients. It may well be different if you're using this approach on another thin client.

To write the BIOS use:

sudo ./flashrom -c "MX25L1605A/MX25L1606E/MX25L1608E" -p internal:laptop=this_is_not_a_laptop -w D10G_bios.bin

Running flashrom (external programmer)

This is almost the same as using the internal programmer:

To make a copy of the existing BIOS:

tc@tinman:~/ch341a$ sudo ./flashrom -p ch341a_spi -c "MX25L1605A/MX25L1606E/MX25L1608E" -r OldBios.bin

or to write the new BIOS (D10G_bios.bin):

tc@tinman:~/ch341a$ sudo ./flashrom -pr ch341a_spi -c "MX25L1605A/MX25L1606E/MX25L1608E" -w D10G_bios.bin

Details of how you connect the programmer to the BIOS chip and use it are covered under the CH341A tab, and the Programming tab.

flashrom Parameters

Taking the elements in turn:

sudo    It should be run as root.
-p ch341a_spi    Tell it to use the external CH341A programmer.
-p internal:laptop=this_is_not_a_laptop    Tell it to use the internal programmer.
-c "MX25L1605A/MX25L1606E/MX25L1608E"    Specify the BIOS chip type.
-r old_bios.bin    To read the chip contents out to the specified file.
-w D10G_bios.bin    To write the specified file to the BIOS chip.

Notes:

  1. The ':laptop=this_is_not_a_laptop' parameter to the 'internal' programmer selection. The architecture of the Wyse thin client is such that flashrom thinks it is a laptop. There are issues with the non-standard approach taken by some laptops that can lead to problems (and 'bricked' devices). Therefore the default is for flashrom to stop and complain. The :laptop=... parameter is the override that tells it to proceed anyway.
  2. It is a pain typing in the BIOS chip type every time, so I use a one-liner shell script to make life easier.

 


Any comments? email me. Added July 2019    Last update October 2019