docs/build: simplify/update per newer lbmk changes

Signed-off-by: Leah Rowe <leah@libreboot.org>
master
Leah Rowe 2023-09-12 01:03:17 +01:00
parent 1fdfd4a2b3
commit 191eabcb32
3 changed files with 30 additions and 419 deletions

View File

@ -3,7 +3,7 @@ title: Build from source
x-toc-enable: true
...
libreboot's build system is named `lbmk`, short for `Libreboot Make`, and this
libreboot's build system is named `lbmk`, short for `LibreBoot MaKe`, and this
document describes how to use it. With this guide, you can know how to compile
libreboot from the available source code.
This version, if hosted live on libreboot.org, assumes that you are using
@ -44,74 +44,15 @@ Python
Python2 is unused by lbmk or anything that it pulls down as modules. You
should ensure that the `python` command runs python 3, on your system.
Make
========
libreboot Make includes a file called `Makefile`. You can still use
the `lbmk` build system directly, or you can use 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, Arch, etc) you can do this:
sudo make install-dependencies-ubuntu
One exists specifically for Debian:
sudo make install-dependencies-debian
Another exists for Arch:
sudo make install-dependencies-arch
Now, simply build the coreboot images like so:
make
This single command will build ROM images for *every* board integrated in
libreboot. If you only wish to build a limited set, you can use `lbmk` directly:
./build boot roms x200_8mb
You can specify more than one argument:
./build boot roms x200_8mb x60
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.
The `Makefile` is simple, because it merely runs `lbmk` commands, so it's very
easy to know what commands are available by simply reading it.
Standard `clean` command available (cleans all modules except `crossgcc`):
make clean
To clean your `crossgcc` builds:
make crossgcc-clean
To build release archives:
make release
Build without using Make
============================
The `Makefile` is included just for *compatibility*, so that someone who
instictively types `make` will get a result.
Building Libreboot
==================
Actual development/testing is always done using `lbmk` directly, and this
includes when building from source. Here are some instructions to get you
started:
First, install build dependencies
---------------------------------
libreboot includes a script that automatically installs apt-get dependencies
in Ubuntu 20.04:
in Ubuntu 20.04 and distros based upon it:
sudo ./build dependencies ubuntu2004
@ -123,179 +64,42 @@ Separate scripts also exist:
sudo ./build dependencies void
Check: `config/dependencies/` for list of supported distros.
Technically, any 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`
example, `./build grub payload` will automatically run `./build grub utils`
if the required utilities for GRUB are not built, to produce payloads.
As a result, you can now (after installing the correct build dependencies) run
just a single command, from a fresh Git clone, to build the ROM images:
just a single command, from a fresh Git clone, to build all ROM images:
./build boot roms
./build boot roms all
or even just build specific ROM images, e.g.:
./build boot roms x60
or get a list of supported build targets:
./build boot roms list
If you wish to build payloads, you can also do that. For example:
./build payload grub
./build payload seabios
./handle make config -b seabios
./build payload u-boot qemu_x86_12mb
./handle make config -b u-boot
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
lbmk.
Therefore, if you only want to build ROM images, just do the above. Otherwise,
please continue reading!
Optional: extract binary blobs
------------------------------
Some boards, including all sandy/ivybridge boards require nonfree blobs which cannot be included in libreboot.
For boards requiring these blobs, libreboot will attempt to download the blobs itself.
If your board does not have blob sources available, then you must extract them from a backup of you vendor rom.
You must point libreboot to the backup rom and tell the build system which board you want to extract blobs for.
For example, to extract blobs for the t440p you must run:
./update blobs extract t440p_12mb /path/to/12mb_backup.rom
You can then build the rom for this board as normal:
./build boot roms t440p_12mb
Second, download all of the required software components
--------------------------------------------------------
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
on! You can read about all available scripts in `lbmk` by reading
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).
Check the list of downloadable modules by reading `resources/git/revisions`.
Example of downloading an individual module:
./fetch seabios
./fetch grub
./fetch flashrom
Coreboot and u-Boot are handled by a separate script:
./fetch_trees coreboot
./fetch_trees u-boot
The 'fetch_trees` script creates multiple directories
based on revisions, and patches per revision, whereas
the `fetch` script only does one revision.
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 libreboot 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 seabios
./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:
---------------------------------
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
Each board has its own U-Boot build configuration in `lbmk` under
`resources/u-boot`. To build U-Boot payloads, you need to specify the
target board and maybe a cross compiler for its CPU architecture. These
are handled automatically when building ROM images, but for example:
./build payload u-boot qemu_x86_12mb # on x86 hosts
CROSS_COMPILE=aarch64-linux-gnu- ./build payload u-boot gru_kevin
CROSS_COMPILE=arm-linux-gnueabi- ./build payload u-boot veyron_speedy
The build-payload command is is a prerequsite for building ROM images.
Fifth, build the ROMs!
----------------------
Run this command:
./build boot roms
Each board has its own configuration in `lbmk` under `resources/coreboot/`
which specifies which payloads are supported.
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
for it under `resources/coreboot/`. For example:
./build boot roms x60
Board names, like above, are the same as the directory names for each board,
under `resources/coreboot/` in the build system.
That's it!
If all went well, ROM images should be available to you under bin/
20230625 build error (release archive)
======================================

