Documente Academic
Documente Profesional
Documente Cultură
/bin/bash
clear
echo "This script will install and/or modify"
echo "packages needed for the Adafruit Pi"
echo "Camera project. It should be installed"
echo "atop one of Adafruit's PiTFT-enabled"
echo "Raspbian setups (either resistive or"
echo "capacitive), NOT a stock Raspbian OS."
echo
echo "Operations performed include:"
echo "- In /boot/config.txt, enable Pi"
echo " camera and boost PiTFT speed"
echo "- apt-get update"
echo "- Install Python libraries:"
echo " picamera, pygame, PIL"
echo "- Downgrade SDL library for pygame"
echo " touch compatibility"
echo "- Download Dropbox Updater and"
echo " Adafruit Pi Cam software"
echo
echo "NEVER perform an 'apt-get upgrade' on"
echo "a PiTFT-enabled system; it may fail to"
echo "boot. Upgrades, if necessary, should"
echo "be done by downloading & installing"
echo "the latest PiTFT-enabled OS image from"
echo "Adafruit and running this script."
echo
echo "Run time 10+ minutes. Reboot required."
echo
echo "Continuing..."
# Set priority for libsdl from wheezy higher then the jessie package
echo "Package: libsdl1.2debian
Pin: release n=jessie
Pin-Priority: -10
Package: libsdl1.2debian
Pin: release n=wheezy
Pin-Priority: 900
" > /etc/apt/preferences.d/libsdl
cd ~pi
wget https://github.com/andreafabrizi/Dropbox-Uploader/archive/master.zip
unzip master.zip
rm master.zip
mv Dropbox-Uploader-master Dropbox-Uploader
wget https://github.com/adafruit/adafruit-pi-cam/archive/master.zip
unzip master.zip
rm master.zip
chown -R pi:pi Dropbox-Uploader adafruit-pi-cam-master
echo
echo "Camera and PiTFT settings won't take"
echo "effect until next boot."
echo
echo -n "REBOOT NOW? [y/N]"
read
if [[ ! "$REPLY" =~ ^(yes|y|Y)$ ]]; then
echo "Exiting without reboot."
exit 0
fi
echo "Reboot started..."
reboot