internal/rosa/busybox: cross-platform binary
All checks were successful
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 2m52s
Test / Hakurei (push) Successful in 4m14s
Test / ShareFS (push) Successful in 4m15s
Test / Hpkg (push) Successful in 4m58s
Test / Sandbox (race detector) (push) Successful in 5m16s
Test / Hakurei (race detector) (push) Successful in 6m28s
Test / Flake checks (push) Successful in 2m3s
All checks were successful
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 2m52s
Test / Hakurei (push) Successful in 4m14s
Test / ShareFS (push) Successful in 4m15s
Test / Hpkg (push) Successful in 4m58s
Test / Sandbox (race detector) (push) Successful in 5m16s
Test / Hakurei (race detector) (push) Successful in 6m28s
Test / Flake checks (push) Successful in 2m3s
The initial binary seed is arch-specific. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"slices"
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@@ -78,10 +79,23 @@ func (a busyboxBin) Cure(t *pkg.TContext) (err error) {
|
|||||||
// newBusyboxBin returns a [pkg.Artifact] containing a busybox installation from
|
// newBusyboxBin returns a [pkg.Artifact] containing a busybox installation from
|
||||||
// the https://busybox.net/downloads/binaries/ binary release.
|
// the https://busybox.net/downloads/binaries/ binary release.
|
||||||
func newBusyboxBin() pkg.Artifact {
|
func newBusyboxBin() pkg.Artifact {
|
||||||
const (
|
var version, url, checksum string
|
||||||
|
switch runtime.GOARCH {
|
||||||
|
case "amd64":
|
||||||
version = "1.35.0"
|
version = "1.35.0"
|
||||||
|
url = "https://busybox.net/downloads/binaries/" +
|
||||||
|
version + "-" + linuxArch() + "-linux-musl/busybox"
|
||||||
checksum = "L7OBIsPu9enNHn7FqpBT1kOg_mCLNmetSeNMA3i4Y60Z5jTgnlX3qX3zcQtLx5AB"
|
checksum = "L7OBIsPu9enNHn7FqpBT1kOg_mCLNmetSeNMA3i4Y60Z5jTgnlX3qX3zcQtLx5AB"
|
||||||
)
|
case "arm64":
|
||||||
|
version = "1.31.0"
|
||||||
|
url = "https://busybox.net/downloads/binaries/" +
|
||||||
|
version + "-defconfig-multiarch-musl/busybox-armv8l"
|
||||||
|
checksum = "npJjBO7iwhjW6Kx2aXeSxf8kXhVgTCDChOZTTsI8ZfFfa3tbsklxRiidZQdrVERg"
|
||||||
|
|
||||||
|
default:
|
||||||
|
panic("unsupported target " + runtime.GOARCH)
|
||||||
|
}
|
||||||
|
|
||||||
return pkg.NewExec(
|
return pkg.NewExec(
|
||||||
"busybox-bin-"+version, nil, pkg.ExecTimeoutMax, false,
|
"busybox-bin-"+version, nil, pkg.ExecTimeoutMax, false,
|
||||||
fhs.AbsRoot, []string{
|
fhs.AbsRoot, []string{
|
||||||
@@ -96,9 +110,7 @@ func newBusyboxBin() pkg.Artifact {
|
|||||||
&http.Client{Transport: &http.Transport{
|
&http.Client{Transport: &http.Transport{
|
||||||
// busybox website is really slow to respond
|
// busybox website is really slow to respond
|
||||||
TLSHandshakeTimeout: 2 * time.Minute,
|
TLSHandshakeTimeout: 2 * time.Minute,
|
||||||
}},
|
}}, url,
|
||||||
"https://busybox.net/downloads/binaries/"+
|
|
||||||
version+"-"+linuxArch()+"-linux-musl/busybox",
|
|
||||||
mustDecode(checksum),
|
mustDecode(checksum),
|
||||||
)}),
|
)}),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user