View File

@ -3,7 +3,7 @@ title: Побудова з джерельного коду
x-toc-enable: true
...
Система побудови libreboot, називається `lbmk`, скорочення від `Libreboot Make`, і цей
Система побудови libreboot, називається `lbmk`, скорочення від `LibreBoot MaKe`, і цей
документ описує те, як використовувати її. З цим керівництвом ви можете узнати те, як побудувати
libreboot з доступного джерельного коду.
Ця версія, якщо розміщена наживо на libreboot.org, передбачає, що ви використовуєте
@ -44,72 +44,13 @@ Python
Python2 не використовується lbmk або будь-чим, що завантажується в якості модулів. Ви
маєте переконатись, що команда `python` виконує python 3 на вашій системі.
Make
========
libreboot Make включає файл, який названо `Makefile`. Ви досі можете
використовувати систему побудови `lbmk` безпосередньо, або ви можете використовувати Make. `Makefile`
просто виконує команди `lbmk`. Однак, використання `lbmk` безпосередньо запропонує вам
набагато більше гнучкості; наприклад, Makefile наразі не може побудувати один
образ ROM (він лише будує всі з них, для всіх плат).
Ви мусите переконатись, що всі залежності побудови встановлено. Якщо ви використовуєте
Ubuntu або подібний дистрибутив (Debian, Arch і тому подібні), можете виконати це:
sudo make install-dependencies-ubuntu
Існує конкретно для Debian:
sudo make install-dependencies-debian
Інша існує для Arch:
sudo make install-dependencies-arch
Тепер, просто побудуйте образи coreboot подібним чином:
make
Ця єдина команда побудує образи ROM для *кожної* плати, інтегрованої до
libreboot. Якщо ви тільки хочете побудувати обмежену вибірку, можете використовувати `lbmk` безпосередньо:
./build boot roms x200_8mb
Ви можете вказати більше одного аргумента:
./build boot roms x200_8mb x60
Образи ROM з'явяться під щойно створеною директорією `bin/` в системі побудови.
Для інших команд просто прочитайте `Makefile` в своєму улюбленому текстовому редакторі.
`Makefile` є простим, тому що він виконує виключно команди `lbmk`, таким чином дуже
просто знати те, які команди є в доступності, просто читаючи його.
Стандартна команда `clean` доступна (чистить всі модулі, окрім `crossgcc`):
make clean
Щоб почистити ваші побудови `crossgcc`:
make crossgcc-clean
Для побудови архівів випуску:
make release
Побудова без використання Make
Побудова з джерельного коду
============================
`Makefile` включено лише для *сумісності*, щоб якщо хтось
інстиктивно пише `make`, то було отримано результат.
Фактична розробка/тестування завжди виконується безпосередньо за допомогою `lbmk`, і це також
стосується збирання з джерельного коду. Ось кілька інструкцій, щоб
почати:
Спочатку встановіть залежності побудови
---------------------------------
libreboot включає сценарій, який автоматично встановлює apt-get залежності
в Ubuntu 20.04:
@ -123,179 +64,42 @@ libreboot включає сценарій, який автоматично вс
sudo ./build dependencies void
Check: `config/dependencies/` for list of supported distros.
Технічно, будь-який дистрибутив Linux може бути використано для побудови libreboot.
Однак, вам потрібно буде написано свій власний сценарій для встановлення залежностей
побудови.
libreboot Make (lbmk) автоматично виконує всі необхідні команди; наприклад,
`./build payload grub` автоматично виконає `./build module grub`,
`./build grub payload` автоматично виконає `./build grub utils`,
якщо затребувані утиліти для GRUB не збудовано, для виготовлення корисних навантажень.
В якості результату, ви тепер можете (після встановлення правильних залежностей побудови) виконати
лише одну команду, з свіжого Git clone, для побудови образів ROM:
./build boot roms
./build boot roms all
або навіть побудувати конкретні образи ROM, такі як:
./build boot roms x60
or get a list of supported build targets:
./build boot roms list
Якщо ви бажаєте побудувати корисні навантаження, можете зробити це. Наприклад:
./build payload grub
./build payload seabios
./handle make config -b seabios
./build payload u-boot qemu_x86_12mb
./handle make config -b u-boot
Попередні кроки буде виконано автоматично. Однак, ви можете *досі* виконати
окремі частини системи побудови власноруч, якщо виберете. Це може бути
вигідно, коли ви робите зміни, та бажаєте протестувати конкретну частину
lbmk.
Отже, якщо ви лише хочете побудувати образи ROM, просто зробіть наведене вище. В іншому випадку,
будь ласка, продовжіть читати!
Опціонально: видобути двійкові блоби
------------------------------
Деякі плати, включаючи всі плати sandy/ivybridge, вимагають невільні блоби, які не можуть бути включеними до libreboot.
Для плат, які вимагають ці блоби, libreboot спробує завантажити блоби власноруч.
Якщо ваша плата не має джерел блоба в наявності, тоді ви мусите видобути їх з резервної копії вашого rom постачальника.
Ви маєте вказати libreboot резервну копію rom та сказати системі побудові те, для якої плати ви хочете видобути блоби
Наприклад, щоб видобути блоби для t440p, ви маєте виконати:
./update blobs extract t440p_12mb /path/to/12mb_backup.rom
Ви потім можете побудувати rom для цієї плати нормально:
./build boot roms t440p_12mb
Друге, завантажити всі програмні компоненти, які вимагаються
--------------------------------------------------------
Якщо ви не виконали просто `./build boot roms`або без надлишкових
аргументів), ви все одно можете виконати залишок процесу побудови власноруч. Читайте
далі! Ви можете прочитати про всі доступні сценарії в `lbmk`, читаючи
[керівництво обслуговування libreboot](../maintain/); lbmk розроблено бути модулярним,
що означає те, що кожен сценарій *може* бути використано самостійно (якщо це не є правдою, для
будь-якого сценарія, це є помилкою, яка має бути виправлена).
Check the list of downloadable modules by reading `resources/git/revisions`.
Приклад завантаження індивідуального модуля:
./fetch seabios
./fetch grub
./fetch flashrom
Coreboot and u-Boot are handled by a separate script:
./fetch_trees coreboot
./fetch_trees u-boot
The 'fetch_trees` script creates multiple directories
based on revisions, and patches per revision, whereas
the `fetch` script only does one revision.
Третє, побудова кожного з модулів:
--------------------------------
Побудова модуля означає, що він має вже бути завантаженим.
В цей момент, система побудови не виконує автоматично кроки передумови,
такі як цей, тому ви мусите перевірити це власноруч.
Знову, дуже просто:
./build module all
Це будує кожен модуль, означений в системі побудови libreboot, але ви можете
будувати модулі індивідуально.
Наступна команда перелічує доступні модулі:
./build module list
Приклад побудови конкретних модулів:
./build module grub
./build module seabios
./build module flashrom
Команди доступні для *очищення* модуля, які, по суті, виконують make-clean.
Ви можете перелічити ці команди:
./build clean list
Видаліть всі модулі таким чином:
./build clean all
Приклад видалення конкретних модулів:
./build clean grub
./build clean cbutils
Четверте, побудуйте всі корисні навантаження:
---------------------------------
Дуже просто:
./build payload all
Ви можете перелічити доступні корисні навантаження таким чином:
./build payload list
Приклад побудови конкретних корисних навантажень:
./build payload grub
./build payload seabios
Кожна плата має свою власну конфігурацію побудови U-Boot в `lbmk` під
`resources/u-boot`. Для побудови корисних навантажень U-Boot, вам потрібно вказати
цільову плату і мабуть крос-компілятор для її архітектури ЦП. Вони
керуються автоматично під час побудови образів ROM, але для прикладу:
./build payload u-boot qemu_x86_12mb # на хостах x86
CROSS_COMPILE=aarch64-linux-gnu- ./build payload u-boot gru_kevin
CROSS_COMPILE=arm-linux-gnueabi- ./build payload u-boot veyron_speedy
Команда build-payload є попередньою умовою для побудови образів ROM.
П'яте, побудуйте ROM!
----------------------
Виконайте цю команду:
./build boot roms
Кожна плата має свою власну конфігурацію в `lbmk` під `resources/coreboot/`,
яка вказує, які корисні навантаження підтримуються.
За замовчуванням, всі образи ROM будуються, для всіх плат. Якщо ви бажаєте побудувати лише
конкретну плату, ви можете вказати назву плати, засновану на імені директорії
для неї під `resources/coreboot/`. Наприклад:
./build boot roms x60
Імена плат, як вище, такі самі, як імена директорій для кожної плати,
під `resources/coreboot/` в системі побудови.
Ось так!
Якщо все пройшло добре, образи ROM мають бути доступними вам під bin/
20230625 build error (release archive)
======================================

View File

@ -6,6 +6,9 @@ x-toc-enable: true
**TODO: Re-translate this again to Ukrainian. It was translated before, but
the english page got heavily re-written.**
**NOTE: This page also applies to PM45 machine Dell Latitude E6400 if it
contains an Nvidia GPU (Libreboot blob scripts can insert the VGA ROM)**
This is not a general purpose installation guide, but you *should read it*
before installing Libreboot! *This* guide *must* be followed, no matter what
method you use to install Libreboot; even if you compile from source, you should