Simple script and config (type-safe) for building custom Linux kernels for Firecracker MicroVMs
1.6K
š¦ vmlinux-builder is a lightweight TypeScript/Deno-based tool to fetch, configure, and build the Linux kernel vmlinux image for a given version ā ideal for use with Firecracker microVMs or other kernel-related debugging/testing tasks.
6.1, 6.1.12, 6.1.y).config for reproducible buildsvmlinux-X.Y-[arch] fileEnsure you have the following dependencies installed:
sudo apt-get install -y git build-essential flex bison libncurses5-dev \
libssl-dev gcc bc libelf-dev pahole
Install Deno if you haven't already:
curl -fsSL https://deno.land/install.sh | sh
Or follow the official Deno installation guideā .
deno run -A jsr:@tsiry/vmlinux-builder 6.17.7
Or with docker:
docker volume create linux-build
docker run --rm -it -v linux-build:/app tsiry/vmlinux-builder:latest 6.17.7
6.1 - Major.Minor version6.1.12 - Specific patch version6.1.y - Latest from maintenance branchv6.1.12 - Version with 'v' prefix (automatically normalized)The tool provides enhanced kernel configuration handling with:
Building vmlinux for Linux kernel 6.16 (x86_64)
vmlinux built successfully!
You can find the vmlinux file in /path/to/linux-stable/vmlinux-6.16.x86_64
This repo includes a GitHub Actions workflow (.github/workflows/ci.yml) that:
git tag 6.16.y && git push origin 6.16.y)vmlinux-X.Y-[arch] files as GitHub Release assetsThe config.ts module provides a type-safe API for parsing, validating, extracting, and serializing Linux kernel .config files.
import { KernelConfigParser } from '@tsiry/vmlinux-builder';
const content = await Deno.readTextFile('path/to/.config');
const config = KernelConfigParser.parse(content);
import { KernelConfigParser } from '@tsiry/vmlinux-builder';
const processor = KernelConfigParser.extractProcessorConfig(config);
const security = KernelConfigParser.extractSecurityConfig(config);
const networking = KernelConfigParser.extractNetworkingConfig(config);
const filesystem = KernelConfigParser.extractFilesystemConfig(config);
import { KernelConfigSerializer } from '@tsiry/vmlinux-builder';
const asConfig = KernelConfigSerializer.toConfig(config); // .config format
const asJSON = KernelConfigSerializer.toJSON(config);
const asTOML = KernelConfigSerializer.toTOML(config);
const asYAML = KernelConfigSerializer.toYAML(config);
import { validateKernelConfig } from '@tsiry/vmlinux-builder';
const result = validateKernelConfig(config);
if (!result.success) {
throw new Error('Invalid kernel config');
}
See config.ts for more advanced usage and options.
The script is written in TypeScript and runs on Deno. Key features:
This project is licensed under the MIT License. See the LICENSEā file for details.
Content type
Image
Digest
sha256:e1619f3d9ā¦
Size
221.6 MB
Last updated
about 1 month ago
docker pull tsiry/vmlinux-builder