Kernel Command Line Configuration
Relevant source files
The following files were used as context for generating this wiki page:
The kernel command line configuration defines the runtime parameters for the Linux 7.0 amd64 kernel. This project packages a specific kernel version to preserve a UDP GSO regression for regression testing within the Tailscale environment. The command line ensures the kernel boots into the gokrazy init system and handles system failures predictably.
Sources: README.md:1-6, empty.go:7-9
Boot Parameters and Runtime Logic
The configuration file cmdline.txt contains a single string of parameters passed to the kernel at boot time. These parameters control the root filesystem location, the initial process, and error handling behavior.
Filesystem and Init Initialization
The kernel mounts the second partition of the first SCSI/SATA disk as the root filesystem in read-only mode. It then executes the gokrazy-specific init binary.
- Root Partition:
root=/dev/sda2identifies the boot device. - Mount State:
roensures the partition remains read-only during the early boot phase. - Init Process:
init=/gokrazy/initbypasses standard init systems like systemd or SysVinit.
Sources: cmdline.txt:1
Error Handling and Fault Tolerance
Two specific parameters manage kernel-level failures to ensure the environment remains manageable during automated testing.
- Panic Timeout:
panic=10instructs the kernel to wait 10 seconds before rebooting after a panic occurs. - Oops Handling:
oops=panicforces the kernel to treat a kernel "oops" (a non-fatal error) as a fatal panic.
Sources: cmdline.txt:1
Build Integration and Hardware Support
The command line parameters complement the compile-time configuration defined in config.addendum.txt. The build process merges these settings to produce the final vmlinuz image.
The diagram shows how the build script integrates the addendum configuration into the standard kernel build flow.
Sources: build-buggy-linux-7_0.bash:17-26
Hardware and Driver Requirements
The command line assumes an environment supported by the drivers enabled in the kernel configuration. The project specifically targets QEMU q35 environments and requires Virtio and Intel igb support for network mitigation tests.
| Parameter | Type | Purpose |
|---|---|---|
root | Device Path | Specifies /dev/sda2 as the root partition. |
ro | Flag | Mounts the root filesystem as read-only. |
init | File Path | Sets /gokrazy/init as the first process. |
panic | Seconds | Triggers a reboot 10 seconds after a panic. |
oops | Mode | Forces a panic on kernel oops. |
Sources: cmdline.txt:1, README.md:11-15, config.addendum.txt:77-88
Networking and Feature Support
The kernel command line operates alongside advanced networking features enabled in the kernel. These features include support for WireGuard, Tailscale TUN devices, and nftables.
Network Mitigation Testing
The kernel intentionally includes a UDP GSO regression. The igb driver configuration allows the system to advertise tx-udp-segmentation and tx-gso-partial flags, which are necessary for the diagnostic tests performed by the vmtest image.
The sequence diagram illustrates the flow from boot parameter parsing to the initialization of networking drivers used in bug reproduction.
Sources: README.md:1-15, config.addendum.txt:86-88, cmdline.txt:1
Summary of Kernel Configuration Components
- Squashfs Support: Enabled for the root filesystem via
CONFIG_SQUASHFS=y. - Virtio Drivers: Enabled for QEMU block devices and networking via
CONFIG_VIRTIO_BLK=yandCONFIG_VIRTIO_NET=y. - Netfilter/nftables: Extensive support enabled for network plumbing and NAT.
- TCP BBR: Set as the default congestion control mechanism.
Sources: config.addendum.txt:10-13, config.addendum.txt:72-84, config.addendum.txt:127-129
The combination of the specific boot parameters in cmdline.txt and the extensive feature list in config.addendum.txt creates a controlled environment for exercising network regressions in the Linux 7.0 kernel.