internal/rosa: expose kernel source
All checks were successful
Test / Create distribution (push) Successful in 1m0s
Test / Sandbox (push) Successful in 2m52s
Test / Hakurei (push) Successful in 4m7s
Test / ShareFS (push) Successful in 4m8s
Test / Hpkg (push) Successful in 4m36s
Test / Sandbox (race detector) (push) Successful in 5m11s
Test / Hakurei (race detector) (push) Successful in 6m44s
Test / Flake checks (push) Successful in 3m12s
All checks were successful
Test / Create distribution (push) Successful in 1m0s
Test / Sandbox (push) Successful in 2m52s
Test / Hakurei (push) Successful in 4m7s
Test / ShareFS (push) Successful in 4m8s
Test / Hpkg (push) Successful in 4m36s
Test / Sandbox (race detector) (push) Successful in 5m11s
Test / Hakurei (race detector) (push) Successful in 6m44s
Test / Flake checks (push) Successful in 3m12s
This also removes the unused kernel helper. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -39,6 +39,7 @@ const (
|
||||
HakureiDist
|
||||
IniConfig
|
||||
KernelHeaders
|
||||
KernelSource
|
||||
Kmod
|
||||
LibXau
|
||||
Libexpat
|
||||
@@ -153,6 +154,7 @@ func ResolveName(name string) (p PArtifact, ok bool) {
|
||||
"hakurei-dist": HakureiDist,
|
||||
"iniconfig": IniConfig,
|
||||
"kernel-headers": KernelHeaders,
|
||||
"kernel-source": KernelSource,
|
||||
"kmod": Kmod,
|
||||
"libXau": LibXau,
|
||||
"libexpat": Libexpat,
|
||||
|
||||
@@ -1,44 +1,38 @@
|
||||
package rosa
|
||||
|
||||
import (
|
||||
"slices"
|
||||
import "hakurei.app/internal/pkg"
|
||||
|
||||
"hakurei.app/internal/pkg"
|
||||
)
|
||||
const kernelVersion = "6.12.73"
|
||||
|
||||
// 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.12.73"
|
||||
checksum = "29oUBJKF1ULIv1-XQLpEUUc3LgjUSmyvOSskG37MYUcBlBjMk7RcbCTLrD7UfSM6"
|
||||
)
|
||||
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",
|
||||
func (t Toolchain) newKernelSource() pkg.Artifact {
|
||||
const checksum = "29oUBJKF1ULIv1-XQLpEUUc3LgjUSmyvOSskG37MYUcBlBjMk7RcbCTLrD7UfSM6"
|
||||
return t.New("kernel-"+kernelVersion+"-src", 0, nil, nil, nil, `
|
||||
mkdir -p /work/usr/src/
|
||||
cp -r /usr/src/linux /work/usr/src/
|
||||
chmod -R +w /work/usr/src/linux/
|
||||
`, pkg.Path(AbsUsrSrc.Append("linux"), false, pkg.NewHTTPGetTar(
|
||||
nil, "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/"+
|
||||
"snapshot/linux-"+kernelVersion+".tar.gz",
|
||||
mustDecode(checksum),
|
||||
pkg.TarGzip,
|
||||
), false, patches...,
|
||||
)))
|
||||
}
|
||||
func init() { artifactsF[KernelSource] = Toolchain.newKernelSource }
|
||||
|
||||
func (t Toolchain) newKernelHeaders() pkg.Artifact {
|
||||
return t.newKernel(TEarly, nil, `
|
||||
make "-j$(nproc)" \
|
||||
return t.New("kernel-headers-"+kernelVersion, TEarly, []pkg.Artifact{
|
||||
t.Load(Make),
|
||||
t.Load(Rsync),
|
||||
|
||||
t.Load(KernelSource),
|
||||
}, nil, nil, `
|
||||
cd /usr/src/linux
|
||||
make \
|
||||
"-j$(nproc)" \
|
||||
LLVM=1 \
|
||||
HOSTLDFLAGS="${LDFLAGS}" \
|
||||
INSTALL_HDR_PATH=/work/system \
|
||||
headers_install
|
||||
`, t.Load(Rsync))
|
||||
`)
|
||||
}
|
||||
func init() { artifactsF[KernelHeaders] = Toolchain.newKernelHeaders }
|
||||
|
||||
Reference in New Issue
Block a user