Libreboot on an X230
Posted: 07 Jan 2024
Wordcount: 384 words (~2 minute read)
This post is a simple guide on how I “Librebooted” my Lenovo Thinkpad X230. I struggled to find instructions which detailed the entire process for a beginner who has never used tools such as flashrom before. The examples I have given here are based on what I did personally. Whilst these are the exact steps I took, for you there may be other or completely different steps so please reference the documentation before carrying out any steps listed here.
If you are unsure of what size rom you require, you can find this out by reading the data from each chip and checking the resulting files.
In my case I used a Raspberry Pi 3 Model B, a Pomona SOIC Clip 8 Pin, and a minimum of 6 female jumper wires.
Before starting remember to remove the laptop’s battery. Some guides state that you should also disconnect the CMOS battery however I didn’t. When connecting and disconnecting the SOIC clip, ensure that the Pi is not connected to power to avoid damaging the chip.
Preparing the rom
- Download Libreboot’s build system.
git clone https://codeberg.org/libreboot/lbmk
- Download the rom from Libreboot.
stable > 20230625 (or the latest folder for you) > roms > libreboot-20230625_x230_12mb.tar.xz
Extract the downloaded tar archive. Inside bin > x230_12mb pick the correct rom for your keyboard layout and whether you want to use GRUB or SeaBIOS.
Run the below command from inside the lbmk directory and point it to the rom you chose above. Put your devices MAC address after the -m switch as shown. Mine was printed on a sticker located inside the machine.
./vendor inject -r grub_x230_12mb_libgfxinit_corebootfb_ukqwerty.rom -b x230_12mb -m 00:f6:f0:40:71:fd
- Split the rom for flashing onto the two chips.
dd if=grub_x230_12mb_libgfxinit_corebootfb_ukqwerty.rom of=top.rom bs=1M skip=8
dd if=grub_x230_12mb_libgfxinit_corebootfb_ukqwerty.rom of=bottom.rom bs=1M count=8
- Read the top chip 2 or 3 times into seperate files and compare the outcome using diff. This ensures that the data recieved has no discrepancies.
sudo flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=32768 -r factory_bios_top_01.rom -c "MX25L3206E/MX25L3208E" -V
- Read bottom chip 2 or 3 times and again compare the outcome.
sudo flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=32768 -r factory_bios_bottom_01.rom -c "MX25L6406E/MX25L6408E" -V
- Flash the top chip.
sudo flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=32768 -w top.rom -c "MX25L3206E/MX25L3208E" -V
- Flash the bottom chip.
sudo flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=32768 -w bottom.rom -c "MX25L6406E/MX25L6408E" -V
Libreboot, Skulls, thinkpad-ec, and Harmonic Flow.