Skip to content

Commit

Permalink
Merge pull request #960 from MrMYHuang/main
Browse files Browse the repository at this point in the history
Add correct busybox binary for arm64 architecture
  • Loading branch information
loosebazooka authored Feb 16, 2022
2 parents 6028308 + 3020344 commit 3cfaaa0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions busybox_archives.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ def repositories():
urls = ["https://busybox.net/downloads/binaries/1.31.0-defconfig-multiarch-musl/busybox-armv7l"],
)

# To update arm64 busybox binary (#657)
# Get the latest commit hash from dist-arm64v8 branch of docker-library repo.
# Substitute it in the link: https://github.com/docker-library/busybox/raw/<latest-commit-hash>/stable/musl/busybox.tar.xz
# Update the sha256 value. Since github api doesn't give sha256 value, it can be obtained using sha256sum command.
http_file(
name = "busybox_arm64",
executable = True,
sha256 = "141adb1b625a6f44c4b114f76b4387b4ea4f7ab802b88eb40e0d2f6adcccb1c3",
urls = ["https://busybox.net/downloads/binaries/1.31.0-defconfig-multiarch-musl/busybox-armv8l"],
sha256 = "02033a50ef38a32a72b4b28183654116c42dae61ec9dccb349f9f63c6ae30f53",
urls = ["https://github.com/docker-library/busybox/raw/22bb23a2665eefb1520dc4c99d5ac9bdf87ae93b/stable/musl/busybox.tar.xz"],
)

http_file(
Expand Down
4 changes: 2 additions & 2 deletions experimental/busybox/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ load("//:checksums.bzl", "ARCHITECTURES")
load(":commands.bzl", "BUSYBOX_COMMANDS")

# This works for all architectures because it is just files.
# Ppc64le needs special case as there is no direct working binary file available.
# Ppc64le/Arm64 needs special case as there is no direct working binary file available.
[genrule(
name = "busybox_" + arch + "_tar",
srcs = ["@busybox_" + arch + "//file"],
outs = ["busybox_" + arch + ".tar"],
cmd = "mkdir busybox; cp $(<) busybox/busybox; cd busybox; \
if [[ $(<) == *ppc64le* ]]; then \
if [[ $(<) == *ppc64le* || $(<) == *arm64* ]]; then \
tar -xf busybox ./bin && mv -f ./bin/busybox . && rm -rf ./bin; \
fi; \
for cmd in %s; do \
Expand Down

0 comments on commit 3cfaaa0

Please sign in to comment.