Skip to content

build: fetch kernel from cdn.kernel.org static mirror - #23

Merged
toksdotdev merged 3 commits into
krunfwfrom
toks/kernel-src-cdn-mirror
Jul 27, 2026
Merged

build: fetch kernel from cdn.kernel.org static mirror#23
toksdotdev merged 3 commits into
krunfwfrom
toks/kernel-src-cdn-mirror

Conversation

@toksdotdev

@toksdotdev toksdotdev commented Jul 27, 2026

Copy link
Copy Markdown
Member

Problem

Build kernel.c fails intermittently with a 502 while fetching the kernel:

curl: (22) The requested URL returned error: 502
make: *** [Makefile:134: tarballs/linux-<ver>.tar.gz] Error 22

KERNEL_REMOTE points at the git.kernel.org cgit /snapshot/ endpoint, which regenerates a ~250 MB tarball from the git tree per request — slow (~50s even when healthy), rate-limited, and 502-prone under CI concurrency. kernel.org itself is up; only this dynamic endpoint flakes.

Fix

Fetch the static release tarball from the kernel.org CDN instead:

- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/snapshot/$(KERNEL_VERSION).tar.gz
+ https://cdn.kernel.org/pub/linux/kernel/v6.x/$(KERNEL_VERSION).tar.gz

Same .tar.gz, same top-level linux-<ver>/ dir, so KERNEL_TARBALL and tar xf are unchanged — a pure URL swap. The kernel source is identical (both are the release tag), so the patch set applies unchanged.

CI note (pre-existing, unrelated to this change)

This branch sits on krunfw HEAD (linux-6.12.96). check-kernel-version.sh now flags 6.12.98 as the latest stable and gates the build jobs. Bumping to 6.12.98, however, breaks the out-of-tree vsock-dgram patch — virtio_transport_alloc_skb gained an argument in 6.12.98:

net/vmw_vsock/virtio_transport_common.c: error: too few arguments to function 'virtio_transport_alloc_skb'

That patch update is separate maintenance, independent of this mirror swap. The cdn change itself is validated end to end: Fetch kernel source passes from the CDN, and the kernel builds from the CDN on 6.12.95 in superradcompany/microsandbox#1217's CI.

@toksdotdev
toksdotdev merged commit c5503d8 into krunfw Jul 27, 2026
8 checks passed
toksdotdev added a commit to superradcompany/microsandbox that referenced this pull request Jul 27, 2026
## Problem

`Build kernel.c` fails intermittently across CI with a 502 while
fetching the kernel:

```
curl: (22) The requested URL returned error: 502
make: *** [Makefile:134: tarballs/linux-<ver>.tar.gz] Error 22
```

libkrunfw fetched the kernel from the **git.kernel.org cgit `/snapshot/`
endpoint**, which regenerates a ~250 MB tarball from the git tree per
request. It's slow (~50s even when healthy) and rate-limited, so under
CI concurrency the cgit backend overloads and the gateway 502s.
kernel.org itself is up — only that dynamic endpoint flakes.

## Fix — mirror swap only

Bump `vendor/libkrunfw` `e0d29a8a → 56bd24f6`, which changes exactly one
thing: `KERNEL_REMOTE` from the git.kernel.org cgit snapshot to the
static **cdn.kernel.org** release tarball. **Same kernel
(`linux-6.12.95`, unchanged), same patches, same `.tar.gz` /
`linux-6.12.95/` layout** — the only delta vs `main` is where the
tarball is fetched from. The CDN mirror is cached and instant.

## Notes

- Points at libkrunfw branch commit `56bd24f6` until the cdn change
lands on `krunfw` (superradcompany/libkrunfw#23); re-point to the
`krunfw` commit after that merges.
- Fixes the recurring `Build kernel.c` 502s for all builds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant