Troubleshooting Build Script Errors
Relevant source files
The following files were used as context for generating this wiki page:
The build-buggy-linux-7_0.bash script automates the retrieval, configuration, and compilation of a specific Linux 7.0 kernel. This kernel supports gokrazy amd64 environments and intentionally maintains a UDP GSO regression for Tailscale testing. Errors during the build process prevent the generation of the vmlinuz image required for virtual machine testing (vmtest).
Sources: README.md:1-8, build-buggy-linux-7_0.bash:1-23, empty.go:5-8
Build Script Execution Flow
The build script uses set -euo pipefail to ensure that any command failure stops the execution immediately. This behavior simplifies error detection by halting at the exact point of failure.
The diagram shows the sequential logic used to produce the kernel image.
Sources: build-buggy-linux-7_0.bash:2-22
Common Failure Points
Network and Extraction Failures
The script relies on curl to download the Linux 7.0 source tarball from cdn.kernel.org. If the download fails, the script exits because of the -e flag. Extraction errors typically occur if the tarball is corrupted or if the disk lacks sufficient space to hold the uncompressed linux-7.0 source tree.
| Step | Command | Potential Issue |
|---|---|---|
| Download | curl -fL | Network timeout or invalid URL |
| Extraction | tar -xf | Corruption or insufficient disk space |
| Directory Setup | cd "${srcdir}" | Permission denied or missing directory |
Sources: build-buggy-linux-7_0.bash:6-18, README.md:31-32
Configuration Merging Errors
The script appends custom configurations from config.addendum.txt to the base .config generated by make defconfig. If config.addendum.txt is missing from the repository root, the cp or cat commands will fail.
make defconfig: Generates the default x86 configuration.cat .config.addendum.txt >> .config: Injects specific drivers likeCONFIG_IGBandCONFIG_VIRTIO.make olddefconfig: Resolves dependencies and sets default values for any unassigned symbols created by the append operation.
Sources: build-buggy-linux-7_0.bash:17-20, config.addendum.txt:1-133
Compilation Hardware Constraints
Compilation uses make bzImage "-j$(nproc)" to utilize all available CPU cores. Errors during this phase often stem from:
- Missing build dependencies (gcc, flex, bison, elfutils, etc.).
- Out-of-memory (OOM) conditions caused by high parallelism on low-resource systems.
- ZSTD development headers missing when
CONFIG_KERNEL_ZSTD=yis set.
Sources: build-buggy-linux-7_0.bash:21, config.addendum.txt:133
Verification of Build Outputs
Successful execution produces a file named vmlinuz in the repository root. This file is a copy of arch/x86/boot/bzImage.
cp arch/x86/boot/bzImage "${repo_dir}/vmlinuz"
echo "wrote ${repo_dir}/vmlinuz"
Sources: build-buggy-linux-7_0.bash:22-23, README.md:10-12
Kernel Command Line and Boot Configuration
If the kernel builds but fails to boot under QEMU, verify the cmdline.txt and driver configurations. The system expects a specific root device and init path.
- Root Device:
root=/dev/sda2 - Init Process:
init=/gokrazy/init - Panic Behavior:
panic=10 oops=panic - Required Drivers: Ensure
CONFIG_VIRTIO_BLK=yandCONFIG_IGB=yare enabled inconfig.addendum.txtfor the vmtest environment to detect disks and network interfaces.
Sources: cmdline.txt:1, config.addendum.txt:83-84, 94-95, README.md:14-19
Integration with gokrazy
This module is structured as a Go package to allow gokrazy to select it as a KernelPackage. The file empty.go provides the necessary package definition. If gokrazy cannot find the kernel, ensure the module path github.com/tailscale/gokrazy-kernel-buggy-linux-7_0 is correctly referenced or replaced in the go.mod file.
Sources: empty.go:1-8, README.md:21-25
The build script and its associated configuration files provide a repeatable environment for reproducing specific networking bugs. Monitoring the exit status of the bash script and verifying the presence of the vmlinuz binary are the primary methods for ensuring a successful build.