site: fix the GNU Boot build instructions.
The reference to lbmk was removed because there is no lbmk script in
GNU Boot.
The python section was removed as this is already taken care of by the
combination of the dependencies installation scripts and the
recommendation of specific distributions to build GNU Boot. Untested
distributions were also removed.
As for the removal of x-toc-enable, we had issues when having both
x-toc-enable and x-reviewed on the same page in the past. This is
documented in the commit adc578ae49
("site: license.md: fix x-reviewed"). So to make sure to avoid similar
issue we preemptively remove x-toc-enable.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
This commit is contained in:
parent
f431e5a164
commit
88d3ad4765
|
@ -1,35 +1,57 @@
|
||||||
---
|
---
|
||||||
title: Build from source
|
title: Build GNU Boot binaries
|
||||||
x-toc-enable: true
|
x-reviewed: true
|
||||||
...
|
...
|
||||||
|
|
||||||
Libreboot's build system is named `lbmk`, short for `Libreboot Make`, and this
|
This guide documents how to compile GNU Boot binaries from the
|
||||||
document describes how to use it. With this guide, you can know how to compile
|
available source code.
|
||||||
Libreboot from the available source code.
|
|
||||||
This version, if hosted live on libreboot.srht.site, assumes that you are using
|
|
||||||
the `lbmk` git repository, which
|
|
||||||
you can download using the instructions on [the code review page](../../git.md).
|
|
||||||
|
|
||||||
If you're using a release archive of Libreboot, please refer to the
|
At the time of writing users wanting to build binaries need to
|
||||||
documentation included with *that* release. Libreboot releases are only intended
|
download the [https://git.savannah.gnu.org/cgit/gnuboot.git/ GNU Boot
|
||||||
as *snapshots*, not for development. For proper development, you should always
|
source code] with git.
|
||||||
be working directly in the Libreboot git repository.
|
|
||||||
|
|
||||||
The following document describes how `lbmk` works, and how you can make changes
|
Supported distributions for building GNU Boot binaries:
|
||||||
to it: [Libreboot maintenance manual](../maintain/)
|
=======================================================
|
||||||
|
|
||||||
|
GNU Boot is currently based on the latest version of Libreboot that
|
||||||
|
doesn't ship nonfree software, and it also uses an older version of
|
||||||
|
Coreboot to support certain computers that are not supported anymore
|
||||||
|
in Coreboot. Because of that the versions of various software that GNU
|
||||||
|
Boot builds are old and cannot be built anymore on recent
|
||||||
|
distributions.
|
||||||
|
|
||||||
|
While there is work to fix that by both updating that software to more
|
||||||
|
recent versions and to also also allow to build older versions on
|
||||||
|
newer distributions, in the meantime we need to workaround this issue
|
||||||
|
by using specific distributions to build GNU Boot.
|
||||||
|
|
||||||
|
People managed to build GNU Boot with the following distributions:
|
||||||
|
|
||||||
|
* PureOS 10 (byzantium)
|
||||||
|
|
||||||
|
* Trisquel 10 (nabia)
|
||||||
|
|
||||||
|
And these cannot build GNU Boot yet:
|
||||||
|
|
||||||
|
* Trisquel 11 (aramo): The issue is documented in the [Bug
|
||||||
|
#64870](https://savannah.gnu.org/bugs/?64870).
|
||||||
|
|
||||||
|
* Guix: Guix doesn't have any ADA compiler and that is needed for
|
||||||
|
building Coreboot for certain computers.
|
||||||
|
|
||||||
Git
|
Git
|
||||||
===
|
===
|
||||||
|
|
||||||
Libreboot's build system uses Git, extensively. You should perform the steps
|
GNU Boot build system still has some fragile scripts for building some
|
||||||
below, *even if you're using a release archive*.
|
of the projects like Coreboot.
|
||||||
|
|
||||||
Before you use the build system, please know: the build system itself uses
|
Because of that you need to configure git even if you only want to
|
||||||
Git extensively, when downloading software like coreboot and patching it.
|
build build a binary without modifying anything because the GNU Boot
|
||||||
|
build system uses git directly when applying patches to the software
|
||||||
You should make sure to initialize your Git properly, before you begin or else
|
it builds, and git expects some configuration to be present when
|
||||||
the build system will not work properly. Do this:
|
applying patches.
|
||||||
|
|
||||||
|
To fix that you need to set a valid username and email:
|
||||||
git config --global user.name "John Doe"
|
git config --global user.name "John Doe"
|
||||||
git config --global user.email johndoe@example.com
|
git config --global user.email johndoe@example.com
|
||||||
|
|
||||||
|
@ -38,56 +60,39 @@ Change the name and email address to whatever you want, when doing this.
|
||||||
You may also want to follow more of the steps here:
|
You may also want to follow more of the steps here:
|
||||||
<https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>
|
<https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>
|
||||||
|
|
||||||
Python
|
Building GNU Boot binaries
|
||||||
======
|
==========================
|
||||||
|
|
||||||
Python 2 *and* 3 are used by different parts of the build system, not directly
|
GNU Boot includes a file called `Makefile` that you can use . This
|
||||||
but because certain projects Libreboot depends upon uses it.
|
Makefile calls some scripts like download or build that are in the
|
||||||
|
same directory, that you can also also use directly if you want.
|
||||||
|
|
||||||
You should have this configuration on your OS:
|
The `Makefile` is much more simple to use but offers less flexibility
|
||||||
|
(for instance there is a single command to build all images but no way
|
||||||
|
to build an image for a specific computer).
|
||||||
|
|
||||||
python
|
To build GNU Boot you must first ensure that all build dependencies
|
||||||
|
are installed.
|
||||||
|
|
||||||
python2
|
If you are running Trisquel 10 (nabia) you can run the following
|
||||||
|
command as it takes care of installing all the required dependencies
|
||||||
python3
|
for you:
|
||||||
|
|
||||||
Running `python` should give you python 3.x.
|
|
||||||
|
|
||||||
Running `python2` should give you python 2.x.
|
|
||||||
|
|
||||||
Running `python3` should give you python 3.x.
|
|
||||||
|
|
||||||
Therefore, you should install both python2 and python3 in your distro.
|
|
||||||
|
|
||||||
GNU Make
|
|
||||||
========
|
|
||||||
|
|
||||||
Libreboot Make includes a file called `Makefile`. You can still use
|
|
||||||
the `lbmk` build system directly, or you can use GNU Make. The `Makefile`
|
|
||||||
simply runs `lbmk` commands. However, using `lbmk` directly will offer you
|
|
||||||
much more flexibility; for example, the Makefile currently cannot build single
|
|
||||||
ROM images (it just builds all of them, for all boards).
|
|
||||||
|
|
||||||
You must ensure that all build dependencies are installed. If you're running
|
|
||||||
Ubuntu or similar distribution (Debian, Trisquel, etc) you can do this:
|
|
||||||
|
|
||||||
sudo make install-dependencies-ubuntu
|
sudo make install-dependencies-ubuntu
|
||||||
|
|
||||||
One exists specifically for Debian:
|
If instead you use PureOS 10 (byzantium) you can use the following
|
||||||
|
command instead:
|
||||||
|
|
||||||
sudo make install-dependencies-debian
|
sudo make install-dependencies-debian
|
||||||
|
|
||||||
Another exists for Arch:
|
When this is done you can build all the GNU Boot images with the
|
||||||
|
following command (this uses the Makefile):
|
||||||
sudo make install-dependencies-arch
|
|
||||||
|
|
||||||
Now, simply build the coreboot images like so:
|
|
||||||
|
|
||||||
make
|
make
|
||||||
|
|
||||||
This single command will build ROM images for *every* board integrated in
|
This single command will build ROM images for *every* computer
|
||||||
Libreboot. If you only wish to build a limited set, you can use `lbmk` directly:
|
supported by GNU Boot. If you only wish to build a limited set, you
|
||||||
|
can use the build script directly:
|
||||||
|
|
||||||
./build boot roms x200_8mb
|
./build boot roms x200_8mb
|
||||||
|
|
||||||
|
@ -97,9 +102,10 @@ You can specify more than one argument:
|
||||||
|
|
||||||
ROM images appear under the newly created `bin/` directory in the build system.
|
ROM images appear under the newly created `bin/` directory in the build system.
|
||||||
|
|
||||||
For other commands, simply read the `Makefile` in your favourite text editor.
|
For other commands, simply read the `Makefile` in your favourite text
|
||||||
The `Makefile` is simple, because it merely runs `lbmk` commands, so it's very
|
editor. The `Makefile` is simple, because each commands run a simple
|
||||||
easy to know what commands are available by simply reading it.
|
script, so it's very easy to know what commands are available by
|
||||||
|
simply reading it.
|
||||||
|
|
||||||
Standard `clean` command available (cleans all modules except `crossgcc`):
|
Standard `clean` command available (cleans all modules except `crossgcc`):
|
||||||
|
|
||||||
|
@ -119,32 +125,23 @@ Build without using GNU Make
|
||||||
The `Makefile` is included just for *compatibility*, so that someone who
|
The `Makefile` is included just for *compatibility*, so that someone who
|
||||||
instictively types `make` will get a result.
|
instictively types `make` will get a result.
|
||||||
|
|
||||||
Actual development/testing is always done using `lbmk` directly, and this
|
Actual development/testing is always done using the build, download,
|
||||||
includes when building from source. Here are some instructions to get you
|
update or modify scripts directly, and this includes when building
|
||||||
started:
|
from source. Here are some instructions to get you started:
|
||||||
|
|
||||||
First, install build dependencies
|
First, install build dependencies
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
Libreboot includes a script that automatically installs apt-get dependencies
|
GNU Boot includes a script that automatically installs dependencies in
|
||||||
in Ubuntu 20.04. It works well in other apt-get distros (such as Trisquel and
|
Trisquel 10 (nabia):
|
||||||
Debian):
|
|
||||||
|
|
||||||
sudo ./build dependencies ubuntu2004
|
sudo ./build dependencies ubuntu2004
|
||||||
|
|
||||||
Separate scripts also exist:
|
and for PureOS 10 (byzantium):
|
||||||
|
|
||||||
sudo ./build dependencies debian
|
sudo ./build dependencies debian
|
||||||
|
|
||||||
sudo ./build dependencies arch
|
The build script automatically runs all necessary commands; for example
|
||||||
|
|
||||||
sudo ./build dependencies void
|
|
||||||
|
|
||||||
Technically, any GNU+Linux distribution can be used to build Libreboot.
|
|
||||||
However, you will have to write your own script for installing build
|
|
||||||
dependencies.
|
|
||||||
|
|
||||||
Libreboot Make (lbmk) automatically runs all necessary commands; for example
|
|
||||||
`./build payload grub` will automatically run `./build module grub` if the
|
`./build payload grub` will automatically run `./build module grub` if the
|
||||||
required utilities for GRUB are not built, to produce payloads.
|
required utilities for GRUB are not built, to produce payloads.
|
||||||
|
|
||||||
|
@ -166,7 +163,7 @@ If you wish to build payloads, you can also do that. For example:
|
||||||
Previous steps will be performed automatically. However, you can *still* run
|
Previous steps will be performed automatically. However, you can *still* run
|
||||||
individual parts of the build system manually, if you choose. This may be
|
individual parts of the build system manually, if you choose. This may be
|
||||||
beneficial when you're making changes, and you wish to test a specific part of
|
beneficial when you're making changes, and you wish to test a specific part of
|
||||||
lbmk.
|
GNU Boot.
|
||||||
|
|
||||||
Therefore, if you only want to build ROM images, just do the above. Otherwise,
|
Therefore, if you only want to build ROM images, just do the above. Otherwise,
|
||||||
please continue reading!
|
please continue reading!
|
||||||
|
@ -175,17 +172,14 @@ Second, download all of the required software components
|
||||||
--------------------------------------------------------
|
--------------------------------------------------------
|
||||||
|
|
||||||
If you didn't simply run `./build boot roms` (with or without extra
|
If you didn't simply run `./build boot roms` (with or without extra
|
||||||
arguments), you can still perform the rest of the build process manually. Read
|
arguments), you can still perform the rest of the build process
|
||||||
on! You can read about all available scripts in `lbmk` by reading
|
manually.
|
||||||
the [Libreboot maintenance manual](../maintain/); lbmk is designed to be modular
|
|
||||||
which means that each script *can* be used on its own (if that's not true, for
|
|
||||||
any script, it's a bug that should be fixed).
|
|
||||||
|
|
||||||
It's as simple as that:
|
It's as simple as that:
|
||||||
|
|
||||||
./download all
|
./download all
|
||||||
|
|
||||||
The above command downloads all modules defined in the Libreboot build system.
|
The above command downloads all modules defined in the GNU Boot build system.
|
||||||
However, you can download modules individually.
|
However, you can download modules individually.
|
||||||
|
|
||||||
This command shows you the list of available modules:
|
This command shows you the list of available modules:
|
||||||
|
@ -269,8 +263,8 @@ Run this command:
|
||||||
|
|
||||||
./build boot roms
|
./build boot roms
|
||||||
|
|
||||||
Each board has its own configuration in `lbmk` under `resources/coreboot/`
|
Each board has its own configuration under `resources/coreboot/` which
|
||||||
which specifies which payloads are supported.
|
specifies which payloads are supported.
|
||||||
|
|
||||||
By default, all ROM images are built, for all boards. If you wish to build just
|
By default, all ROM images are built, for all boards. If you wish to build just
|
||||||
a specific board, you can specify the board name based on the directory name
|
a specific board, you can specify the board name based on the directory name
|
||||||
|
@ -284,3 +278,10 @@ under `resources/coreboot/` in the build system.
|
||||||
That's it!
|
That's it!
|
||||||
|
|
||||||
If all went well, ROM images should be available to you under bin/
|
If all went well, ROM images should be available to you under bin/
|
||||||
|
|
||||||
|
See also:
|
||||||
|
=========
|
||||||
|
|
||||||
|
If you want to contribute to the website instead, see the
|
||||||
|
[website-build/README](https://git.savannah.gnu.org/cgit/gnuboot.git/tree/website-build/README)
|
||||||
|
in the source code of GNU Boot.
|
||||||
|
|
Loading…
Reference in New Issue