Skip to content

Instantly share code, notes, and snippets.

@teuteuguy
Last active March 7, 2019 10:06
Show Gist options
  • Save teuteuguy/89ef4128d92f95372fe6c8c0c207f3c3 to your computer and use it in GitHub Desktop.
Save teuteuguy/89ef4128d92f95372fe6c8c0c207f3c3 to your computer and use it in GitHub Desktop.
RaspberryPi Greengrass Bootstrap
#!/bin/bash
# Run this on your Pi by running the following command line:
# curl https://gist.githubusercontent.com/teuteuguy/89ef4128d92f95372fe6c8c0c207f3c3/raw | sudo bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
cd /home/pi/Downloads
wget https://nodejs.org/dist/v10.15.3/node-v10.15.3-linux-armv7l.tar.gz
tar -xvf node-v10.15.3-linux-armv7l.tar.gz
cd node-v10.15.3-linux-armv7l
cp -R * /usr/local/
ln -s /usr/local/bin/node /usr/local/bin/nodejs6.10
cd /home/pi/Downloads
cp /boot/cmdline.txt /boot/cmdline.txt.bak
sed -i 's/plymouth.ignore-serial-consoles/plymouth.ignore-serial-consoles cgroup_enable=memory cgroup_memory=1/' /boot/cmdline.txt
adduser --system ggc_user
addgroup --system ggc_group
echo "fs.protected_hardlinks = 1" >> /etc/sysctl.d/98-rpi.conf
echo "fs.protected_symlinks = 1" >> /etc/sysctl.d/98-rpi.conf
cd /home/pi/Downloads
wget https://d1onfpft10uf5o.cloudfront.net/greengrass-core/downloads/1.7.1/greengrass-linux-armv7l-1.7.1.tar.gz
tar -xzvf greengrass-linux-armv7l-1.7.1.tar.gz -C /
curl wget https://gist.githubusercontent.com/teuteuguy/0f2e52cebdf9bcd76b8734b25a793644/raw > /lib/systemd/system/greengrassd.service
systemctl enable greengrassd.service
wget https://github.com/aws-samples/aws-greengrass-samples/raw/master/greengrass-dependency-checker-GGCv1.7.1.zip
unzip greengrass-dependency-checker-GGCv1.7.1.zip
cd greengrass-dependency-checker-GGCv1.7.1
modprobe configs
./check_ggc_dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment