Coreboot: Difference between revisions

From NixOS Wiki
imported>Milahu
fix nix-shell, use shallow clone
imported>Milahu
add gnat = gnu ada compiler
Line 5: Line 5:
$ git clone https://review.coreboot.org/coreboot.git --depth 1
$ git clone https://review.coreboot.org/coreboot.git --depth 1
$ cd coreboot
$ cd coreboot
$ nix-shell -p ncurses bison flex clang zlib acpica-tools pkgconfig
$ nix-shell -p ncurses bison flex clang gnat10 zlib acpica-tools pkgconfig
$ NIX_LDFLAGS="$NIX_LDFLAGS -lncurses" make menuconfig
$ NIX_LDFLAGS="$NIX_LDFLAGS -lncurses" make menuconfig
$ make crossgcc
$ make crossgcc
$ make
$ make
</syntaxHighlight>
</syntaxHighlight>
=== Compiler version ===
<code>gcc</code> (provided by <code>clang</code>) and <code>gnat</code> (the GNU Ada compiler) must have the same version
<syntaxHighlight lang=console>
gcc --version
gnat --version
</syntaxHighlight>
For example, both should have version <code>10.3.0</code>


== Building as derivation ==
== 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 [https://github.com/blitz/nix-coreboot here].
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 [https://github.com/blitz/nix-coreboot here].

Revision as of 22:36, 25 October 2021

Building in nix-shell

To build your own coreboot bios:

$ git clone https://review.coreboot.org/coreboot.git --depth 1
$ cd coreboot
$ nix-shell -p ncurses bison flex clang gnat10 zlib acpica-tools pkgconfig
$ NIX_LDFLAGS="$NIX_LDFLAGS -lncurses" make menuconfig
$ make crossgcc
$ make

Compiler version

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

gcc --version
gnat --version

For example, both should 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.