All checks were successful
Test / Create distribution (push) Successful in 1m0s
Test / Sandbox (push) Successful in 2m52s
Test / Hakurei (push) Successful in 5m6s
Test / ShareFS (push) Successful in 5m15s
Test / Hpkg (push) Successful in 5m55s
Test / Sandbox (race detector) (push) Successful in 6m15s
Test / Hakurei (race detector) (push) Successful in 7m16s
Test / Flake checks (push) Successful in 2m35s
This is a variant of toybox with unfinished tools enabled, for artifacts that will end up in a dependency loop without them. Signed-off-by: Ophestra <cat@gensokyo.uk>
45 lines
1.1 KiB
Go
45 lines
1.1 KiB
Go
package rosa
|
|
|
|
import (
|
|
"slices"
|
|
|
|
"hakurei.app/internal/pkg"
|
|
)
|
|
|
|
// newKernel is a helper for interacting with Kbuild.
|
|
func (t Toolchain) newKernel(
|
|
flag int,
|
|
patches [][2]string,
|
|
script string,
|
|
extra ...pkg.Artifact,
|
|
) pkg.Artifact {
|
|
const (
|
|
version = "6.18.5"
|
|
checksum = "-V1e1WWl7HuePkmm84sSKF7nLuHfUs494uNMzMqXEyxcNE_PUE0FICL0oGWn44mM"
|
|
)
|
|
return t.New("kernel-"+version, flag, slices.Concat([]pkg.Artifact{
|
|
t.Load(Make),
|
|
}, extra), nil, nil, `
|
|
export LLVM=1
|
|
export HOSTLDFLAGS="${LDFLAGS}"
|
|
cd /usr/src/linux
|
|
`+script, pkg.Path(AbsUsrSrc.Append("linux"), true, t.NewPatchedSource(
|
|
"kernel", version, 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(TEarly, nil, `
|
|
make "-j$(nproc)" \
|
|
INSTALL_HDR_PATH=/work/system \
|
|
headers_install
|
|
`, t.Load(Rsync))
|
|
}
|
|
func init() { artifactsF[KernelHeaders] = Toolchain.newKernelHeaders }
|