Kernel version in RancherOS
RancherOS basically uses the standard Linux kernel, but we maintain a kernel config ourselves. Due to various feature support and security fixes, we are constantly updating the kernel version.
Building and Packaging a Kernel to be used in RancherOS
We build the kernel for RancherOS at the os-kernel repository. You can use this repository to help package your own custom kernel to be used in RancherOS.
Create a clone of the os-kernel repository to your local machine using
$ git clone https://github.com/rancher/os-kernel.git
If you want to build kernel v4.14.53, you can refer to the following command. After the build is completed, a
./dist/kernel directory will be created with the freshly built kernel tarball and headers.
$ git tag v4.14.53-rancher $ KERNEL_TAG=4.14.53 make release ...snip... ./dist/kernel/extra-linux-4.14.53-rancher-x86.tar.gz ./dist/kernel/build-linux-4.14.53-rancher-x86.tar.gz ./dist/kernel/linux-4.14.53-rancher-x86.tar.gz ./dist/kernel/config ...snip... Images ready to push: rancher/os-extras:4.14.53-rancher rancher/os-headers:4.14.53-rancher
For some users who need a custom kernel, the following information is very useful to you:
- The modules defined in
modules.listwill be packaged into the built-in modules.
- The modules defined in
modules-extra.listwill be packaged into the extra modules.
- You can modify
config/kernel-configto build the kernel modules you need.
- You can add your patches in the
os-kernelwill update these patches after downloading the kernel source.
Now you need to either upload the
./dist/kernel/linux-4.14.53-rancher-x86.tar.gz file to somewhere, or copy that file into your clone of the
rancher/os repo, as
extra-<name>.tar.gz files are used to build the
rancher/os-headers images for your RancherOS release - which you will need to tag them with a different organisation name, push them to a registry, and create custom service.yml files.
Your kernel should be packaged and published as a set of files of the following format:
<kernel-name-and-version>.tar.gzis the one KERNEL_URL in
rancher/osshould point to. It contains the kernel binary, core modules and firmware.
build-<kernel-name-and-version>.tar.gzcontains build headers to build additional modules: it is a subset of the kernel sources tarball. These files will be installed into
extra-<kernel-name-and-version>.tar.gzcontains extra modules and firmware for your kernel and should be built into a
Building a RancherOS release using the Packaged kernel files.
Create a clone of the main RancherOS repository to your local machine with a
$ git clone https://github.com/rancher/os.git
In the root of the repository, the “General Configuration” section of
Dockerfile.dapper will need to be updated. Using your favorite editor, replace the appropriate
KERNEL_URL value with a URL of your compiled custom kernel tarball. Ideally, the URL will use
# Update the URL to your own custom kernel tarball ARG KERNEL_VERSION_amd64=4.14.63-rancher ARG KERNEL_URL_amd64=https://link/xxxx
After you’ve replaced the URL with your custom kernel, you can follow the steps in building your own custom RancherOS ISO.
KERNEL_URLsettings should point to a Linux kernel, compiled and packaged in a specific way. You can fork os-kernel repository to package your own kernel.