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
|
HakureiDist
|
||||||
IniConfig
|
IniConfig
|
||||||
KernelHeaders
|
KernelHeaders
|
||||||
|
KernelSource
|
||||||
Kmod
|
Kmod
|
||||||
LibXau
|
LibXau
|
||||||
Libexpat
|
Libexpat
|
||||||
@@ -153,6 +154,7 @@ func ResolveName(name string) (p PArtifact, ok bool) {
|
|||||||
"hakurei-dist": HakureiDist,
|
"hakurei-dist": HakureiDist,
|
||||||
"iniconfig": IniConfig,
|
"iniconfig": IniConfig,
|
||||||
"kernel-headers": KernelHeaders,
|
"kernel-headers": KernelHeaders,
|
||||||
|
"kernel-source": KernelSource,
|
||||||
"kmod": Kmod,
|
"kmod": Kmod,
|
||||||
"libXau": LibXau,
|
"libXau": LibXau,
|
||||||
"libexpat": Libexpat,
|
"libexpat": Libexpat,
|
||||||
|
|||||||
@@ -1,44 +1,38 @@
|
|||||||
package rosa
|
package rosa
|
||||||
|
|
||||||
import (
|
import "hakurei.app/internal/pkg"
|
||||||
"slices"
|
|
||||||
|
|
||||||
"hakurei.app/internal/pkg"
|
const kernelVersion = "6.12.73"
|
||||||
)
|
|
||||||
|
|
||||||
// newKernel is a helper for interacting with Kbuild.
|
func (t Toolchain) newKernelSource() pkg.Artifact {
|
||||||
func (t Toolchain) newKernel(
|
const checksum = "29oUBJKF1ULIv1-XQLpEUUc3LgjUSmyvOSskG37MYUcBlBjMk7RcbCTLrD7UfSM6"
|
||||||
flag int,
|
return t.New("kernel-"+kernelVersion+"-src", 0, nil, nil, nil, `
|
||||||
patches [][2]string,
|
mkdir -p /work/usr/src/
|
||||||
script string,
|
cp -r /usr/src/linux /work/usr/src/
|
||||||
extra ...pkg.Artifact,
|
chmod -R +w /work/usr/src/linux/
|
||||||
) pkg.Artifact {
|
`, pkg.Path(AbsUsrSrc.Append("linux"), false, pkg.NewHTTPGetTar(
|
||||||
const (
|
nil, "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/"+
|
||||||
version = "6.12.73"
|
"snapshot/linux-"+kernelVersion+".tar.gz",
|
||||||
checksum = "29oUBJKF1ULIv1-XQLpEUUc3LgjUSmyvOSskG37MYUcBlBjMk7RcbCTLrD7UfSM6"
|
mustDecode(checksum),
|
||||||
)
|
pkg.TarGzip,
|
||||||
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 init() { artifactsF[KernelSource] = Toolchain.newKernelSource }
|
||||||
|
|
||||||
func (t Toolchain) newKernelHeaders() pkg.Artifact {
|
func (t Toolchain) newKernelHeaders() pkg.Artifact {
|
||||||
return t.newKernel(TEarly, nil, `
|
return t.New("kernel-headers-"+kernelVersion, TEarly, []pkg.Artifact{
|
||||||
make "-j$(nproc)" \
|
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 \
|
INSTALL_HDR_PATH=/work/system \
|
||||||
headers_install
|
headers_install
|
||||||
`, t.Load(Rsync))
|
`)
|
||||||
}
|
}
|
||||||
func init() { artifactsF[KernelHeaders] = Toolchain.newKernelHeaders }
|
func init() { artifactsF[KernelHeaders] = Toolchain.newKernelHeaders }
|
||||||
|
|||||||
Reference in New Issue
Block a user