2023-07-10 15:43:08 +00:00
|
|
|
---
|
|
|
|
title: Build from source
|
|
|
|
x-toc-enable: true
|
|
|
|
...
|
|
|
|
|
2024-12-31 21:43:01 +00:00
|
|
|
WARNING: eCryptfs file name limits
|
2024-12-31 20:27:34 +00:00
|
|
|
=================================
|
|
|
|
|
2024-12-31 21:43:01 +00:00
|
|
|
Do not run the build system on a eCryptfs file system, because it has
|
2024-12-31 20:27:34 +00:00
|
|
|
very short file name limits and Canoeboot's build system deals with very
|
|
|
|
long file names. We commonly get reports from this by Linux Mint users
|
2025-01-03 06:58:04 +00:00
|
|
|
who encrypt their home directory with eCryptfs; regular LUKS encryption will
|
|
|
|
do nicely.
|
2024-12-31 20:27:34 +00:00
|
|
|
|
2023-10-26 00:10:41 +00:00
|
|
|
Introduction
|
|
|
|
============
|
|
|
|
|
|
|
|
Canoeboot's build system is named `cbmk`, short for `CanoeBoot MaKe`, and this
|
2023-07-10 15:43:08 +00:00
|
|
|
document describes how to use it. With this guide, you can know how to compile
|
2023-10-26 00:10:41 +00:00
|
|
|
canoeboot from the available source code.
|
|
|
|
|
|
|
|
The following document describes how `cbmk` works, and how you can make changes
|
|
|
|
to it: [canoeboot maintenance manual](../maintain/)
|
|
|
|
|
2025-01-04 17:07:27 +00:00
|
|
|
System requirements
|
|
|
|
===================
|
|
|
|
|
2025-01-04 17:23:02 +00:00
|
|
|
You must ensure that you have the correct operating system, CPU, RAM, disk space
|
|
|
|
and so on.
|
2025-01-04 17:07:27 +00:00
|
|
|
|
2025-01-04 17:23:02 +00:00
|
|
|
System requirements are documented in
|
|
|
|
the [cbmk maintenance manual](../maintain/#system-requirements).
|
2025-01-04 17:07:27 +00:00
|
|
|
|
2024-05-27 23:08:08 +00:00
|
|
|
Multi-threaded builds
|
|
|
|
=====================
|
|
|
|
|
|
|
|
Canoeboot's build system defaults to a single build thread, but you can change
|
|
|
|
it by doing e.g.
|
|
|
|
|
|
|
|
export XBMK_THREADS=4
|
|
|
|
|
|
|
|
This would make cbmk run on 4 threads.
|
|
|
|
|
|
|
|
More specifically: when compiling source trees via `script/trees`, `-jTHREADS`
|
|
|
|
is passed, where THREADS is the number of threads. This is also set when running
|
|
|
|
xz commands for compression, using the `-t` option.
|
|
|
|
|
2024-05-01 04:53:28 +00:00
|
|
|
Environmental variables
|
|
|
|
=======================
|
|
|
|
|
|
|
|
Please read about environmental variables in [the build
|
extreme cleanup / grandiose gesture
make canoeboot a truly GNU FSDG compliant coreboot distro,
by removing all overly positive reference to Libreboot;
what remains is technical in nature, so as to provide
historical context since Canoeboot is a fork of Libreboot.
I've stated before that I wish to take a more neutral tone
toward the FSF, in contrast to the *coldboot war* of 2023
when GNU Boot started.
Canoeboot was heavily linking to Libreboot, even going so far
as to call itself "inferior" and tell the reader to use
Libreboot.
From now on, Canoeboot will be maintained as though I actually
believed in FSF propoganda. I don't, but its users do. Treat
them with respect. My reason for providing Canoeboot is
precisely that I wish for such people to have a high quality
coreboot distro, much unlike the inferior *GNU Boot* project;
inferior because to this day, it's still based on very old
Libreboot, with not much changed (of any real substance)
relative to the Libreboot 20220710 release on which it forked.
In general, I've also found a lot of stragglers from when
Canoeboot started, where paragraphs referred to Libreboot that
should have actually referred to Canoeboot, or paragraphs
with Libreboot-specific information that does not make sense
in the Canoeboot project e.g. references to vendor scripts.
The resulting canoeboot.org will now look no different to any
typical reader than a typical FSF-aligned project.
There is a next stage to this, which will become apparent to
everyone if I have my way.
Signed-off-by: Leah Rowe <info@minifree.org>
2024-05-10 02:12:44 +00:00
|
|
|
instructions](../maintain/), before running cbmk. You should set
|
2024-05-01 04:53:28 +00:00
|
|
|
your variables accordingly, though you do not technically need to; some
|
2025-01-01 16:53:19 +00:00
|
|
|
of them may be useful, e.g. `XBMK_THREADS` (sets the number of build threads).
|
2024-05-01 04:53:28 +00:00
|
|
|
|
2023-10-26 00:10:41 +00:00
|
|
|
Sources
|
|
|
|
=======
|
|
|
|
|
|
|
|
This version, if hosted live on canoeboot.org, assumes that you are using
|
|
|
|
the `cbmk` git repository, which
|
2023-07-10 15:43:08 +00:00
|
|
|
you can download using the instructions on [the code review page](../../git.md).
|
|
|
|
|
|
|
|
Git
|
|
|
|
===
|
|
|
|
|
2023-10-26 00:10:41 +00:00
|
|
|
Canoeboot's build system uses Git, extensively. You should perform the steps
|
2023-07-10 15:43:08 +00:00
|
|
|
below, *even if you're using a release archive*.
|
|
|
|
|
|
|
|
Before you use the build system, please know: the build system itself uses
|
|
|
|
Git extensively, when downloading software like coreboot and patching it.
|
|
|
|
|
|
|
|
You should make sure to initialize your Git properly, before you begin or else
|
|
|
|
the build system will not work properly. Do this:
|
|
|
|
|
|
|
|
git config --global user.name "John Doe"
|
|
|
|
git config --global user.email johndoe@example.com
|
|
|
|
|
|
|
|
Change the name and email address to whatever you want, when doing this.
|
|
|
|
|
|
|
|
You may also want to follow more of the steps here:
|
|
|
|
<https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>
|
|
|
|
|
2023-10-26 00:10:41 +00:00
|
|
|
How to compile Canoeboot
|
|
|
|
========================
|
2023-07-10 15:43:08 +00:00
|
|
|
|
2023-10-26 00:10:41 +00:00
|
|
|
Actual development/testing is always done using cbmk directly, and this
|
|
|
|
includes when building from source. Here are some instructions to get you
|
|
|
|
started:
|
2023-07-10 15:43:08 +00:00
|
|
|
|
2024-01-25 19:50:24 +00:00
|
|
|
Zero..st, check time/date
|
|
|
|
-------------------------
|
|
|
|
|
|
|
|
Make sure date/hwclock report the correct time and date on your system,
|
|
|
|
because parts of the build process download from HTTPS servers and wrong
|
|
|
|
time or date can cause connections to be dropped during negotiation.
|
|
|
|
|
2023-10-26 00:10:41 +00:00
|
|
|
First, install build dependencies
|
|
|
|
---------------------------------
|
2023-07-10 15:43:08 +00:00
|
|
|
|
extreme cleanup / grandiose gesture
make canoeboot a truly GNU FSDG compliant coreboot distro,
by removing all overly positive reference to Libreboot;
what remains is technical in nature, so as to provide
historical context since Canoeboot is a fork of Libreboot.
I've stated before that I wish to take a more neutral tone
toward the FSF, in contrast to the *coldboot war* of 2023
when GNU Boot started.
Canoeboot was heavily linking to Libreboot, even going so far
as to call itself "inferior" and tell the reader to use
Libreboot.
From now on, Canoeboot will be maintained as though I actually
believed in FSF propoganda. I don't, but its users do. Treat
them with respect. My reason for providing Canoeboot is
precisely that I wish for such people to have a high quality
coreboot distro, much unlike the inferior *GNU Boot* project;
inferior because to this day, it's still based on very old
Libreboot, with not much changed (of any real substance)
relative to the Libreboot 20220710 release on which it forked.
In general, I've also found a lot of stragglers from when
Canoeboot started, where paragraphs referred to Libreboot that
should have actually referred to Canoeboot, or paragraphs
with Libreboot-specific information that does not make sense
in the Canoeboot project e.g. references to vendor scripts.
The resulting canoeboot.org will now look no different to any
typical reader than a typical FSF-aligned project.
There is a next stage to this, which will become apparent to
everyone if I have my way.
Signed-off-by: Leah Rowe <info@minifree.org>
2024-05-10 02:12:44 +00:00
|
|
|
Check `config/dependencies/` for list of supported distros.
|
2023-07-10 15:43:08 +00:00
|
|
|
|
extreme cleanup / grandiose gesture
make canoeboot a truly GNU FSDG compliant coreboot distro,
by removing all overly positive reference to Libreboot;
what remains is technical in nature, so as to provide
historical context since Canoeboot is a fork of Libreboot.
I've stated before that I wish to take a more neutral tone
toward the FSF, in contrast to the *coldboot war* of 2023
when GNU Boot started.
Canoeboot was heavily linking to Libreboot, even going so far
as to call itself "inferior" and tell the reader to use
Libreboot.
From now on, Canoeboot will be maintained as though I actually
believed in FSF propoganda. I don't, but its users do. Treat
them with respect. My reason for providing Canoeboot is
precisely that I wish for such people to have a high quality
coreboot distro, much unlike the inferior *GNU Boot* project;
inferior because to this day, it's still based on very old
Libreboot, with not much changed (of any real substance)
relative to the Libreboot 20220710 release on which it forked.
In general, I've also found a lot of stragglers from when
Canoeboot started, where paragraphs referred to Libreboot that
should have actually referred to Canoeboot, or paragraphs
with Libreboot-specific information that does not make sense
in the Canoeboot project e.g. references to vendor scripts.
The resulting canoeboot.org will now look no different to any
typical reader than a typical FSF-aligned project.
There is a next stage to this, which will become apparent to
everyone if I have my way.
Signed-off-by: Leah Rowe <info@minifree.org>
2024-05-10 02:12:44 +00:00
|
|
|
Canoeboot includes a script that automatically installs build dependencies
|
|
|
|
according to the selected GNU+Linux distro.
|
2023-07-10 15:43:08 +00:00
|
|
|
|
extreme cleanup / grandiose gesture
make canoeboot a truly GNU FSDG compliant coreboot distro,
by removing all overly positive reference to Libreboot;
what remains is technical in nature, so as to provide
historical context since Canoeboot is a fork of Libreboot.
I've stated before that I wish to take a more neutral tone
toward the FSF, in contrast to the *coldboot war* of 2023
when GNU Boot started.
Canoeboot was heavily linking to Libreboot, even going so far
as to call itself "inferior" and tell the reader to use
Libreboot.
From now on, Canoeboot will be maintained as though I actually
believed in FSF propoganda. I don't, but its users do. Treat
them with respect. My reason for providing Canoeboot is
precisely that I wish for such people to have a high quality
coreboot distro, much unlike the inferior *GNU Boot* project;
inferior because to this day, it's still based on very old
Libreboot, with not much changed (of any real substance)
relative to the Libreboot 20220710 release on which it forked.
In general, I've also found a lot of stragglers from when
Canoeboot started, where paragraphs referred to Libreboot that
should have actually referred to Canoeboot, or paragraphs
with Libreboot-specific information that does not make sense
in the Canoeboot project e.g. references to vendor scripts.
The resulting canoeboot.org will now look no different to any
typical reader than a typical FSF-aligned project.
There is a next stage to this, which will become apparent to
everyone if I have my way.
Signed-off-by: Leah Rowe <info@minifree.org>
2024-05-10 02:12:44 +00:00
|
|
|
For example:
|
2023-07-10 15:43:08 +00:00
|
|
|
|
2024-08-23 00:28:08 +00:00
|
|
|
./mk dependencies ubuntu
|
|
|
|
|
|
|
|
or
|
|
|
|
|
|
|
|
./mk dependencies debian
|
|
|
|
|
|
|
|
or
|
|
|
|
|
2025-01-01 17:09:20 +00:00
|
|
|
./mk dependencies fedora41
|
2024-08-23 00:28:08 +00:00
|
|
|
|
|
|
|
or
|
|
|
|
|
|
|
|
./mk dependencies arch
|
2023-07-10 15:43:08 +00:00
|
|
|
|
2025-01-01 17:09:20 +00:00
|
|
|
NOTE: For versioned files, such as `fedora41`, typically other versions will
|
|
|
|
be available too, e.g. `fedora38`. Make sure to check `config/dependencies/`,
|
|
|
|
so that you know whether or not a file is available for your distro.
|
|
|
|
|
2023-10-26 00:10:41 +00:00
|
|
|
NOTE: In case of Ubuntu 20.04 LTS or derived distros for that specific release,
|
extreme cleanup / grandiose gesture
make canoeboot a truly GNU FSDG compliant coreboot distro,
by removing all overly positive reference to Libreboot;
what remains is technical in nature, so as to provide
historical context since Canoeboot is a fork of Libreboot.
I've stated before that I wish to take a more neutral tone
toward the FSF, in contrast to the *coldboot war* of 2023
when GNU Boot started.
Canoeboot was heavily linking to Libreboot, even going so far
as to call itself "inferior" and tell the reader to use
Libreboot.
From now on, Canoeboot will be maintained as though I actually
believed in FSF propoganda. I don't, but its users do. Treat
them with respect. My reason for providing Canoeboot is
precisely that I wish for such people to have a high quality
coreboot distro, much unlike the inferior *GNU Boot* project;
inferior because to this day, it's still based on very old
Libreboot, with not much changed (of any real substance)
relative to the Libreboot 20220710 release on which it forked.
In general, I've also found a lot of stragglers from when
Canoeboot started, where paragraphs referred to Libreboot that
should have actually referred to Canoeboot, or paragraphs
with Libreboot-specific information that does not make sense
in the Canoeboot project e.g. references to vendor scripts.
The resulting canoeboot.org will now look no different to any
typical reader than a typical FSF-aligned project.
There is a next stage to this, which will become apparent to
everyone if I have my way.
Signed-off-by: Leah Rowe <info@minifree.org>
2024-05-10 02:12:44 +00:00
|
|
|
use the dedicated configuration file (the Trisquel 11 config symlinks to this):
|
2023-07-10 15:43:08 +00:00
|
|
|
|
2024-08-23 00:28:08 +00:00
|
|
|
./mk dependencies ubuntu2004
|
2023-07-10 15:43:08 +00:00
|
|
|
|
extreme cleanup / grandiose gesture
make canoeboot a truly GNU FSDG compliant coreboot distro,
by removing all overly positive reference to Libreboot;
what remains is technical in nature, so as to provide
historical context since Canoeboot is a fork of Libreboot.
I've stated before that I wish to take a more neutral tone
toward the FSF, in contrast to the *coldboot war* of 2023
when GNU Boot started.
Canoeboot was heavily linking to Libreboot, even going so far
as to call itself "inferior" and tell the reader to use
Libreboot.
From now on, Canoeboot will be maintained as though I actually
believed in FSF propoganda. I don't, but its users do. Treat
them with respect. My reason for providing Canoeboot is
precisely that I wish for such people to have a high quality
coreboot distro, much unlike the inferior *GNU Boot* project;
inferior because to this day, it's still based on very old
Libreboot, with not much changed (of any real substance)
relative to the Libreboot 20220710 release on which it forked.
In general, I've also found a lot of stragglers from when
Canoeboot started, where paragraphs referred to Libreboot that
should have actually referred to Canoeboot, or paragraphs
with Libreboot-specific information that does not make sense
in the Canoeboot project e.g. references to vendor scripts.
The resulting canoeboot.org will now look no different to any
typical reader than a typical FSF-aligned project.
There is a next stage to this, which will become apparent to
everyone if I have my way.
Signed-off-by: Leah Rowe <info@minifree.org>
2024-05-10 02:12:44 +00:00
|
|
|
Technically, any GNU+Linux distribution can be used to build canoeboot.
|
2023-07-10 15:43:08 +00:00
|
|
|
However, you will have to write your own script for installing build
|
|
|
|
dependencies.
|
|
|
|
|
2025-01-04 03:08:17 +00:00
|
|
|
Debian Trixie/Sid
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
Debian Trixie, the testing release as of 3 January 2025, and Debian Sid,
|
|
|
|
provide `gnat` and `gcc` as you expect, but `gnat` resolves to `gnat-13` and
|
|
|
|
installs `gcc-13` as a dependency, while `gcc` resolves to `gcc-14` and other
|
|
|
|
toolchain components correspond to this version.
|
|
|
|
|
|
|
|
The GCC/GNAT versions need to match during build time, so Canoeboot's build
|
|
|
|
system hacks the `PATH` environmental variable, setting up symlinks, matching
|
|
|
|
GNAT to GCC or GNAT to GCC. When you run `./mk dependencies debian`, you get
|
|
|
|
GNAT 13 and GCC 14. This seems to make most boards compile; in our testing, the
|
|
|
|
KGPE-D16 board failed to compile in this configuration. This PATH hack is only
|
|
|
|
done for compiling the coreboot crossgcc toolchain, and nothing else; after that,
|
|
|
|
coreboot's toolchain is used.
|
|
|
|
|
|
|
|
GNAT is used by coreboot, because some of the Intel graphics devices are
|
|
|
|
initialised natively, with code written in Ada spark (called `libgfxinit`).
|
|
|
|
|
|
|
|
When updating from Debian stable to Debian Trixie(testing) or Sid, you should
|
|
|
|
also check for orphaned packages, using `aptitude search '~o'`. Do this,
|
|
|
|
removing what was leftover from the old release, and make sure to re-run the
|
|
|
|
Debian dependencies script, but do it like this:
|
|
|
|
|
|
|
|
./mk dependencies debian --reinstall
|
|
|
|
|
|
|
|
For better reliability, you should, after running the dependencies script,
|
|
|
|
remove `gnat` and install `gnat-14` instead, which is available on this day
|
|
|
|
of 3 December 2025, but currently marked experimental. When you install
|
|
|
|
GNAT 14, GNAT 13 is removed but `gnat` (in `PATH`) still won't resolve to
|
|
|
|
anything. Canoeboot *still* accomodates this, detecting and matching the GCC
|
|
|
|
and GNAT versions, which would in this instance match version 14 between them,
|
|
|
|
so that `gnat` and `gcc` are both in PATH at build time, resolving to v14.x.
|
|
|
|
When we tested with this configuration, the KGPE-D16 images also compiled.
|
|
|
|
|
|
|
|
NOTE: Ubuntu 24.10 also has the issue described above. Some other distros may
|
|
|
|
also have it, if they're based on Debian Testing/Sid or Ubuntu 24.10.
|
|
|
|
|
|
|
|
MIPS cross compiler
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
Canoeboot has support for the Sony PlayStation (PS1/PSX), based on
|
|
|
|
the PCSX-Redux Open BIOS. If you're doing a full release build, and/or
|
|
|
|
specifically building the PSX BIOS, you need a MIPS cross compiler.
|
|
|
|
|
|
|
|
Arch-based systems have a mipsel cross compiler available from AUR, and most
|
|
|
|
Debian-based systems have a mipsel cross compiler in apt; for these, the normal
|
|
|
|
dependencies installation command will provide them. We know Void Linux and
|
|
|
|
Fedora don't have a MIPS compiler, for instance.
|
|
|
|
|
|
|
|
If your distro doesn't have the MIPS compiler available,
|
|
|
|
the [PlayStation](../install/playstation.md) page provides instructions for
|
|
|
|
manual installation; please do this in addition to the normal dependencies.
|
|
|
|
|
2023-10-26 00:10:41 +00:00
|
|
|
Next, build ROM images
|
|
|
|
----------------------
|
2023-07-17 15:45:56 +00:00
|
|
|
|
2023-10-26 00:10:41 +00:00
|
|
|
Canoeboot MaKe (cbmk) automatically runs all necessary commands; for
|
2024-08-23 00:28:08 +00:00
|
|
|
example, `./mk -b coreboot` will automatically build the required payloads
|
|
|
|
if not already compiled.
|
2023-07-10 15:43:08 +00:00
|
|
|
|
|
|
|
As a result, you can now (after installing the correct build dependencies) run
|
2023-10-26 00:10:41 +00:00
|
|
|
just a single command, from a fresh Git clone, to build all ROM images:
|
2023-07-10 15:43:08 +00:00
|
|
|
|
2024-08-23 00:28:08 +00:00
|
|
|
./mk -b coreboot
|
2023-07-10 15:43:08 +00:00
|
|
|
|
|
|
|
or even just build specific ROM images, e.g.:
|
|
|
|
|
2024-08-23 00:28:08 +00:00
|
|
|
./mk -b coreboot x60
|
2023-10-26 00:10:41 +00:00
|
|
|
|
|
|
|
or get a list of supported build targets:
|
|
|
|
|
2024-08-23 00:28:08 +00:00
|
|
|
./mk -b coreboot list
|
2023-10-26 00:10:41 +00:00
|
|
|
|
|
|
|
Or maybe just build payloads?
|
|
|
|
-----------------------------
|
2023-07-10 15:43:08 +00:00
|
|
|
|
|
|
|
If you wish to build payloads, you can also do that. For example:
|
|
|
|
|
2024-08-23 00:28:08 +00:00
|
|
|
./mk -b grub
|
2023-07-10 15:43:08 +00:00
|
|
|
|
2024-08-23 00:28:08 +00:00
|
|
|
./mk -b seabios
|
2023-07-10 15:43:08 +00:00
|
|
|
|
2024-08-23 00:28:08 +00:00
|
|
|
./mk -b u-boot
|
2023-07-10 15:43:08 +00:00
|
|
|
|
|
|
|
Previous steps will be performed automatically. However, you can *still* run
|
|
|
|
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
|
2023-10-26 00:10:41 +00:00
|
|
|
cbmk.
|
2023-07-10 15:43:08 +00:00
|
|
|
|
2023-10-26 00:10:41 +00:00
|
|
|
Want to modify Canoeboot?
|
|
|
|
-------------------------
|
2023-07-10 15:43:08 +00:00
|
|
|
|
2023-10-26 00:10:41 +00:00
|
|
|
Check the [cbmk maintenance manual](../maintain/) for guidance. You may for
|
|
|
|
example want to modify a config, e.g.:
|
2023-07-10 15:43:08 +00:00
|
|
|
|
2024-08-23 00:28:08 +00:00
|
|
|
./mk -m coreboot x200_8mb
|
2023-07-10 15:43:08 +00:00
|
|
|
|
2023-10-26 00:10:41 +00:00
|
|
|
Or perhaps add a new board! The maintenance manual will teach you how the
|
|
|
|
Canoeboot build system (cbmk) works!
|
2024-01-27 22:35:38 +00:00
|
|
|
|
|
|
|
Post-compilation steps
|
|
|
|
======================
|
|
|
|
|
|
|
|
So you compiled your Canoeboot image? Congratulations!
|
|
|
|
|
|
|
|
Before you flash, please make sure that you *dumped* two copies of the original
|
|
|
|
firmware just in case (verifying the hashes of each dump, to ensure that they
|
|
|
|
match), using the `-r` option in flashprog.
|
|
|
|
|
|
|
|
NOTE: Canoeboot standardises on [flashprog](https://flashprog.org/wiki/Flashprog)
|
|
|
|
now, as of 3 May 2024, which is a fork of flashrom.
|