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
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user