You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-8Lines changed: 21 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,33 +6,45 @@ Builds the Linux kernel into OCI images.
6
6
7
7
This repo is a series of helper scripts and Github Actions that
8
8
9
-
1. Use [config.yaml](config.yaml) and various scripts in `hack/build` to generate a matrix of kernel upstream versions, variants, and flavors to be built.
9
+
1. Use [config.yaml](/config.yaml) and various scripts in `hack/build` to generate a matrix of kernel upstream versions, variants, and flavors to be built.
10
10
1. Fetches `kernel.org` tarballs, applies custom config flags, and patches, depending on version, flavor and variant.
11
11
1. Builds those kernels for x86_64/arm64.
12
12
13
13
### Variant and flavor configs
14
14
15
-
See the [configs](configs/README.md) directory for more info.
15
+
See the [configs](/configs/README.md) directory for more info.
16
16
17
17
### Patches
18
18
19
-
See the [patches](patches) directory for the current set of patches Edera carries against upstream kernels.
19
+
See the [patches](/patches) directory for the current set of patches Edera carries against upstream kernels.
20
20
21
-
Note that not all the patches will be applied to all kernel versions, this is driven by version constraints in [config.yaml](config.yaml).
21
+
Note that not all the patches will be applied to all kernel versions, this is driven by version constraints in [config.yaml](/config.yaml).
22
22
23
+
## Building your own kernels with custom KConfig (Using Github Actions)
23
24
24
-
### Building a custom debug kernel locally
25
+
1. Fork [this repo](https://github.com/edera-dev/linux-kernel-oci.git) into your Github org/account.
26
+
1. Inspect the Github Action file [.github/workflows/build.yaml](/.github/workflows/build.yaml):
27
+
1. This will use the default `GITHUB_TOKEN` granted to all Github Action workflows by default to push OCI images to `ghcr.io` in your fork's context. Refer to [Github's documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry) for details on access permissions and how `GITHUB_TOKEN` works.
28
+
1. You should not need to make changes to this file, but it is best practice to understand what an Action does and what permissions it expects **before** you run it.
29
+
1. Edit [config.yaml](/config.yaml) in the root of your fork:
30
+
1. Edit the line `imageNameFormat: "ghcr.io/edera-dev/[image]:[tag]"` and change it to `imageNameFormat: "ghcr.io/<your GH org>/[image]:[tag]"`
31
+
1. Add or remove any `Kconfig` options you want to the `flavor` and `variant` Kconfig fragments in [configs](/configs), as outlined by the [README](/configs/README.md) in that folder.
32
+
1. Commit those changes to `main` in your fork.
33
+
1. From your forked repository's `Actions` tab, run the `Build Kernels` job with a Build Specification like: `stable:flavor=zone,host`. This will build `zone` and `host` kernel flavors using `stable` kernel.org releases for all current LTS kernels.
34
+
1.
35
+
36
+
## Building your own kernels with custom KConfig (Locally, for debugging)
25
37
26
38
For most of the kernels in this registry, debugging symbols and features are disabled, to keep the kernel artifacts small.
27
39
28
-
You may want or need to build your own debugging kernel with custom patches/options locally, and publish it to a transient OCI registry (like [](ttl.sh)) for testing purposes.
40
+
You may want or need to build your own debugging kernel with custom patches/options locally, and publish it to a transient OCI registry (like [ttl.sh](ttl.sh)) for testing purposes.
29
41
30
42
To do this, you will need `docker` installed and configured correctly to support cross-builds (`docker buildx`) in your local environment.
31
43
32
44
The simplest way to do that is to
33
45
34
46
1. Clone this repo locally: `git clone git@github.com:edera-dev/linux-kernel-oci.git`
- to change the `imageNameFormat` key to push to an OCI registry you have access to.
37
49
- to change the `architectures` YAML key to only include the architectures you care about (x86_64, arm64, or both - `docker buildx` is used so you can build arm64 on x86_64 and vice-versa).
38
50
- to change the `flavors` YAML key to only include the flavors you care about (host, or zone, or both).
@@ -58,10 +70,11 @@ The simplest way to do that is to
58
70
- current: true
59
71
```
60
72
73
+
1. Add or remove any `Kconfig` options you want to the `flavor` and `variant` Kconfig fragments in [configs](/configs), as outlined by the [README](/configs/README.md) in that folder.
61
74
1. Run [hack/build/docker-build.sh](hack/build/docker-build.sh)
62
75
- It is **important** you follow the previous step, and edit the [config.yaml](config.yaml) locally to reduce the number of kernels the script will try to build, or you may end up building 15+ different kernels in parallel on your local box, which will take a very, very long time.
63
76
- When this command runs, it will generate a build matrix and print out what it will build.
64
-
1. When the above command finishes, you can see the local OCI images that were built by running `docker image list`. The images will be tagged with the repo you specified in `imageNameFormat` in the [config.yaml](config.yaml).
77
+
1. When the above command finishes, you can see the local OCI images that were built by running `docker image list`. The images will be tagged with the repo you specified in `imageNameFormat` in the [config.yaml](/config.yaml).
65
78
1. From this point, you may push those images to an OCI registry with standard commands like `docker image push <image tag>`, and consume them how you wish.
66
79
1. If you wish to unpack and inspect the final image (for instance, to make sure certain modules or firmware exist in the correct paths, or that the final `config.gz` has the options you expect), you can do the following to fetch and extract the image artifact you just pushed to your local disk with [`crane`](https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md):
0 commit comments