diff --git a/internal/rosa/busybox.go b/internal/rosa/busybox.go index df4bfd4..7e87a12 100644 --- a/internal/rosa/busybox.go +++ b/internal/rosa/busybox.go @@ -5,6 +5,7 @@ import ( "io" "net/http" "os" + "runtime" "slices" "strings" "time" @@ -78,10 +79,23 @@ func (a busyboxBin) Cure(t *pkg.TContext) (err error) { // newBusyboxBin returns a [pkg.Artifact] containing a busybox installation from // the https://busybox.net/downloads/binaries/ binary release. func newBusyboxBin() pkg.Artifact { - const ( - version = "1.35.0" + var version, url, checksum string + switch runtime.GOARCH { + case "amd64": + version = "1.35.0" + url = "https://busybox.net/downloads/binaries/" + + version + "-" + linuxArch() + "-linux-musl/busybox" 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( "busybox-bin-"+version, nil, pkg.ExecTimeoutMax, false, fhs.AbsRoot, []string{ @@ -96,9 +110,7 @@ func newBusyboxBin() pkg.Artifact { &http.Client{Transport: &http.Transport{ // busybox website is really slow to respond TLSHandshakeTimeout: 2 * time.Minute, - }}, - "https://busybox.net/downloads/binaries/"+ - version+"-"+linuxArch()+"-linux-musl/busybox", + }}, url, mustDecode(checksum), )}), )