···77## ✨ Features
8899- Builds any stable Linux kernel version (e.g., `6.1`, `6.1.12`, `6.1.y`)
1010+- Supports multiple architectures (x86_64, aarch64)
1111+- Enhanced kernel configuration handling with customizable options
1012- Uses a custom `.config` for reproducible builds
1111-- Outputs a ready-to-use `vmlinux-X.Y` file
1313+- Outputs a ready-to-use `vmlinux-X.Y-[arch]` file
1214- Written in TypeScript with Deno for better type safety and cross-platform compatibility
1315- Colored output using Chalk for improved readability
1416- Easily integrated into CI pipelines (e.g., GitHub Actions)
···1820### System Dependencies
19212022Ensure you have the following dependencies installed:
2323+2124```bash
2225sudo apt-get install -y git build-essential flex bison libncurses5-dev \
2326libssl-dev gcc bc libelf-dev pahole
···3639## 🚀 Usage
37403841```bash
4242+# Build for x86_64 (default)
3943deno run -A jsr:@tsiry/vmlinux-builder 6.17.7
4044```
4145···4650- `6.1.y` - Latest from maintenance branch
4751- `v6.1.12` - Version with 'v' prefix (automatically normalized)
48525353+### Kernel Configuration
5454+5555+The tool provides enhanced kernel configuration handling with:
5656+5757+- Support for TUN and TUN_VNET_CROSS_LE
5858+- Various netfilter options enabled
5959+- Customizable configuration through environment variables
6060+- Reproducible builds with consistent config options
6161+4962### Example output
5050-```
5151-Building vmlinux for Linux kernel 6.16
6363+6464+```sh
6565+Building vmlinux for Linux kernel 6.16 (x86_64)
5266vmlinux built successfully!
5367You can find the vmlinux file in /path/to/linux-stable/vmlinux-6.16.x86_64
5468```
···5872This repo includes a GitHub Actions workflow (`.github/workflows/ci.yml`) that:
59736074- Triggers on tag push (e.g. `git tag 6.16.y && git push origin 6.16.y`)
6161-- Builds the vmlinux for that version
6262-- Publishes the resulting `vmlinux-X.Y` as a GitHub Release asset
7575+- Builds the vmlinux for both x86_64 and aarch64 architectures
7676+- Publishes the resulting `vmlinux-X.Y-[arch]` files as GitHub Release assets
7777+- Includes SHA256 checksums for all released files
7878+7979+## 🧩 Config API Usage
8080+8181+The `config.ts` module provides a type-safe API for parsing, validating, extracting, and serializing Linux kernel `.config` files.
63826464-## 🔧 Development
8383+### Parse a kernel config file
8484+8585+```ts
8686+import { KernelConfigParser } from '@tsiry/vmlinux-builder';
8787+const content = await Deno.readTextFile('path/to/.config');
8888+const config = KernelConfigParser.parse(content);
8989+```
9090+9191+### Extract config categories
9292+9393+```ts
9494+import { KernelConfigParser } from '@tsiry/vmlinux-builder';
9595+const processor = KernelConfigParser.extractProcessorConfig(config);
9696+const security = KernelConfigParser.extractSecurityConfig(config);
9797+const networking = KernelConfigParser.extractNetworkingConfig(config);
9898+const filesystem = KernelConfigParser.extractFilesystemConfig(config);
9999+```
100100+101101+### Serialize config to different formats
102102+103103+```ts
104104+import { KernelConfigSerializer } from '@tsiry/vmlinux-builder';
105105+const asConfig = KernelConfigSerializer.toConfig(config); // .config format
106106+const asJSON = KernelConfigSerializer.toJSON(config);
107107+const asTOML = KernelConfigSerializer.toTOML(config);
108108+const asYAML = KernelConfigSerializer.toYAML(config);
109109+```
110110+111111+### Validate a config
112112+113113+```ts
114114+import { validateKernelConfig } from '@tsiry/vmlinux-builder';
115115+const result = validateKernelConfig(config);
116116+if (!result.success) {
117117+ throw new Error('Invalid kernel config');
118118+}
119119+```
120120+121121+See `config.ts` for more advanced usage and options.
6512266123The script is written in TypeScript and runs on Deno. Key features:
6712468125- **Type-safe**: Full TypeScript support with type checking
6969-- **Cross-platform**: Works on Linux, macOS, and Windows (WSL)
70126- **Modern**: Uses Deno's native APIs for file operations and process management
71127- **Colored output**: Enhanced user experience with Chalk
72128