Skip to content

Instantly share code, notes, and snippets.

@teuteuguy
Last active June 27, 2020 12:41
Show Gist options
  • Save teuteuguy/c058a295d1f24911c8843eb90a6f325a to your computer and use it in GitHub Desktop.
Save teuteuguy/c058a295d1f24911c8843eb90a6f325a to your computer and use it in GitHub Desktop.
Greengrass prep with DLR for Ubuntu and Debian
#!/bin/bash
# Tested on:
# - RPI
# - Jetson Nano
# exit when any command fails
set -e
# Run this on your device with sudo
if [ "$EUID" -ne 0 ]
then echo "Please run as root / sudo"
exit
fi
if [[ $1 = "--skip-installs" ]]
then echo "Will skip all installs"
else
echo "Execute something"
fi
exit
# if [[ $1 != "--skip-installs" ]]
# then echo "Will execute this"
# exit
# fi
ARCH=`uname -m`
CMAKE_VERSION="3.16.8"
GREENGRASS_VERSION="1.10.2"
echo "Architecture: $ARCH"
echo "------------------------------------------------------------------------------"
echo "Cleanup of extra stuff"
apt-get purge -y libreoffice* thunderbird* wolfram-engine
apt-get clean
apt-get update
apt-get -y upgrade
apt autoremove -y
echo "------------------------------------------------------------------------------"
echo "----------------------------------- CMAKE ------------------------------------"
echo "------------------------------------------------------------------------------"
cd /tmp
apt-get install -y git gcc g++ libssl-dev build-essential curl ca-certificates
wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION.tar.gz
tar -zxvf cmake-$CMAKE_VERSION.tar.gz
cd cmake-$CMAKE_VERSION
./bootstrap
make -j4
if [[ $1 != "--skip-installs" ]]
then make install
fi
if [[ $ARCH == "armv7l" ]]
then echo "Latest Raspberry Pi image from 2020 06, have Python3.7 already installed. Skipping."
else;
echo "------------------------------------------------------------------------------"
echo "-------------------------------- PYTHON 3.7 ----------------------------------"
echo "------------------------------------------------------------------------------"
cd /tmp
apt-get install -y python3.7-dev
wget https://bootstrap.pypa.io/get-pip.py
python3.7 get-pip.py
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2
update-alternatives --set python3 /usr/bin/python3.7
fi
# WIP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment