diff --git a/clone/clone b/clone/clone index 2ee6dea..4e6d9a4 100755 --- a/clone/clone +++ b/clone/clone @@ -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"; diff --git a/clone/utility/install-source b/clone/utility/install-source index 72f2361..333cb73 100644 --- a/clone/utility/install-source +++ b/clone/utility/install-source @@ -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; diff --git a/clone/utility/sats-boot b/clone/utility/sats-boot index ff79361..e7ee543 100644 --- a/clone/utility/sats-boot +++ b/clone/utility/sats-boot @@ -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;