diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-05-07 19:45:36 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-05-07 20:01:44 +0900 |
| commit | 65b7dd8b37e3a4eac6a4081f147f98b9a251da91 (patch) | |
| tree | 77d4235210ec5d0155c9bd0969027b68f396dfcc /internal/rosa/stage0.go | |
| parent | 8d72b9e5bd8d99cbd32ce0ebe2f5da8e9b1d88ce (diff) | |
internal/rosa: configurable architecture
This enables curing via binfmt.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/stage0.go')
| -rw-r--r-- | internal/rosa/stage0.go | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/internal/rosa/stage0.go b/internal/rosa/stage0.go index 21c8d3ed..1862e47a 100644 --- a/internal/rosa/stage0.go +++ b/internal/rosa/stage0.go @@ -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", + } } |
