Librebooting a Thinkpad T440p
A Guide for Installing Libreboot on the Lenovo Thinkpad T440p
What is Libreboot?
Libreboot is a free and open-source replacement for proprietary UEFI/BIOS firmware—neutering invasive technologies like Intel ME in the process.
The project seeks to remove proprietary binary blobs included in firmware (required for key components to function)—providing a privacy-respecting alternative for users.
Libreboot is primarily geared towards enthusiasts—though it does have limited hardware support; however, many devices are now compatible.
Libreboot is a distribution of Coreboot—wherein all updates come from upstream Coreboot development.
Unlike Coreboot, Libreboot is designed to be completely free and open-source, including only essential CPU microcode updates.
For more details, visit here
Installation
Tools
You will need an EEPROM flash programmer.
OR a SOIC/SOP 8 test clip, eight female DuPont wires, and a compatible SBC (such as a Raspberry Pi w GPIO pins).
SOIC 8 Wiring
CH341A Wiring
For my installation, I used the CH341A programmer—though, this is not advised.
Software
Preferably, you will need a device with Linux installed; if you are using an SBC, install SSH for flashing.
Obtaining Build Files
1# Prerequisites
2sudo apt install -y git wget build-essential
3
4# Obtain Libreboot's build system
5git clone https://codeberg.org/libreboot/lbmk ~/lbmk
6cd ~/lbmk
7
8# Obtain Libreboot T440p image
9wget https://mirror.math.princeton.edu/pub/libreboot/stable/20241206/roms/libreboot-20241206rev10_t440plibremrc_12mb.tar.xz
Making the Libreboot Build System
1# Set available threads for faster compilation
2export XBMK_THREADS=12
3
4# Set your distro and build necessary dependencies
5sudo ./mk dependencies mint
6
7# Build flashprog
8./mk -b flashprog
9mv ~/lbmk/elf/flashprog/flashprog ../..
Preparing Images
1# Inject necessary vendor files
2./mk inject libreboot-20241206rev10_t440plibremrc_12mb.tar.xz
3
4# Unpack the injected image
5tar -xvf libreboot-20241206rev10_t440plibremrc_12mb.tar.xz
6
7# Split the top ROM (4MB)
8dd if=~/lbmk/bin/t440plibremrc_12mb/seagrub_t440plibremrc_12mb_libgfxinit_corebootfb_usqwerty.rom of=top.rom bs=1M skip=8
9
10# Split the bottom ROM (8MB)
11dd if=~/lbmk/bin/t440plibremrc_12mb/seagrub_t440plibremrc_12mb_libgfxinit_corebootfb_usqwerty.rom of=bot.rom bs=1M count=8
Disassembling the Laptop
Refer to this guide for disassembling the laptop; make sure both the main battery and CMOS battery are unplugged.
Backing Up Stock ROMs
Your setup will look different; my casing was fused together, so I had to improvise.
1# Backup top stock ROMs
2sudo ./flashprog --programmer ch341a_spi -c W25Q32FV -r top-stock-bk.rom
3sudo ./flashprog --programmer ch341a_spi -c W25Q32FV -r top-stock-bk2.rom
4
5# Backup bottom stock ROMs
6sudo ./flashprog --programmer ch341a_spi -c W25Q64BV/W25Q64CV/W25Q64FV -r bot-stock-bk.rom
7sudo ./flashprog --programmer ch341a_spi -c W25Q64BV/W25Q64CV/W25Q64FV -r bot-stock-bk2.rom
8
9# Verify ROMs were dumped correctly
10sha512sum top-stock* bot-stock*
Flashing Libreboot Images
1# Write the top ROM
2sudo ./flashprog --programmer ch341a_spi -c W25Q32FV -w ~/lbmk/top.rom
3
4# Write the bottom ROM
5sudo ./flashprog --programmer ch341a_spi -c W25Q64BV/W25Q64CV/W25Q64FV -w ~/lbmk/bot.rom
Reassemble the unit—and voilà! Your laptop now sports Libreboot!