How to Build Your Own Bootloader for Libre Computer Boards

Libre Computer boards feature open source bootloaders that can be built and customized quickly.

git clone https://github.com/libre-computer-project/libretech-builder-simple.git lbs
cd lbs
./setup.sh
./build.sh BOARD #replace BOARD with your model eg. aml-s905x-cc
1 Like

Note to self:

Do not build on aarch64, this happens

tools/bmp_logo --gen-info ./board/libre-computer/aml-a311d-cc/aml-a311d-cc.bmp > include/bmp_logo.h
Segmentation fault (core dumped)

Do not build in a docker container (even with –privileged), losetup and partprobe has issues with dynamic device files.

It works when building on AMD64 in KVM

curl -O u-boot.qcow2 https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-amd64.qcow2
qemu-img resize uboot.qcow2 8G
qemu-system-x86_64 -enable-kvm uboot.qcow2 -nographic -machine q35 -m 4096
# log in as "root"
apt update
apt install -y parted
# TODO add steps to resize the root partition
apt install -y git sudo
cd
git clone https://github.com/libre-computer-project/libretech-builder-simple.git lbs
cd lbs
./setup.sh
apt install -y fdisk dosfstools wget
# look in ./configs for board to build
./build.sh aml-a311d-cc-spi
# burn the out/aml-a311d-cc-spiflash to a flash drive, and then boot the flash drive on the SBC to update the bootloader on the SPI.

We will be moving to genimage for LBS soon which should resolve the losetup dependency.