name: update-kernel-headers
description: Update cerisier/kernel-headers for new Linux kernel versions: refresh kernel.org version lists, build missing header archives with Docker, publish GitHub releases, commit main-branch version metadata before switching to gh-pages, regenerate the hosted pages/index, and support new kernel majors.
Update Kernel Headers
Overview
Use this skill to refresh Linux kernel header releases in cerisier/kernel-headers. The repo is script-driven: versions.sh discovers latest patch releases, build.sh builds only newly-added versions and skips existing build/<version> directories, archive.sh publishes releases, and pages.sh regenerates gh-pages.
Safety
- Check
git status --short --branch first. Do not overwrite existing untracked generated output such as build/, dist/, or gh-pages-out/.
- Do source work on
main; pages.sh switches to gh-pages.
- Keep the version-file diff until after
build.sh and archive.sh unless passing explicit versions/directories.
- Commit
kernel_versions.txt, kernel_versions_latest_patch.txt, and any Dockerfile/script support changes on main before running pages.sh; otherwise git checkout gh-pages can refuse to overwrite local changes.
- Use
gh for release inspection and publishing.
Refresh Versions
Run:
./versions.sh
git diff -- kernel_versions.txt kernel_versions_latest_patch.txt
versions.sh reads kernel.org directories and writes:
kernel_versions.txt: all discovered kernel releases
kernel_versions_latest_patch.txt: latest patch for each minor
The added lines in kernel_versions_latest_patch.txt drive default build.sh and archive.sh.
Support New Majors
Before building a new major version, confirm build.sh has a matching branch:
elif [[ "$version" == 7.* ]]; then
DOCKERFILE="7.x/Dockerfile"
If missing, add <major>.x/Dockerfile, usually by copying the newest supported major's Dockerfile first, then build and adjust only if headers fail.
Build
Default mode builds added versions from the diff:
./build.sh
build.sh skips any version already present under build/<version>.
To build one version explicitly:
./build.sh <kernel-version>
Inspect output:
find build/<kernel-version> -maxdepth 2 -type d | sort
Expected architectures are the supported set from README.md: alpha, arc, arm, arm64, csky, loongarch, m68k, mips, openrisc, powerpc, riscv, s390, sh, sparc, x86, when present in the kernel source.
Publish Releases
Default mode publishes built directories for added versions from the diff:
./archive.sh
To publish one already-built version explicitly:
./archive.sh build/<kernel-version>
archive.sh creates tag <kernel-version>-YYYYMMDD, uploads full-version and per-architecture .tar.gz/.tar.zst assets, uploads sha256sums.txt, then removes local archive files. It does not skip existing tags/releases; check first if rerunning:
gh release view <kernel-version>-YYYYMMDD --repo cerisier/kernel-headers
Commit Before Pages
After build and archive, commit source-branch metadata before running pages.sh:
git status --short
git add kernel_versions.txt kernel_versions_latest_patch.txt
git add build.sh '<major>.x/Dockerfile'
git commit -m "chore: update kernel header versions [agent]"
This step matters because pages.sh runs git checkout gh-pages; uncommitted changes from versions.sh can block that checkout.
Regenerate Pages
Run:
./pages.sh
pages.sh fetches releases with gh, writes gh-pages-out/, checks out gh-pages, replaces the branch contents, commits index.html, per-version pages, and index.json, then pushes.
After pages.sh, return to main if more source work is needed:
git checkout main
Verify
Check the hosted index includes new versions:
curl -s -L https://cerisier.github.io/kernel-headers/index.json | jq '."<kernel-version>" | keys'