internal/rosa: kernel artifact
All checks were successful
Test / Create distribution (push) Successful in 1m0s
Test / Sandbox (push) Successful in 2m38s
Test / Hakurei (push) Successful in 3m58s
Test / ShareFS (push) Successful in 4m4s
Test / Hpkg (push) Successful in 4m38s
Test / Sandbox (race detector) (push) Successful in 5m3s
Test / Hakurei (race detector) (push) Successful in 5m58s
Test / Flake checks (push) Successful in 1m37s
All checks were successful
Test / Create distribution (push) Successful in 1m0s
Test / Sandbox (push) Successful in 2m38s
Test / Hakurei (push) Successful in 3m58s
Test / ShareFS (push) Successful in 4m4s
Test / Hpkg (push) Successful in 4m38s
Test / Sandbox (race detector) (push) Successful in 5m3s
Test / Hakurei (race detector) (push) Successful in 5m58s
Test / Flake checks (push) Successful in 1m37s
The configuration still wants some cleanup, but this works fine as a generic kernel for now. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -41,6 +41,7 @@ const (
|
|||||||
Hakurei
|
Hakurei
|
||||||
HakureiDist
|
HakureiDist
|
||||||
IniConfig
|
IniConfig
|
||||||
|
Kernel
|
||||||
KernelHeaders
|
KernelHeaders
|
||||||
KernelSource
|
KernelSource
|
||||||
Kmod
|
Kmod
|
||||||
@@ -164,6 +165,7 @@ func ResolveName(name string) (p PArtifact, ok bool) {
|
|||||||
"hakurei": Hakurei,
|
"hakurei": Hakurei,
|
||||||
"hakurei-dist": HakureiDist,
|
"hakurei-dist": HakureiDist,
|
||||||
"iniconfig": IniConfig,
|
"iniconfig": IniConfig,
|
||||||
|
"kernel": Kernel,
|
||||||
"kernel-headers": KernelHeaders,
|
"kernel-headers": KernelHeaders,
|
||||||
"kernel-source": KernelSource,
|
"kernel-source": KernelSource,
|
||||||
"kmod": Kmod,
|
"kmod": Kmod,
|
||||||
|
|||||||
@@ -41,3 +41,83 @@ func (t Toolchain) newKernelHeaders() pkg.Artifact {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
func init() { artifactsF[KernelHeaders] = Toolchain.newKernelHeaders }
|
func init() { artifactsF[KernelHeaders] = Toolchain.newKernelHeaders }
|
||||||
|
|
||||||
|
func (t Toolchain) newKernel() pkg.Artifact {
|
||||||
|
return t.NewViaMake("kernel", kernelVersion, kernelSource, &MakeAttr{
|
||||||
|
OmitDefaults: true,
|
||||||
|
SkipConfigure: true,
|
||||||
|
|
||||||
|
// Build, install, and boot kernel before running kselftest on it.
|
||||||
|
SkipCheck: true,
|
||||||
|
|
||||||
|
Env: []string{
|
||||||
|
"PATH=/system/sbin",
|
||||||
|
},
|
||||||
|
ScriptEarly: `
|
||||||
|
install -Dm0400 \
|
||||||
|
/usr/src/.config \
|
||||||
|
/tmp/kbuild/.config
|
||||||
|
install -Dm0500 \
|
||||||
|
/usr/src/.installkernel \
|
||||||
|
/sbin/installkernel
|
||||||
|
`,
|
||||||
|
Make: []string{
|
||||||
|
"-f /usr/src/kernel/Makefile",
|
||||||
|
"O=/tmp/kbuild",
|
||||||
|
|
||||||
|
"LLVM=1",
|
||||||
|
"KBUILD_BUILD_VERSION='1-Rosa'",
|
||||||
|
"KBUILD_BUILD_TIMESTAMP='2106-02-07 06:28:15 UTC'",
|
||||||
|
"KBUILD_BUILD_USER=kbuild",
|
||||||
|
"KBUILD_BUILD_HOST=localhost",
|
||||||
|
"all",
|
||||||
|
},
|
||||||
|
ScriptInstall: `
|
||||||
|
make \
|
||||||
|
"-j$(nproc)" \
|
||||||
|
-f /usr/src/kernel/Makefile \
|
||||||
|
O=/tmp/kbuild \
|
||||||
|
LLVM=1 \
|
||||||
|
INSTALL_PATH=/work \
|
||||||
|
install \
|
||||||
|
INSTALL_MOD_PATH=/work \
|
||||||
|
modules_install
|
||||||
|
rm -v /work/lib/modules/` + kernelVersion + `/build
|
||||||
|
`,
|
||||||
|
|
||||||
|
Paths: []pkg.ExecPath{
|
||||||
|
pkg.Path(AbsUsrSrc.Append(
|
||||||
|
".config",
|
||||||
|
), false, pkg.NewFile(".config", kernelConfig)),
|
||||||
|
pkg.Path(AbsUsrSrc.Append(
|
||||||
|
".installkernel",
|
||||||
|
), false, pkg.NewFile("installkernel", []byte(`#!/bin/sh -e
|
||||||
|
echo "Installing linux $1..."
|
||||||
|
cp -av "$2" "$4"
|
||||||
|
cp -av "$3" "$4"
|
||||||
|
`))),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
t.Load(Flex),
|
||||||
|
t.Load(Bison),
|
||||||
|
t.Load(M4),
|
||||||
|
t.Load(Tar),
|
||||||
|
t.Load(Perl),
|
||||||
|
t.Load(BC),
|
||||||
|
t.Load(Sed),
|
||||||
|
t.Load(Gawk),
|
||||||
|
t.Load(Coreutils),
|
||||||
|
t.Load(Diffutils),
|
||||||
|
|
||||||
|
t.Load(XZ),
|
||||||
|
t.Load(Zlib),
|
||||||
|
t.Load(Gzip),
|
||||||
|
t.Load(Bzip2),
|
||||||
|
t.Load(Zstd),
|
||||||
|
t.Load(Kmod),
|
||||||
|
t.Load(Elfutils),
|
||||||
|
t.Load(OpenSSL),
|
||||||
|
t.Load(KernelHeaders),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
func init() { artifactsF[Kernel] = Toolchain.newKernel }
|
||||||
|
|||||||
12512
internal/rosa/kernel_amd64.config
Normal file
12512
internal/rosa/kernel_amd64.config
Normal file
File diff suppressed because it is too large
Load Diff
6
internal/rosa/kernel_amd64.go
Normal file
6
internal/rosa/kernel_amd64.go
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
package rosa
|
||||||
|
|
||||||
|
import _ "embed"
|
||||||
|
|
||||||
|
//go:embed kernel_amd64.config
|
||||||
|
var kernelConfig []byte
|
||||||
Reference in New Issue
Block a user