---
title: How to build Retroboot from source
x-toc-enable: true
...

This section documents how to build retroboot from source.

This document assumes that you are using the Retroboot git repository, which
you can download here:

<https://notabug.org/retroboot/retroboot>

Retroboot uses its own, bespoke build system. However, improvements are
planned to integrate a lot of the steps, and make each step check whether a
pre-requisite step was done in advance, and do it if not done. This will later
enable a `Makefile` to be included in the root of the Retroboot git repository
or source code release archive.

For now, please read this entire page if you want to know how to use the
Retroboot build system.

For information about how the Retroboot build system actually works, and how
to maintain it or add changes to it, read this article instead:

[Retroboot maintenance manual](../maintain/)

Information about submitting patches can be found on the page that says
[how to submit patches to Retroboot via pull request](../git.md) (the website
and docs are also in the Git repository, and patches can be submitted using
the same infrastructure documentated on that page).

First, install build dependencies
---------------------------------

Retroboot includes a script that automatically installs apt-get dependencies
in Ubuntu 20.04. It may work in other similar GNU+Linux distributions.
    
    $ sudo ./build dependencies ubuntu2004

    # ./build dependencies ubuntu2004

Technically, any GNU+Linux distribution can be used to build Retroboot.
However, you will have to write your own script for installing build
dependencies. 

Second, download all of the required software components
--------------------------------------------------------

It's as simple as that:

    $ ./download all

The above command downloads all modules defined in the Retroboot build system.
However, you can download modules individually.

This command shows you the list of available modules:

    $ ./download list

Example of downloading an individual module:

    $ ./download coreboot

    $ ./download flashrom

Third, build all of the modules:
--------------------------------

Building a module means that it needs to have already been downloaded.
Currently, the build system does not automatically do pre-requisite steps
such as this, so you must verify this yourself.

Again, very simple:

    $ ./build module all

This builds every module defined in the Retroboot build system, but you can
build modules individually.

The following command lists available modules:

    $ ./build module list

Example of building specific modules:

    $ ./build module grub

    $ ./build module flashrom

Commands are available to *clean* a module, which basically runs make-clean.
You can list these commands:

    $ ./build clean list

Clean all modules like so:

    $ ./build clean all

Example of cleaning specific modules:

    $ ./build clean grub

    $ ./build clean cbutils

Fourth, build all of the payloads:
---------------------------------

Ditto about previous steps. The build system does not check whether previous
steps (required for later steps) have been done, so you must verify this
yourself. (changing that is on the TODO list. This will later enable a
Makefile to be included, so that someone can just type "make" when they
download Retroboot from the git repository.

Very straight forward:

    $ ./build payload all

You can list available payloads like so:

    $ ./build payload list

Example of building specific payloads:

    $ ./build payload grub

    $ ./build payload seabios

The build-payload command is is a prerequsite for building ROM images.

Fifth, build the ROMs!
----------------------

With GRUB (SeaBIOS selectable from menu):

    $ ./build roms withgrub

With just SeaBIOS:

    $ ./build roms withseabios

NOTE: each of these commands will build *every* board that has configs for
the given payload as specified by the command. You can add a board name to
the end of the command. These board names can be determined per the directory
name of each board under `resources/coreboot/`

For example, if you only wanted to build SeaBIOS ROMs for X230:

    $ ./build roms withseabios x230

For example, if you only wanted to build GRUB+SeaBIOS ROMs for X230:

    $ ./build roms withgrub x230

You *can* list available commands using `./build roms list` and you can run
`./build roms all` but this is not recommended. You should individually
specify the payload in a separate command.

That's it!

If all went well, ROM images should be available to you under bin/

Build the documentation and website
-----------------------------------

The entire website, hosted on retroboot.org, is written in Markdown (for use
with Pandoc). A separate build system is included in Retroboot, which uses
a *static site generator* to:

- Compile all Markdown files (file name ending in .md) into HTML
- Compile the news/blog section of the website

The website/docs has its own build system, not integrated into the main
Retroboot build system. Go into the www/ directory (which has a symlink inside
to the docs/ directory) and type `make`. It uses pandoc to compile the website.

NOTE: it currently relies on a much older version of Pandoc, around version 1.17
or so and it needs to be updated.

You can run `make clean` in www/ to un-build the website if you want to.

Copyright © 2020 Leah Rowe <info@minifree.org>\

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
with no Invariant Sections, no Front Cover Texts, and no Back Cover Texts.
A copy of this license is found in [../fdl-1.3.md](../fdl-1.3.md)
