Host kernel
This page covers the host kernel of hopbox servers: its build from kernel.org sources, its config, and its install. The host kernel is the Linux kernel of the server that runs Firecracker. The tested kernel is 6.18.57-hopbox1 on Debian 13. Firecracker supports the host kernel 6.18 but not 6.12, the kernel of Debian 13, so hopbox builds 6.18 from kernel.org sources.
| File | What it holds |
|---|---|
build/hostkernel/build.sh |
The build script. It downloads the source, checks it, and builds Debian packages. |
build/hostkernel/install.sh |
The install script. It installs the kernel package and makes it the GRUB default. |
build/hostkernel/config-6.18.57-hopbox1 |
The final kernel config. It is the same file as /boot/config-6.18.57-hopbox1 on the tested server. |
Pinned values
Section titled “Pinned values”Each script pins its versions and checksums in variables at its top. To move to a new kernel release, change these values, config-<release>, and this page in one change.
| Variable | Script | Value | Meaning |
|---|---|---|---|
KERNEL_VERSION |
build.sh |
6.18.57 |
The kernel.org release. It was the longterm 6.18 release on 2026-10-15. |
KERNEL_SHA256 |
build.sh |
5bd9acdc82ec5efc3790ae840e5aaa40dfde7efff261cf6dde902dc570acf98c |
The sha256 of linux-6.18.57.tar.xz. |
LOCAL_VERSION |
build.sh |
-hopbox1 |
The suffix of the kernel release. uname -r prints 6.18.57-hopbox1. |
GREGKH_FPR |
build.sh |
647F28654894E3BD457199BE38DBBDC86092693E |
The key of Greg Kroah-Hartman. It signs the tarball. |
AUTOSIGNER_FPR |
build.sh |
B8868C80BA62A1FFFAF5FDA9632D3A06589DA6B1 |
The key of the kernel.org checksum autosigner. It signs sha256sums.asc. |
DEBIAN_PACKAGE |
build.sh |
linux-image-6.18.15+deb13-amd64 |
The Debian package that holds the base config. It comes from trixie-backports. |
DEBIAN_DEB_SHA256 |
build.sh |
d38a7af6260782a47cd615ad717347a528b45f076245b4deabb3f1ecf8459186 |
The sha256 of the Debian package file. |
KERNEL_RELEASE |
install.sh |
6.18.57-hopbox1 |
The kernel release that the script installs. |
PACKAGE_VERSION |
install.sh |
6.18.57-1 |
The version of the Debian package that build.sh writes. |
Environment variables of build.sh
Section titled “Environment variables of build.sh”| Variable | Default | Meaning |
|---|---|---|
WORK_DIR |
$PWD/hostkernel-build |
The folder for the downloads, the source tree, and the packages. It needs about 40 GB of free space. |
JOBS |
the output of nproc |
The number of parallel make jobs. |
ALLOW_CONFIG_DRIFT |
0 |
With 1, the build goes on after make olddefconfig changes the config. |
Requirements
Section titled “Requirements”- An amd64 host with Debian 13.
- A normal user for
build.sh. The build needs no root. - The build packages in the
BUILD_DEPSlist ofbuild.sh. If one is missing,build.shprints theapt-get installcommand and stops. - Root for
install.sh. - UEFI Secure Boot off. The kernel has no Secure Boot signature.
These are the build packages:
sudo apt-get install bc bison build-essential cpio debhelper dwarves flex gawk gnupg \ kmod libdw-dev libelf-dev libncurses-dev libssl-dev python3 rsync xz-utils zstdbuild/hostkernel/build.shThe script takes these steps:
- It downloads
linux-6.18.57.tar.xz,linux-6.18.57.tar.sign, andsha256sums.ascfromcdn.kernel.org. - It checks the tarball against
KERNEL_SHA256, and it checks thatsha256sums.asclists the same sha256. - It gets the kernel.org keys over WKD into a temporary GnuPG home. The autosigner key must sign
sha256sums.asc, and the key of Greg Kroah-Hartman must sign the tarball. - It unpacks the source into
$WORK_DIR/linux-6.18.57. - It copies
config-6.18.57-hopbox1to.configand runsmake olddefconfig. If the config changes, the script prints the change withscripts/diffconfigand stops. - It runs
make bindeb-pkgand writesSHA256SUMS.debs.
The build writes these files into $WORK_DIR:
| File | What it holds |
|---|---|
linux-image-6.18.57-hopbox1_6.18.57-1_amd64.deb |
The kernel and its modules. install.sh installs only this package. |
linux-image-6.18.57-hopbox1-dbg_6.18.57-1_amd64.deb |
The debug symbols, about 1 GB. The config keeps DEBUG_INFO, as Debian does. |
linux-headers-6.18.57-hopbox1_6.18.57-1_amd64.deb |
The headers for modules outside the kernel tree. hopbox does not use them. |
linux-libc-dev_6.18.57-1_amd64.deb |
The kernel headers for user programs. hopbox does not use them. |
SHA256SUMS.debs |
The sha256 of each package. |
On the tested server, the build took 48 minutes with 12 jobs, Debian gcc 14.2.0-19, and pahole 1.30.
Config
Section titled “Config”The config starts from the Debian 6.18.15 config. build.sh config makes config-6.18.57-hopbox1 again from that base:
- It downloads the Debian package with
apt-get downloadand checks it againstDEBIAN_DEB_SHA256. If the archive no longer has the package, put the file in$WORK_DIR/dl/by hand. The script then uses that file. - It copies
/boot/config-6.18.15+deb13-amd64from the package to.configand runsmake olddefconfig. - It applies the changes below with
scripts/configand runsmake olddefconfigagain. - It writes the result to
build/hostkernel/config-6.18.57-hopbox1and prints the difference to the Debian config.
These changes are on purpose:
| Option | Debian 6.18.15 | 6.18.57-hopbox1 | Reason |
|---|---|---|---|
LOCALVERSION |
"" |
"-hopbox1" |
The release name shows a hopbox build. LOCALVERSION_AUTO stays off. |
MODULE_SIG |
y |
n |
hopbox does not sign modules. Unsigned modules on a kernel with MODULE_SIG=y mark the kernel as tainted at each load. |
MODULE_SIG_ALL |
y |
not set | It depends on MODULE_SIG. |
SECURITY_LOCKDOWN_LSM |
y |
n |
It selects MODULE_SIG. MODULE_SIG cannot go off while this option is on. |
SECURITY_LOCKDOWN_LSM_EARLY |
y |
n |
It depends on SECURITY_LOCKDOWN_LSM. |
MODULE_SIG_KEY, SYSTEM_TRUSTED_KEYS, SYSTEM_REVOCATION_KEYS |
not in the file | "" |
The build makes no signing key and embeds no key. Kconfig then drops MODULE_SIG_KEY and SYSTEM_REVOCATION_KEYS. |
Kconfig also drops the options that depend on the options above, such as CRYPTO_FIPS, the other MODULE_SIG_* options, and LOCK_DOWN_KERNEL_FORCE_*.
make olddefconfig on the build host makes these changes:
- Rust is off, because the tested server has no
rustcand nobindgen. The Rust drivers andANDROID_BINDER_IPCdrop out. - The options that exist only in the Debian kernel patches drop out, such as
LOCK_DOWN_IN_EFI_SECURE_BOOTandSECURITY_PERF_EVENTS_RESTRICT. - The options that are new in 6.18.16 to 6.18.57 take their defaults, such as
CXL_RAS=yandUNWIND_USER=y. ACPI_PLATFORM_PROFILEchanges frommtoy.
A different toolchain on the build host can change the config. For example, a host with rustc turns Rust on. Then build.sh stops at step 5 of the build.
The config has these features that hopbox needs:
| Feature | Options |
|---|---|
| KVM | CONFIG_KVM=m, CONFIG_KVM_INTEL=m, CONFIG_KVM_X86=m |
| vsock to the guest | CONFIG_VHOST_VSOCK=m, CONFIG_VHOST=m, CONFIG_VSOCKETS=m |
| tap devices | CONFIG_TUN=m |
| cgroup v2 | CONFIG_CGROUPS=y, CONFIG_MEMCG=y, CONFIG_BLK_CGROUP=y, CONFIG_CGROUP_PIDS=y, CONFIG_CPUSETS=y, CONFIG_CGROUP_BPF=y |
| nftables | CONFIG_NF_TABLES=m, CONFIG_NF_TABLES_INET=y, CONFIG_NFT_NAT=m, CONFIG_NFT_MASQ=m |
| The egress of the machines (the egress of the machines) | CONFIG_NFT_HASH=m, CONFIG_NFT_REJECT=m, CONFIG_NFT_REJECT_INET=m |
| XFS with reflink | CONFIG_XFS_FS=m. Reflink has no option in 6.18. xfs.ko always has it. |
| btrfs | CONFIG_BTRFS_FS=m |
| WireGuard | CONFIG_WIREGUARD=m |
Install
Section titled “Install”sudo build/hostkernel/install.sh /path/to/hostkernel-buildThe argument is the WORK_DIR of the build. Its default is $PWD/hostkernel-build. The script takes these steps:
- It checks that it runs as root on Debian 13 amd64.
- It checks the image package against
SHA256SUMS.debs. - It installs the image package with
dpkg -i. The package makes/boot/initrd.img-6.18.57-hopbox1and runsupdate-grub. - It writes
/etc/default/grub.d/20_hopbox_kernel.cfgand runsupdate-grubagain. - It checks that
/boot/grub/grub.cfghas the entry of the new kernel. If the entry is missing, the script removes the file of step 4, runsupdate-grub, and stops with an error.
The script does not reboot. Reboot by hand.
The file of step 4 pins the GRUB default by the ID of the menu entry. GRUB names each entry after the UUID of the root file system:
GRUB_DEFAULT="gnulinux-advanced-<root-uuid>>gnulinux-6.18.57-hopbox1-advanced-<root-uuid>"A Debian kernel upgrade through linux-image-amd64 does not change this default. The script does not edit /etc/default/grub.
After the reboot, these commands show a good host:
uname -r # 6.18.57-hopbox1cat /proc/sys/kernel/tainted # 0ls /dev/kvm /dev/vhost-vsockOn the tested server, SSH answered 187 to 319 seconds after the reboot command.
Fallback
Section titled “Fallback”The Debian kernels stay installed. They are in the “Advanced options” menu of GRUB.
To boot a Debian kernel once, run sudo grub-reboot '<entry ID>' and reboot. On the tested server, the GRUB environment block is on mdraid, and GRUB cannot clear next_entry at boot. grub-reboot prints a warning about this. After the reboot, clear it by hand:
sudo grub-editenv /boot/grub/grubenv unset next_entryTo go back to the Debian default for good, remove the pin and update GRUB:
sudo rm /etc/default/grub.d/20_hopbox_kernel.cfgsudo update-grub