This repository has been archived by the owner on Dec 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 228
Completely restructure & document the kernel image build #506
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f169728
Completely restructure & document the kernel image build
luxas 5b7da84
Update images/kernel/upgrade-config.sh
luxas 8ab24ce
Update images/kernel/patch-config.sh
luxas 5d287ea
Update images/kernel/upgrade-config.sh
luxas aca4942
Update images/kernel/README.md
luxas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
KERNEL_VERSION ?= 4.19.47 | ||
KERNEL_EXTRA ?= | ||
# Check https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/refs/ for updates | ||
KERNEL_VERSIONS ?= 4.14.166 4.19.97 5.4.13 | ||
|
||
all: build | ||
build: | ||
docker build -t weaveworks/ignite-kernel:${KERNEL_VERSION}${KERNEL_EXTRA} \ | ||
--build-arg KERNEL_VERSION=${KERNEL_VERSION} \ | ||
--build-arg KERNEL_EXTRA=${KERNEL_EXTRA} . | ||
|
||
push: | ||
docker push weaveworks/ignite-kernel:${KERNEL_VERSION}${KERNEL_EXTRA} | ||
upgrade: $(addprefix upgrade-,$(KERNEL_VERSIONS)) | ||
./patch-config.sh | ||
for file in generated/*; do \ | ||
./upgrade-config.sh $$file $$file; done | ||
Comment on lines
+8
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you help me understand why this is here? make clean && make mrproper && cp /tmp/.config . && \
make EXTRAVERSION="" LOCALVERSION= olddefconfig on the patched config as the input. Does this cleanup or do something to the generated/patched config that changes it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This basically sanitizes, reorganizes and formats (overwrites) the kernel config for the final generated configs |
||
|
||
upgrade-%: | ||
for file in upstream/*; do \ | ||
./upgrade-config.sh $$file versioned/$$(basename $$file)-$*; done | ||
|
||
build: $(addprefix build-,$(KERNEL_VERSIONS)) | ||
build-%: | ||
docker build -t weaveworks/ignite-kernel:$* \ | ||
--build-arg KERNEL_VERSION=$* . | ||
|
||
push: build $(addprefix push-,$(KERNEL_VERSIONS)) | ||
push-%: | ||
docker push weaveworks/ignite-kernel:${KERNEL_VERSION} |
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,41 @@ | ||||||||||||
# Kernel Images | ||||||||||||
|
||||||||||||
These kernel OCI images contain the kernel binary (at `/boot/vmlinux`) and supporting modules (in `/lib/modules`) | ||||||||||||
for guest VMs ran by Ignite. | ||||||||||||
|
||||||||||||
## Building the Kernel Images | ||||||||||||
|
||||||||||||
```console | ||||||||||||
$ make | ||||||||||||
``` | ||||||||||||
|
||||||||||||
## Versions | ||||||||||||
|
||||||||||||
All LTS versions starting from 4.14 and above are supported by the Ignite team. | ||||||||||||
This means in practice: | ||||||||||||
|
||||||||||||
- 4.14.x | ||||||||||||
- 4.19.x | ||||||||||||
- 5.4.x | ||||||||||||
|
||||||||||||
The exact patch versions may be found in the [Makefile](Makefile). | ||||||||||||
The available versions exist in the [stable kernel git tree](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/refs/). | ||||||||||||
|
||||||||||||
## Upgrading to a new kernel version | ||||||||||||
|
||||||||||||
It should be as easy as: | ||||||||||||
luxas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
|
||||||||||||
```console | ||||||||||||
$ make upgrade | ||||||||||||
``` | ||||||||||||
|
||||||||||||
after you've upgraded the values in the Makefile. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
|
||||||||||||
## Kernel Config Parameters we care about | ||||||||||||
|
||||||||||||
Some options to the kernel are specifically important for making guest software work. | ||||||||||||
|
||||||||||||
Please see: [config-patches](config-patches) for what kernel configs we've changed. | ||||||||||||
The base kernel config is the MicroVM-optimized config file from the Firecracker team. | ||||||||||||
We're storing it in [upstream/config-amd64](upstream/config-amd64). It's available online | ||||||||||||
at [firecracker/resources](https://github.com/firecracker-microvm/firecracker/tree/master/resources). |
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,22 @@ | ||
# In this file, the recipe for patching all kernel configs (all versions & architectures) is | ||
|
||
# For making Weave Net work | ||
CONFIG_DUMMY=y | ||
# Enable VXLAN support as a module so that e.g. Flannel works | ||
CONFIG_VXLAN=m | ||
# Enable support for soft shutdown of amd64 VMs | ||
# See https://github.com/firecracker-microvm/firecracker/blob/master/docs/api_requests/actions.md#sendctrlaltdel | ||
CONFIG_KEYBOARD_ATKBD=y | ||
CONFIG_SERIO=y | ||
CONFIG_SERIO_I8042=y | ||
CONFIG_SERIO_LIBPS2=y | ||
# Make the guest's wall clock not drift | ||
# https://github.com/firecracker-microvm/firecracker/blob/master/FAQ.md#my-guest-wall-clock-is-drifting-how-can-i-fix-it | ||
CONFIG_PTP_1588_CLOCK=y | ||
CONFIG_PTP_1588_CLOCK_KVM=y | ||
|
||
# Some patches for keeping network functionalities that Kubernetes needs/might need | ||
CONFIG_IPVLAN=y | ||
CONFIG_IPVTAP=y | ||
CONFIG_TAP=y | ||
CONFIG_IP_VS_MH=m |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting that these will not overwrite the old images @ https://hub.docker.com/r/weaveworks/ignite-kernel/tags since they are all version bumps 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies in advance ... I'm just getting my head around Ignite - by spec'ing and writing a Cheff Cookbook to install
ignite and ignited
:Is there a Linux kernel dependency to take into consideration when installing Ignite?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@taqtiqa-mark these kernel versions are for the VM guests that ignite runs. They're distributed as OCI images so you don't have to worry about installing them.
For installing ignite, you need a linux host capable of meeting Firecrackers minimum runtime dependencies.
Currently, that is a host with Linux Kernel 4.14 or newer and KVM enabled:
Please see our documented requirements: