internal/rosa: kernel patching
All checks were successful
Test / Create distribution (push) Successful in 50s
Test / Sandbox (push) Successful in 2m44s
Test / Hakurei (push) Successful in 3m56s
Test / ShareFS (push) Successful in 4m8s
Test / Hpkg (push) Successful in 4m43s
Test / Sandbox (race detector) (push) Successful in 5m12s
Test / Hakurei (race detector) (push) Successful in 6m5s
Test / Flake checks (push) Successful in 1m57s

The side effect of this is to work around zfs performance issue with chmod on overlay mount.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-26 21:20:52 +09:00
parent 4f17dad645
commit 4356f978aa

View File

@@ -8,6 +8,7 @@ import (
// newKernel is a helper for interacting with Kbuild.
func (t Toolchain) newKernel(
patches [][2]string,
script string,
extra ...pkg.Artifact,
) pkg.Artifact {
@@ -20,18 +21,20 @@ func (t Toolchain) newKernel(
}, extra), nil, nil, `
export LLVM=1
export HOSTLDFLAGS="${LDFLAGS}"
chmod -R +w /usr/src/linux && cd /usr/src/linux
`+script, pkg.Path(AbsUsrSrc.Append("linux"), true, pkg.NewHTTPGetTar(
nil,
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/"+
"snapshot/linux-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
cd /usr/src/linux
`+script, pkg.Path(AbsUsrSrc.Append("linux"), true, t.NewPatchedSource(
"kernel", pkg.NewHTTPGetTar(
nil,
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/"+
"snapshot/linux-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), false, patches...,
)))
}
func (t Toolchain) newKernelHeaders() pkg.Artifact {
return t.newKernel(`
return t.newKernel(nil, `
make "-j$(nproc)" \
INSTALL_HDR_PATH=/work/system \
headers_install