Manage python lib installation + spi activation

This commit is contained in:
xdrm-brackets 2017-02-17 16:50:12 +01:00
parent a28cfcdb29
commit acff04903a
3 changed files with 34 additions and 9 deletions

View File

@ -98,8 +98,23 @@ step3(){
test $confirm_burn != "y" && echo "<<< aborting" && exit; test $confirm_burn != "y" && echo "<<< aborting" && exit;
# (2) Burning image into disk # # (2) Burning image into disk #
( dd if=./original.img | pv -s $(du -bs ./original.img | awk '{print $1}') | sudo dd of=$DEV bs=4M ) \ # if GZIP
|| $( echo "<<< error: dd command failed" && exit ); if [ "IMAGE_ZIP" = "1" ]; then
echo " - using gunzip";
( dd if=$IMAGE_FILE | pv -s $(du -bs $IMAGE_FILE | gunzip | awk '{print $1}') | sudo dd of=$DEV bs=4M ) \
|| $( echo "<<< error: dd command failed" && exit );
else
( dd if=$IMAGE_FILE | pv -s $(du -bs $IMAGE_FILE | awk '{print $1}') | sudo dd of=$DEV bs=4M ) \
|| $( echo "<<< error: dd command failed" && exit );
fi;
echo "<<< done"; echo "<<< done";
@ -308,6 +323,7 @@ step9(){
sudo mkdir -p /mnt/home/sats/satsd/log; sudo mkdir -p /mnt/home/sats/satsd/log;
sudo mkdir -p /mnt/home/sats/satsd/conf; sudo mkdir -p /mnt/home/sats/satsd/conf;
sudo mkdir -p /mnt/home/sats/satsd/data; 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_install;
# (2) Create default configuration files # # (2) Create default configuration files #

View File

@ -1,5 +1,9 @@
#!/bin/sh #!/bin/sh
# DEBIAN IMAGE FILE
export IMAGE_FILE="original.img";
export IMAGE_GZIP="0";
# WIFI SETTINGS # WIFI SETTINGS
export WIFI_SSID="freeboxma"; export WIFI_SSID="freeboxma";
export WIFI_PASS=" manon adrien "; export WIFI_PASS=" manon adrien ";

View File

@ -15,13 +15,18 @@ if [ -e /home/sats/satsd/first_install ]; then
&& rm /home/sats/satsd/first_install \ && rm /home/sats/satsd/first_install \
|| exit; || exit;
# (2) Without git installed #
else
# temporary replacement (without git)
scp -r smmp-server:/satsd/scp/$BRANCH/source /home/sats/satsd/ \
&& rm /home/sats/satsd/first_install \
|| exit;
fi; 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 #
sudo reboot;
fi; fi;