Skip to content

Instantly share code, notes, and snippets.

@riptidewave93
Last active August 1, 2020 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save riptidewave93/04406fb2c6b4961a602b381991baebc1 to your computer and use it in GitHub Desktop.
Save riptidewave93/04406fb2c6b4961a602b381991baebc1 to your computer and use it in GitHub Desktop.
Coreboot Build instructions for the PCEngines APU2 board
# Setup ENV
apt-get update
apt-get upgrade -y
cd /opt
mkdir apu2-docker && cd apu2-docker
# Make docker base img
wget https://raw.githubusercontent.com/pcengines/apu2-documentation/master/Dockerfile
docker build -t pc-engines/apu2b .
# Download the things
git clone -b apu2b-20160304 https://github.com/pcengines/coreboot.git
git clone https://github.com/pcengines/ipxe.git
git clone https://github.com/pcengines/sortbootorder.git coreboot/payloads/pcengines/sortbootorder
git clone https://github.com/pcengines/memtest86plus.git -b apu2 coreboot/payloads/external/memtest86plus
# Start Docker
docker run -v ${PWD}/coreboot:/coreboot -v ${PWD}/ipxe:/ipxe -t -i pc-engines/apu2b
# Make Coreboot
cd /coreboot
cp configs/pcengines.apu2.20160304.config .config
make crossgcc-i386
cp configs/pcengines.apu2.20160304.config .config
make
cd /
# Make iPXE
cd /ipxe
wget https://raw.githubusercontent.com/pcengines/apu2-documentation/master/ipxe/general.h -O src/config/local/general.h
wget https://raw.githubusercontent.com/pcengines/apu2-documentation/master/ipxe/shell.ipxe -O src/shell.ipxe
cd ./src
make bin/8086157b.rom EMBED=./shell.ipxe
cd /
# Make SortBootLoader
cd ./coreboot/payloads/libpayload
make defconfig
make
make install
cd ../pcengines/sortbootorder
make
cd /
# Make memtest
cd ./coreboot/payloads/external/memtest86plus
make
# Add new modules to coreboot
cd /coreboot
./build/cbfstool ./build/coreboot.rom add -f /ipxe/src/bin/8086157b.rom -n genroms/pxe.rom -t raw
./build/cbfstool ./build/coreboot.rom remove -n img/setup
./build/cbfstool ./build/coreboot.rom add-payload -f payloads/pcengines/sortbootorder/sortbootorder.elf -n img/setup -t payload
./build/cbfstool ./build/coreboot.rom remove -n img/memtest
./build/cbfstool ./build/coreboot.rom add-payload -f payloads/external/memtest86plus/memtest -n img/memtest - payload
# We done
exit
# At this point, your new BIOS is found at /opt/apu2-docker/coreboot/build/coreboot.rom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment