Skip to content

Commit

Permalink
core:tools:zenoh: Add installer for zenoh
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoMario109 committed Nov 18, 2024
1 parent f776c91 commit 86ae3fa
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions core/tools/zenoh/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

# Immediately exit on errors
set -e

VERSION="1.0.0"
MIRROR="1"
BINARIES=(
"zenoh"
"zenoh-plugin-webserver"
)

echo "Installing project Zenoh and friends with version $VERSION"

# Step 1: Prepare the download URL
ARCH="$(uname -m)"
case "$ARCH" in
x86_64 | amd64)
TOOLCHAIN="x86_64-unknown-linux-musl"
;;
armv7l | armhf)
TOOLCHAIN="armv7-unknown-linux-gnueabihf"
;;
aarch64 | arm64)
TOOLCHAIN="aarch64-unknown-linux-musl"
;;
*)
echo "Architecture: $ARCH is unsupported, please create a new issue on https://github.com/bluerobotics/BlueOS/issues"
exit 1
;;
esac
echo "For architecture $ARCH, using toolchain $TOOLCHAIN"

echo "Download zenoh and friends..."
DOWNLOAD_FOLDER="/tmp/zenoh_and_friends"
mkdir -p $DOWNLOAD_FOLDER
for BINARY in "${BINARIES[@]}"; do
URL="https://download.eclipse.org/zenoh/${BINARY}/${VERSION}/${BINARY}-${VERSION}-${TOOLCHAIN}-standalone.zip"
echo " - Download: ${URL}"
wget -q "$URL" -O "${DOWNLOAD_FOLDER}/${BINARY}.zip"
done
echo "Downloaded all binaries, now installing..."
cd ${DOWNLOAD_FOLDER}
unzip "*.zip"
rm *.zip
mv * /usr/bin
cd - && rm -rf ${DOWNLOAD_FOLDER}
echo "Install complete!"

0 comments on commit 86ae3fa

Please sign in to comment.