Libreboot
General steps to download and prepare Libreboot. See sections for specific hardware hints.
first steps
Supposing to start with a fresh debian based os, git is the first software required to checkout the repo. Then the ./mk utility has an option to install all the build dependencies.
sudo apt install git
git config --global user.name my-name
git config --global user.email my-email
git clone https://codeberg.org/libreboot/lbmk.git
cd lbmk
sudo ./mk dependencies debian
speed up the build time
export XBMK_THREADS=4 or the number of cores of the system in use.
flashprog
./mk -b flashprog this will install flashprog, used to read and write from the bios chip.
build phase
./mk -b coreboot my-chip where my-chip is the name of the system, as listed with ./mk -b coreboot list
INTERNAL flash
read and backup the vendor bios
From the directory containing ./lbmk:
./lbmk/elf/flashprog -p internal -r bios-1.rom
./lbmk/elf/flashprog -p internal -r bios-2.rom
diff bios-*
write the libreboot firmware
no output means the 2 readings are equal, so likely it’s a good backup. Delete one of them.
./lbmk/elf/flashprog -p internal -w lbmk/bin/the-system-built-dir/choose-one.rom
where of course it has to be the right system and the right name.
EXTERNAL flash
I only did this with a Raspberry Pi pico H, the H is for the pins are already soldered. Libreboot can compile and prepare all that’s needed for the pico to use it for external flashing.
./mk -b pico-serprog this will build the software to be flashed in the pico.
Then hold down the button on the pico and plug the cable, so it will be mounted as external storage. Copy there the serprog_pico.uf2, or the right file depending on the device, inside the mounted folder. It will auto-disconnect.
Then find the device as a flashing peripheral with sudo dmesg -wH and connect the pico, it will show as ttyACM*, this will be used for external flashing.
Connect the pico prepared with wiring as described on the Libreboot website and read with ./lbmk/elf/flashprog -p serprog:dev=/dev/ttyACM0,spispeed=16M -r bios-1.rom then read 2 times and diff, as done before. If serprog finds more than one chip model, specify the right one with -c "CHIPMODEL" before the r option. Read the chip model from the list and verify by reading it directlu on the chip I guess, or in a specs document of the board.
Finally write the firmware with the -w option.