Overview
In order to build a custom kernel (or a custom kernel module), the following steps are required:- build a new Linux kernel and modules, push the artifacts to a registry
- build a new Talos base artifacts: kernel and initramfs image
- produce a new Talos boot artifact (ISO, installer image, disk image, etc.)
Building a Custom Kernel
First, you might need to prepare the build environment, follow the Building Custom Images guide. Checkout thesiderolabs/pkgs
repository:
The kernel configuration is located in the files kernel/build/config-ARCH
files.
It can be modified using the text editor, or by using the Linux kernel menuconfig
tool:
kernel/build/config-ARCH
files.
Once ready, build the kernel any out-of-tree modules (if required, e.g. zfs
) and push the artifacts to a registry:
amd64
and arm64
architectures, but you can specify a single architecture by overriding
a variable PLATFORM
:
127.0.0.1:5005/siderolabs/kernel:$TAG
with the kernel and modules.
Building Talos Base Artifacts
Follow the Building Custom Images guide to set up the Talos source code checkout. If some new kernel modules were introduced, adjust the list of the default modules compiled into the Talosinitramfs
by
editing the file hack/modules-ARCH.txt
.
Try building base Talos artifacts:
_out/vmlinuz-amd64
and _out/initramfs-amd64.xz
respectively.
Note: if building forAs a final step, produce the newarm64
, replaceamd64
witharm64
in the commands above.
imager
container image which can generate Talos boot assets:
Note: if you built the kernel for bothamd64
andarm64
, a multi-archimager
container can be built as well by specifyingINSTALLER_ARCH=all
andPLATFORM=linux/amd64,linux/arm64
.
Building Talos Boot Assets
Follow the Boot Assets guide to build Talos boot assets you might need to boot Talos: ISO,installer
image, etc.
Replace the reference to the imager
in guide with the reference to the imager
container built above.
Note: if you update theimager
container, don’t forget todocker pull
it, asdocker
caches pulled images and won’t pull the updated image automatically.