internal/rosa: busybox binary artifact
All checks were successful
Test / Create distribution (push) Successful in 50s
Test / Sandbox (push) Successful in 2m57s
Test / ShareFS (push) Successful in 4m43s
Test / Sandbox (race detector) (push) Successful in 5m18s
Test / Hpkg (push) Successful in 5m25s
Test / Hakurei (race detector) (push) Successful in 7m33s
Test / Hakurei (push) Successful in 4m6s
Test / Flake checks (push) Successful in 1m46s

This installs a statically linked busybox binary distribution for decompressing the gentoo stage3 tarball, since there is no native xz implementation.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-19 00:00:13 +09:00
parent 4155adc16a
commit 8d06c0235b
2 changed files with 138 additions and 0 deletions

View File

@@ -2,10 +2,49 @@
package rosa
import (
"log"
"runtime"
"hakurei.app/container/fhs"
"hakurei.app/internal/pkg"
)
const (
// kindEtc is the kind of [pkg.Artifact] of cureEtc.
kindEtc = iota + pkg.KindCustomOffset
// kindBusyboxBin is the kind of [pkg.Artifact] of busyboxBin.
kindBusyboxBin
)
// mustDecode is like [pkg.MustDecode], but replaces the zero value and prints
// a warning.
func mustDecode(s string) pkg.Checksum {
var fallback = pkg.Checksum{}
if s == "" {
log.Println(
"falling back to",
pkg.Encode(fallback),
"for unpopulated checksum",
)
return fallback
}
return pkg.MustDecode(s)
}
var (
// AbsSystem is the Rosa OS installation prefix.
AbsSystem = fhs.AbsRoot.Append("system")
)
// linuxArch returns the architecture name used by linux corresponding to
// [runtime.GOARCH].
func linuxArch() string {
switch runtime.GOARCH {
case "amd64":
return "x86_64"
default:
panic("unsupported target " + runtime.GOARCH)
}
}