1
0
forked from rosa/hakurei

internal/rosa: configurable architecture

This enables curing via binfmt.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-07 19:45:36 +09:00
parent 8d72b9e5bd
commit 65b7dd8b37
8 changed files with 39 additions and 53 deletions

View File

@@ -1,8 +1,6 @@
package rosa
import (
"sync"
"hakurei.app/fhs"
"hakurei.app/internal/pkg"
)
@@ -32,25 +30,22 @@ func init() {
}
}
var (
// stage0 stores the tarball unpack artifact.
stage0 pkg.Artifact
// stage0Once is for lazy initialisation of stage0.
stage0Once sync.Once
)
func init() {
const version = "20260504"
artifactsM[stage0Dist] = Metadata{
f: func(Toolchain) (pkg.Artifact, string) {
return newTar(
"https://hakurei.app/seed/"+version+"/"+
"stage0-"+triplet()+".tar.bz2",
perArch[string]{
"amd64": "IQjFDkiAVLo1XzflgMMiLP3gnVY2hhDMTzl-QqJDCQhcLQ3lLtRzjI5WCxGyW_lk",
"arm64": "6fmwl2Umx2QssKQvxxb1JOGkAjzfA_MXKku0jVdGjYGb35OvwEVA5NYtd0HIy3yH",
}.unwrap(),
pkg.TarBzip2,
), version
},
// NewStage0 returns a stage0 distribution created from curing [Stage0].
func NewStage0() pkg.Artifact {
stage0Once.Do(func() {
stage0 = newTar(
"https://hakurei.app/seed/20260504/"+
"stage0-"+triplet()+".tar.bz2",
perArch[string]{
"amd64": "IQjFDkiAVLo1XzflgMMiLP3gnVY2hhDMTzl-QqJDCQhcLQ3lLtRzjI5WCxGyW_lk",
"arm64": "6fmwl2Umx2QssKQvxxb1JOGkAjzfA_MXKku0jVdGjYGb35OvwEVA5NYtd0HIy3yH",
}.unwrap(),
pkg.TarBzip2,
)
})
return stage0
Name: "stage0-dist",
Description: "Rosa OS stage0 bootstrap seed",
}
}