aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-01-26 21:20:52 +0900
committerOphestra <cat@gensokyo.uk>2026-01-26 21:20:52 +0900
commit4356f978aa32d903b70f8408375a609091eb0ddb (patch)
treedcd4ca5c50e87697fe3a9d54254b62413fd432b5
parent4f17dad645a31e7971b956267aee8f983c59e1ec (diff)
internal/rosa: kernel patching
The side effect of this is to work around zfs performance issue with chmod on overlay mount. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--internal/rosa/kernel.go19
1 files changed, 11 insertions, 8 deletions
diff --git a/internal/rosa/kernel.go b/internal/rosa/kernel.go
index 7f924904..a61b85eb 100644
--- a/internal/rosa/kernel.go
+++ b/internal/rosa/kernel.go
@@ -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