Coreboot: Difference between revisions

From NixOS Wiki
imported>Milahu
+ CPUS=$(nproc)
imported>Milahu
+ qemu: test the new image
Line 9: Line 9:
du -sh . # 700 MByte
du -sh . # 700 MByte


nix-shell -p ncurses bison flex clang gnat10 gnatboot zlib acpica-tools pkgconfig
nix-shell -p ncurses bison flex clang gnat10 gnatboot zlib acpica-tools pkgconfig qemu
NIX_LDFLAGS="$NIX_LDFLAGS -lncurses" make menuconfig
NIX_LDFLAGS="$NIX_LDFLAGS -lncurses" make menuconfig
make crossgcc CPUS=$(nproc)
make crossgcc CPUS=$(nproc)
make
make
qemu-system-x86_64 -bios build/coreboot.rom -serial stdio
</syntaxHighlight>
</syntaxHighlight>


Line 36: Line 38:


* https://www.coreboot.org/Build_HOWTO
* https://www.coreboot.org/Build_HOWTO
* https://www.coreboot.org/Lesson1
* flashing the new bios image
** https://doc.coreboot.org/flash_tutorial/
** https://libreboot.org/docs/install/spi.html

Revision as of 08:48, 26 October 2021

Building in nix-shell

To build your own coreboot bios:

git clone https://review.coreboot.org/coreboot.git --depth 1
cd coreboot
du -sh . # 200 MByte
git submodule update --init --checkout --depth 1
du -sh . # 700 MByte

nix-shell -p ncurses bison flex clang gnat10 gnatboot zlib acpica-tools pkgconfig qemu
NIX_LDFLAGS="$NIX_LDFLAGS -lncurses" make menuconfig
make crossgcc CPUS=$(nproc)
make

qemu-system-x86_64 -bios build/coreboot.rom -serial stdio
  • gnat10 provides gnat
  • gnatboot provides gnat1

Compiler version

gcc (provided by clang) and gnat (the GNU Ada compiler) must have the same version

gcc --version
gnat --version

For example, both have version 10.3.0

Building as derivation

coreboot is pretty picky about the toolchain it is built with and thus using the toolchain it comes with is the easiest path to success. There are commented Nix expressions that build coreboot here.

See also