forked from rosa/hakurei
The stage0 toolchain no longer requires bundled dependencies other than the bare toolchain and environment itself. Signed-off-by: Ophestra <cat@gensokyo.uk>
58 lines
1.3 KiB
Go
58 lines
1.3 KiB
Go
package rosa
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"hakurei.app/fhs"
|
|
"hakurei.app/internal/pkg"
|
|
)
|
|
|
|
func (t Toolchain) newStage0() (pkg.Artifact, string) {
|
|
return t.New("rosa-stage0", 0, t.AppendPresets(nil,
|
|
Bzip2,
|
|
), nil, nil, `
|
|
umask 377
|
|
tar \
|
|
-vjc \
|
|
-C /stage0 \
|
|
-f /work/stage0-`+triplet()+`.tar.bz2 \
|
|
.
|
|
`, pkg.Path(fhs.AbsRoot.Append("stage0"), false, t.AppendPresets(nil,
|
|
LLVM,
|
|
Mksh,
|
|
toyboxEarly,
|
|
)...)), Unversioned
|
|
}
|
|
func init() {
|
|
artifactsM[Stage0] = Metadata{
|
|
f: Toolchain.newStage0,
|
|
|
|
Name: "rosa-stage0",
|
|
Description: "Rosa OS stage0 toolchain tarball for bootstrap",
|
|
}
|
|
}
|
|
|
|
var (
|
|
// stage0 stores the tarball unpack artifact.
|
|
stage0 pkg.Artifact
|
|
// stage0Once is for lazy initialisation of stage0.
|
|
stage0Once sync.Once
|
|
)
|
|
|
|
// NewStage0 returns a stage0 distribution created from curing [Stage0].
|
|
func NewStage0() pkg.Artifact {
|
|
stage0Once.Do(func() {
|
|
stage0 = newTar(
|
|
"https://hakurei.app/seed/20260210/"+
|
|
"stage0-"+triplet()+".tar.bz2",
|
|
perArch[string]{
|
|
"amd64": "tqM1Li15BJ-uFG8zU-XjgFxoN_kuzh1VxrSDVUVa0vGmo-NeWapSftH739sY8EAg",
|
|
"arm64": "CJj3ZSnRyLmFHlWIQtTPQD9oikOZY4cD_mI3v_-LIYc2hhg-cq_CZFBLzQBAkFIn",
|
|
"riscv64": "FcszJjcVWdKAnn-bt8qmUn5GUUTjv_xQjXOWkUpOplRkG3Ckob3StUoAi5KQ5-QF",
|
|
}.unwrap(),
|
|
pkg.TarBzip2,
|
|
)
|
|
})
|
|
return stage0
|
|
}
|