weaveworks / ignite

Ignite a Firecracker microVM
https://ignite.readthedocs.org
Apache License 2.0
3.49k stars 224 forks source link

kernel headers in base images #853

Open lukemarsden opened 3 years ago

lukemarsden commented 3 years ago

what's the easiest way to get kernel headers into base images?

out of the box, with ignite this fails like this:

root@15f66fdddbe70ea4:~# apt-get -y install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package linux-headers-5.4.43
E: Couldn't find any package by glob 'linux-headers-5.4.43'
E: Couldn't find any package by regex 'linux-headers-5.4.43'

presumably because you're compiling a custom kernel? is there an option to use the stock ubuntu kernel?

lukemarsden commented 3 years ago

(use case: running sysdig in ignite, see https://docs.sysdig.com/en/steps-for-kubernetes--vanilla-.html)

stealthybox commented 3 years ago

Our builds are fairly plain, so existing kernel-headers for the same major version would likely be operable, but it's not ideal to pretend to rely on that. A symlink can be used to make the upstream header files match your ignite kernel's version name?

Are you able to get unblocked even though that's not an ideal solution?

One thing we could do is publish debs and rpms alongside the kernel builds. We don't currently have apt/rpm repos to distribute these packages. We could start using one or host them as a GitHub download.

Potentially, if the kernel OCI image could bundle headers optionally, we could have ignite learn to unpack those into some location in the final rootfs. That would be a decent workaround.

stealthybox commented 3 years ago

This is how to build the raw header files: https://unix.stackexchange.com/a/424982

This is how to produce the apt/deb pkgs: https://stackoverflow.com/a/19497460/5957101

We would modify our ignite/images/kernel/ build to produce these artifacts.