Manage python lib installation + spi activation
This commit is contained in:
parent
a28cfcdb29
commit
acff04903a
18
clone/clone
18
clone/clone
|
@ -98,9 +98,24 @@ 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
|
||||||
|
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 );
|
|| $( 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";
|
||||||
|
|
||||||
step4;
|
step4;
|
||||||
|
@ -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 #
|
||||||
|
|
|
@ -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 ";
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue