8000 Make install script auto-detect arch by mcm001 · Pull Request #679 · PhotonVision/photonvision · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Make install script auto-detect arch #679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,30 @@ if [ "$(id -u)" != "0" ]; then
exit 1
fi

ARCH=$(uname -m)
ARCH_NAME=""
if [ "$ARCH" = "aarch64" ]; then
ARCH_NAME="linuxarm64"
elif [ "$ARCH" = "armv7l" ]; then
ARCH_NAME="linuxarm32"
elif [ "$ARCH" = "x86_64" ]; then
ARCH_NAME="linuxx64"
else
if [ "$#" -ne 1 ]; then
echo "Can't determine current arch; please provide it (one of):"
echo ""
echo "- linuxarm32 (32-bit Linux ARM)"
echo "- linuxarm64 (64-bit Linux ARM)"
echo "- linuxx64 (64-bit Linux)"
exit 1
else
echo "Can't detect arch (got $ARCH) -- using user-provided $1"
ARCH_NAME=$1
fi
fi

echo "This is the installation script for PhotonVision."
echo "Installing for platform $ARCH_NAME"

echo "Installing curl..."
apt-get install --yes curl
Expand Down Expand Up @@ -39,7 +62,7 @@ echo "Downloading latest stable release of PhotonVision..."
mkdir -p /opt/photonvision
cd /opt/photonvision
curl -sk https://api.github.com/repos/photonvision/photonvision/releases/latest |
grep "browser_download_url.*jar" |
grep "browser_download_url.*$ARCH_NAME.jar" |
cut -d : -f 2,3 |
tr -d '"' |
wget -qi - -O photonvision.jar
Expand Down
0