Local Development Setup
Relevant source files
The following files were used as context for generating this wiki page:
The gokrazy-kernel-buggy-linux-7_0 project provides a Linux 7.0 amd64 kernel package specifically for Tailscale natlab/vmtest. It preserves a specific UDP GSO regression to test mitigation behaviors in guest environments. This package functions as a gokrazy KernelPackage, enabling developers to run and test kernels within QEMU environments.
Sources: README.md:3-8, empty.go:6-7
Rebuilding the Kernel
You rebuild the kernel image locally using the provided automation script. This process fetches the upstream Linux source and applies custom configurations.
Build Workflow
The build script automates the retrieval, configuration, and compilation of the kernel.
The diagram shows the sequential steps from source acquisition to the generation of the vmlinuz binary.
Sources: build-buggy-linux-7_0.bash:4-22
Rebuild Procedure
- Run the build script from the repository root:
./build-buggy-linux-7_0.bash - The script downloads the kernel source from
cdn.kernel.orgif it is not present. - The script unpacks the source into the
linux-7.0directory. - The system generates a
.configfile by combiningdefconfigwithconfig.addendum.txt. - The build process outputs the final kernel to
./vmlinuz.
Sources: build-buggy-linux-7_0.bash:1-23, README.md:27-31
Integration and Module Substitution
You integrate this kernel into Go projects as a gokrazy KernelPackage. For local development, you use Go module replacement to point to your local checkout.
Local Replacement
To use a local version before publishing, add a replace directive to your go.mod file.
| Action | Command/Directive |
|---|---|
| Standard Import | github.com/tailscale/gokrazy-kernel-buggy-linux-7_0 |
| Local Replace | replace github.com/tailscale/gokrazy-kernel-buggy-linux-7_0 => ../github.com/tailscale/gokrazy-kernel-buggy-linux-7_0 |
Sources: README.md:19-25
Kernel Configuration and Features
The kernel includes specific drivers and subsystems required for vmtest and Tailscale operations. These are defined in the configuration addendum.
Key Subsystems
The following table summarizes critical kernel features enabled for this build:
| Category | Features Enabled | Configuration Flag (Example) |
|---|---|---|
| Networking | IPv6, nftables, WireGuard, TUN | CONFIG_WIREGUARD=y |
| Virtualization | Virtio PCI, Block, Net, and RNG | CONFIG_VIRTIO_PCI=y |
| Hardware | Intel igb network driver, PCI, MSI | CONFIG_IGB=y |
| File Systems | Squashfs, OverlayFS | CONFIG_SQUASHFS=y |
| Optimization | TCP BBR Congestion Control | CONFIG_TCP_CONG_BBR=y |
Sources: config.addendum.txt:1-121
Diagnostic Requirements
The vmtest diagnostic checks specific capabilities of the Intel igb interface. The guest kernel must advertise:
tx-udp-segmentationtx-gso-partial
Sources: README.md:12-17
Boot Configuration
The kernel uses a specific command line for initialization within the gokrazy environment.
Command Line Parameters
The cmdline.txt file defines the boot arguments:
root=/dev/sda2 ro init=/gokrazy/init panic=10 oops=panic
root=/dev/sda2: Specifies the root partition.init=/gokrazy/init: Directs the kernel to the gokrazy init system.panic=10: Sets a 10-second delay before rebooting on panic.
Sources: cmdline.txt:1
Summary
The local development setup focuses on rebuilding a specialized Linux 7.0 kernel that maintains a UDP GSO bug for testing purposes. Developers manage the environment through a Bash-based build process and integrate the resulting kernel package into Go projects using standard module replacement techniques. The configuration ensures compatibility with QEMU q35 and provides the necessary networking and virtualization drivers for Tailscale's test infrastructure.