[Fixed] *pi* have the (first_boot) file and clones the code (sudo -u sats)
This commit is contained in:
parent
24c1e8471d
commit
67fff1954f
|
@ -265,8 +265,11 @@ step7(){
|
|||
|
||||
echo " (.) Create sats-boot script";
|
||||
sudo cp ./utility/sats-boot /mnt/home/pi/sats-boot;
|
||||
sudo touch /mnt/home/pi/first_boot;
|
||||
sudo chown 1000:1000 /mnt/home/pi/sats-boot;
|
||||
sudo chown 1000:1000 /mnt/home/pi/first_boot;
|
||||
sudo chmod 770 /mnt/home/pi/sats-boot;
|
||||
sudo chmod 770 /mnt/home/pi/first_boot;
|
||||
|
||||
# (3) Install sats-boot service #
|
||||
echo " (.) Create sats-update service";
|
||||
|
@ -323,8 +326,6 @@ step9(){
|
|||
sudo mkdir -p /mnt/home/sats/satsd/log;
|
||||
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_boot;
|
||||
|
||||
# (2) Create default configuration files #
|
||||
echo " (.) Create default configuration/log files";
|
||||
|
@ -339,7 +340,6 @@ step9(){
|
|||
# (3) Set up SATS botting script #
|
||||
echo " (.) Set up SATS booting script";
|
||||
cat ./utility/sats-loop | sudo tee /mnt/home/sats/satsd/sats-loop > /dev/null;
|
||||
cat ./utility/install-source | sudo tee /mnt/home/sats/satsd/install-source > /dev/null;
|
||||
|
||||
# (4) Set up service unit #
|
||||
echo " (.) Set up service unit (sats-loop.service)";
|
||||
|
|
Binary file not shown.
|
@ -1,23 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# [1] First install only
|
||||
#========================================================#
|
||||
if [ -e /home/sats/satsd/first_boot ]; then
|
||||
|
||||
dpkg -s git 2>/dev/null >/dev/null && gitinstalled=1 || gitinstalled=0;
|
||||
|
||||
BRANCH=$(cat /home/sats/satsd/conf/machine.branch);
|
||||
|
||||
# (1) With git if installed #
|
||||
if [ $gitinstalled -eq 1 ]; then
|
||||
|
||||
git clone -b $BRANCH ssh://smmp-server/satsd/git /home/sats/satsd/source \
|
||||
&& rm /home/sats/satsd/first_boot \
|
||||
|| exit;
|
||||
|
||||
fi;
|
||||
|
||||
# (2) Reboot to activate SPI #
|
||||
sudo reboot;
|
||||
|
||||
fi;
|
|
@ -16,17 +16,37 @@ 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
|
||||
if [ -e /home/pi/first_boot ]; then
|
||||
|
||||
# [5] Enable SPI device #
|
||||
dpkg -s git 2>/dev/null >/dev/null && gitinstalled=1 || gitinstalled=0;
|
||||
|
||||
BRANCH=$(cat /home/sats/satsd/conf/machine.branch);
|
||||
|
||||
# (1) With git if installed #
|
||||
if [ $gitinstalled -eq 1 ]; then
|
||||
|
||||
sudo -u sats git clone -b $BRANCH ssh://smmp-server/satsd/git /home/sats/satsd/source \
|
||||
&& rm /home/pi/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;
|
||||
|
||||
# [6] Clone SPI python library #
|
||||
# (3) 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;
|
||||
|
||||
# (4) Reboot to activate SPI #
|
||||
sudo reboot;
|
||||
|
||||
fi;
|
||||
|
|
|
@ -3,16 +3,13 @@
|
|||
# [0] Exit if no argument
|
||||
test $# -lt 1 && exit;
|
||||
|
||||
# [1] first install (install source code)
|
||||
sh /home/sats/satsd/install-source 2> /home/sats/satsd/log/install-source.log > /home/sats/satsd/log/install-source.log;
|
||||
|
||||
|
||||
# [2] Propagate script
|
||||
# [1] Propagate script to DAEMON
|
||||
if [ "$1" = "daemon" ]; then
|
||||
|
||||
|
||||
sh /home/sats/satsd/source/daemon 2>> /home/sats/satsd/log/daemon.log >> /home/sats/satsd/log/daemon.log;
|
||||
|
||||
# [2] Propagate script to UPDATE
|
||||
elif [ "$1" = "update" ]; then
|
||||
|
||||
sh /home/sats/satsd/source/update 2>> /home/sats/satsd/log/update.log >> /home/sats/satsd/log/update.log;
|
||||
|
|
Loading…
Reference in New Issue