-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: AtomicFS <[email protected]>
- Loading branch information
Showing
17 changed files
with
736 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Features | ||
|
||
- [Environment variables in JSON configuration](./usage_github.md#parametric-builds-with-environment-variables) | ||
- [Recursive builds](./config.md#modules) | ||
- Interactive mode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Start a new git repository | ||
|
||
Start a new repository in GitHub and the clone it. | ||
|
||
|
||
## Add coreboot as submodule | ||
|
||
~~~admonish tip | ||
Add git submodule with: | ||
``` | ||
git submodule add <repo> <path> | ||
``` | ||
~~~ | ||
|
||
Add [coreboot repository](https://review.coreboot.org/admin/repos/coreboot,general) as a submodule: | ||
```bash | ||
git submodule add --depth=1 "https://review.coreboot.org/coreboot" coreboot | ||
``` | ||
|
||
```bash | ||
git submodule update --init | ||
``` | ||
|
||
Optionally checkout a release tag, for example `4.19` (it is a bit older release from January 2023, but should suffice for demonstration) | ||
```bash | ||
( cd coreboot; git fetch origin tag "4.19"; git checkout "4.19" ) | ||
``` | ||
|
||
Recursively initialize submodules. | ||
|
||
```bash | ||
git submodule update --init --recursive | ||
``` | ||
|
||
~~~admonish warning | ||
Recursively initializing all submodules in coreboot will take a moment. | ||
~~~ | ||
|
12 changes: 12 additions & 0 deletions
12
docs/src/firmware-action/get_started/02_coreboot_config.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
## Create a coreboot configuration file | ||
|
||
Now we need to create a configuration file for coreboot. | ||
|
||
Either follow a [coreboot guide](https://doc.coreboot.org/tutorial/part1.html#step-5-configure-the-build) to get a base-bones-basic configuration, or just copy-paste this text into `seabios_defconfig` file. | ||
|
||
~~~admonish example title="seabios_defconfig" | ||
```properties | ||
{{#include ../../firmware-action-example/seabios_defconfig}} | ||
``` | ||
~~~ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Create a JSON configuration file | ||
|
||
This configuration file is for firmware-action, so that it knows what to do and where to find things. Let's call it `firmware-action.json`. | ||
|
||
~~~admonish example title="firmware-action.json" | ||
```json | ||
{{#include ../../firmware-action-example/firmware-action.json}} | ||
``` | ||
~~~ | ||
|
||
~~~admonish info | ||
Field `repo_path` is pointing to the location of our coreboot submodule. | ||
~~~ | ||
|
||
~~~admonish info | ||
Field `defconfig_path` is pointing to the location of coreboot's configuration file. | ||
~~~ | ||
|
||
~~~admonish info | ||
Firmware action can be used to compile other firmware too, and even combine multiple firmware projects (to a certain degree). | ||
For this reason the JSON configuration file is divided into categories (`coreboot`, `edk2`, etc). Each category can contain multiple entries. | ||
Entries can depend on each other, which allows you to combine them - you can have for example `coreboot` firmware with `edk2` payload. | ||
~~~ | ||
|
4 changes: 4 additions & 0 deletions
4
docs/src/firmware-action/get_started/04_get_firmware_action.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Get firmware-action | ||
|
||
Either [clone the repository and build the executable yourself](../usage_local.md), or just download pre-compiled executable from [releases](https://github.com/9elements/firmware-action/releases). | ||
|
18 changes: 18 additions & 0 deletions
18
docs/src/firmware-action/get_started/05_run_firmware_action.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Run firmware-action locally | ||
|
||
```bash | ||
./firmware-action build --config=firmware-action.json --target=coreboot-example | ||
``` | ||
|
||
`firmware-action` will firstly download `registry.dagger.io/engine` container needed for dagger and start it. | ||
|
||
Then it will proceed to download `coreboot` container (specified by `sdk_url` in JSON config), copy into it specified files and then start compilation. | ||
|
||
If compilation is successful, a new directory `output-coreboot/` will be created (as specified by `output_dir` in JSON config) which will contain files (specified by `container_output_files` in JSON config) and possibly also directories (specified by `container_output_dirs` in JSON config). | ||
|
||
~~~admonish info | ||
`container_output_dirs` and `container_output_files` are lists of directories and files to be extracted from the container once compilation finished successfully. | ||
These are then placed into `output_dir`. | ||
~~~ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## Run firmware-action in GitHub CI | ||
|
||
Now that we have `firmware-action` working on local system. Let's set up CI. | ||
|
||
~~~admonish example title=".github/workflows/example.yml" | ||
```yaml | ||
{{#include ../../firmware-action-example/.github/workflows/example.yml}} | ||
``` | ||
~~~ | ||
|
||
Commit, push and watch. And that is it. | ||
|
||
Now you should be able to build coreboot in CI and on your local machine. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Get started | ||
|
||
This guide will provide instructions step by step on how to get started with firmware-action, and it will demonstrate the use on [coreboot](https://coreboot.org/) example. | ||
|
||
In this guide we will: | ||
- start a new repository | ||
- in this guide it will be hosted in [GitHub](https://github.com/) | ||
- we will build a simple coreboot for [QEMU](https://wiki.archlinux.org/title/QEMU) | ||
- we will be able to build coreboot in GitHub action and locally | ||
|
||
The code from this example is available in [firmware-action-example](https://github.com/9elements/firmware-action-example). | ||
|
||
|
||
## Prerequisites | ||
|
||
- installed [Docker](https://wiki.archlinux.org/title/Docker) | ||
- installed git | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.