Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add make targets to build the linux kernel #600

Merged
merged 4 commits into from
Mar 29, 2022

Conversation

Kern--
Copy link
Contributor

@Kern-- Kern-- commented Mar 28, 2022

This PR adds the ability to build a kernel from source instead of using the default pre-built that is downloaded during build.

By default, the pre-built kernel will be used however it can be overridden with:

make kernel
make install-kernel

This will build a 4.14 kernel that is similar to the pre-built, except that FUSE is enabled.

Alternatively, kernel 5.10 can be used by setting KERNEL_VERSION=5.10, e.g.

KERNEL_VERSION=5.10 make kernel
KERNEL_VERSION=5.10 make install-kernel

This is a step towards #597, but we still need to either:

  1. Update the CI scripts to make a kernel
    or
  2. Add infrastructure to test against multiple kernels.

Kern-- added 4 commits March 28, 2022 20:48
Copied from the Firecracker main repo:
https://github.com/firecracker-microvm/firecracker/tree/83ec483d4254936e1e2fd4adfe94761611a74a93/resources/guest_configs

This allows us to have customized kernel builds for
firecracker-containerd that are similar to upstream

Signed-off-by: Kern Walster <[email protected]>
Firecracker 1.0.0's build tool parses the kernel version
out of the specified config file to determine which kernel
sources to downlod.

The build tool requires the patch version to be specified:
https://github.com/firecracker-microvm/firecracker/blob/v1.0.0/tools/devtool#L2015

However, the linux kernel cdn drops the patch version if it is 0 (i.e.
sources for kernel 5.10.0 are hosted with a filename like
linux-5.10.tar.gz). This means that firecracker-1.0.0 cannot build
kernel 5.10.0.

Signed-off-by: Kern Walster <[email protected]>
Signed-off-by: Kern Walster <[email protected]>
Firecracker-containerd requires a linux kerenl which is provided
precompiled by default. For most use-cases, this is acceptable however
it prevents us from enabling additional features (e.g. FUSE for remote
snapshotters) and from updating kernel versions in a timely manner.

This change adds optional `make kernel` and `make install-kernel`
targets which compile a 4.14 kernel by default with FUSE enabled. 5.10
can be compiled instead with `KERNEL_VERSION=5.10 make install-kernel`.
The `install-kernel` target overwrites any previously installed kernel
(either the default pre-built or a previous `make install-kernel`)

Signed-off-by: Kern Walster <[email protected]>
@Kern-- Kern-- requested a review from a team as a code owner March 28, 2022 21:00
@Kern-- Kern-- changed the title Kernel targets Add make targets to build the linux kernel Mar 28, 2022
@Kern-- Kern-- merged commit c4f9c73 into firecracker-microvm:main Mar 29, 2022
@Kern-- Kern-- deleted the kernel-targets branch March 29, 2022 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants