Build Kernel
On following build steps, a vmlinux binary of about 30MB will get built. It can be used with firecracker-vm by specifying in kernel_image_path
.
Build Steps
- Checkout latest code in current directory or download from https://www.kernel.org/
- Create
.config
file, use firecracker minimal config
wget -O .config \
https://raw.githubusercontent.com/firecracker-microvm/firecracker/refs/heads/main/resources/guest_configs/microvm-kernel-ci-x86_64-6.1.config
- Add
pcie
andvirtio
related flags in.config
, without these kernel won't boot (required for attaching block-devices)
## PCIE flags
CONFIG_BLK_MQ_PCI=y
CONFIG_PCI=y
CONFIG_PCI_MMCONFIG=y
CONFIG_PCI_MSI=y
CONFIG_PCIEPORTBUS=y
CONFIG_VIRTIO_PCI=y
CONFIG_PCI_HOST_COMMON=y
CONFIG_PCI_HOST_GENERIC=y
# VIRTIO flags
CONFIG_VIRTIO_MEM=y
CONFIG_STRICT_DEVMEM=y
- Do oldconfig
- Perform build