internal/rosa: kernel headers
All checks were successful
Test / Create distribution (push) Successful in 55s
Test / Sandbox (push) Successful in 3m11s
Test / ShareFS (push) Successful in 5m20s
Test / Sandbox (race detector) (push) Successful in 5m35s
Test / Hpkg (push) Successful in 5m39s
Test / Hakurei (push) Successful in 6m33s
Test / Hakurei (race detector) (push) Successful in 8m11s
Test / Flake checks (push) Successful in 1m56s
All checks were successful
Test / Create distribution (push) Successful in 55s
Test / Sandbox (push) Successful in 3m11s
Test / ShareFS (push) Successful in 5m20s
Test / Sandbox (race detector) (push) Successful in 5m35s
Test / Hpkg (push) Successful in 5m39s
Test / Hakurei (push) Successful in 6m33s
Test / Hakurei (race detector) (push) Successful in 8m11s
Test / Flake checks (push) Successful in 1m56s
This is required by the toolchain and many other programs. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
41
internal/rosa/kernel.go
Normal file
41
internal/rosa/kernel.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package rosa
|
||||
|
||||
import (
|
||||
"slices"
|
||||
|
||||
"hakurei.app/internal/pkg"
|
||||
)
|
||||
|
||||
// newKernel is a helper for interacting with Kbuild.
|
||||
func (t Toolchain) newKernel(
|
||||
script string,
|
||||
extra ...pkg.Artifact,
|
||||
) pkg.Artifact {
|
||||
const (
|
||||
version = "6.18.5"
|
||||
checksum = "-V1e1WWl7HuePkmm84sSKF7nLuHfUs494uNMzMqXEyxcNE_PUE0FICL0oGWn44mM"
|
||||
)
|
||||
return t.New("kernel-"+version, slices.Concat([]pkg.Artifact{
|
||||
t.NewMake(),
|
||||
}, extra), nil, nil, `
|
||||
export LLVM=1
|
||||
export HOSTCFLAGS="${ROSA_CFLAGS}"
|
||||
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,
|
||||
)))
|
||||
}
|
||||
|
||||
// NewKernelHeaders returns a [pkg.Artifact] containing kernel headers.
|
||||
func (t Toolchain) NewKernelHeaders() pkg.Artifact {
|
||||
return t.newKernel(`
|
||||
make "-j$(nproc)" \
|
||||
INSTALL_HDR_PATH=/work/system \
|
||||
headers_install
|
||||
`, t.NewRsync())
|
||||
}
|
||||
Reference in New Issue
Block a user