[Fixed] SPI python lib installation management
This commit is contained in:
parent
acff04903a
commit
24c1e8471d
|
@ -324,7 +324,7 @@ step9(){
|
|||
sudo mkdir -p /mnt/home/sats/satsd/conf;
|
||||
sudo mkdir -p /mnt/home/sats/satsd/data;
|
||||
sudo mkdir -p /mnt/home/sats/satsd/tmp;
|
||||
sudo touch /mnt/home/sats/satsd/first_install;
|
||||
sudo touch /mnt/home/sats/satsd/first_boot;
|
||||
|
||||
# (2) Create default configuration files #
|
||||
echo " (.) Create default configuration/log files";
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# [1] First install only
|
||||
#========================================================#
|
||||
if [ -e /home/sats/satsd/first_install ]; then
|
||||
if [ -e /home/sats/satsd/first_boot ]; then
|
||||
|
||||
dpkg -s git 2>/dev/null >/dev/null && gitinstalled=1 || gitinstalled=0;
|
||||
|
||||
|
@ -12,21 +12,12 @@ if [ -e /home/sats/satsd/first_install ]; then
|
|||
if [ $gitinstalled -eq 1 ]; then
|
||||
|
||||
git clone -b $BRANCH ssh://smmp-server/satsd/git /home/sats/satsd/source \
|
||||
&& rm /home/sats/satsd/first_install \
|
||||
&& rm /home/sats/satsd/first_boot \
|
||||
|| exit;
|
||||
|
||||
fi;
|
||||
|
||||
|
||||
# (2) Enable SPI device #
|
||||
echo "device_tree_param=spi=on" | sudo tee -a /boot/config.txt > /dev/null;
|
||||
echo "dtoverlay=spi-bcm2708" | sudo tee -a /boot/config.txt > /dev/null;
|
||||
|
||||
# (3) Clone SPI python library #
|
||||
sudo git clone https://github.com/lthiery/SPI-Py.git /home/sats/satsd/spi-lib;
|
||||
sudo python /home/sats/satsd/spi-lib/setup.py install;
|
||||
|
||||
# (4) Reboot to activate SPI #
|
||||
# (2) Reboot to activate SPI #
|
||||
sudo reboot;
|
||||
|
||||
fi;
|
||||
|
|
|
@ -14,3 +14,19 @@ sudo systemctl start ssh;
|
|||
# [4] Try to install necessary packages
|
||||
sudo apt-get update;
|
||||
sudo apt-get -y install git php5 php5-cli php5-curl python-dev;
|
||||
|
||||
|
||||
################################################
|
||||
#### ONLY ON FIRST BOOT ####
|
||||
################################################
|
||||
if [ -e /home/sats/satsd/first_boot ]; then
|
||||
|
||||
# [5] Enable SPI device #
|
||||
echo "device_tree_param=spi=on" | sudo tee -a /boot/config.txt > /dev/null;
|
||||
echo "dtoverlay=spi-bcm2708" | sudo tee -a /boot/config.txt > /dev/null;
|
||||
|
||||
# [6] Clone SPI python library #
|
||||
sudo git clone https://github.com/lthiery/SPI-Py.git /home/pi/spi-lib;
|
||||
sudo python /home/pi/spi-lib/setup.py install;
|
||||
|
||||
fi;
|
||||
|
|
Loading…
Reference in New Issue