eks-anywhere-build-tooling icon indicating copy to clipboard operation
eks-anywhere-build-tooling copied to clipboard

WIP: adds support for building hook kernel

Open jaxesn opened this issue 7 months ago • 5 comments

Issue #, if available:

Description of changes:

This adds support for building the hook os kernel to our build tooling. Currently linuxkit pulls the kernel built from upstream via https://github.com/tinkerbell/hook/tree/main/kernel. This ensures we can build and update the kernel when necessary as well as giving us the ability to include additional/different drives in our default builds based on what we see with customers.

The main difference between "our" build and upstreams will be that we will use AL2 (eventually AL23) whereas upstream uses debian. The current git_tag for hook is 0.8.1. The current main for hook has made significant changes to the kernel build dockerfile. One of the newly introduced patches in this PR is just copying the current main dockerfile on top of our 0.8.1 clone. This allows for the followup patch to just the first layer in the docker file from debian to al2. There are 3 files, keys.asc and the two kernel config files, which are copied from the upstream clone before building the kernel image.

A follow up to this would be to support adding our custom config options to the upstream kernel config before we build our image. Another approach would be to take this file completely, check it in to our repo and maintain it.

A new batch-build.yml is introduced so that we can build the amd image on an amd host and the arm image on an arm host. AL2, nor Al23, provide cross compilation like upstream gets from debian. This is a pretty standard we have followed for other complex builds that require arch specific binary or image builds. To be support this batch build, the 0002 patch was added to support building only the vmlinuz files we want for the given arch. I checked the main upstream and this also changed significantly but will be easier to use when we upgrade.

The kernel-config target is added as a helper for customers who need to add or change the kernel config for their specific hardware, similar to upstrea which we currently reference in our docs

The kernel version is set to the same version we are using from upstream. We should probably bump that to latest 5.10.x in a follow up.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

jaxesn avatar Jul 12 '24 21:07 jaxesn