diff --git a/clone/clone b/clone/clone index 4c31b22..69dadd8 100755 --- a/clone/clone +++ b/clone/clone @@ -177,8 +177,20 @@ step4(){ exit 1; fi; - # [1] Mount device partition - sudo mount ${DEV}2 /mnt || (echo "<<< error: can't mount"; exit 1); + # (1) Disable ipv6 in the sd@1 partition # + echo " * Configuring /boot in ${DEV}1 partition"; + sudo mount ${DEV}1 /mnt || (echo "<<< error: can't mount ${DEV}1"; exit 1); + echo "ipv6.disable=1" | sudo tee -a /mnt/cmdline.txt > /dev/null; + + echo " * Enabling spi device"; + echo "dtparam=spi=on" | sudo tee -a /mnt/config.txt > /dev/null; + echo "dtoverlay=spi-bcm2708" | sudo tee -a /mnt/config.txt > /dev/null; + echo " > done"; + sudo umount /mnt; + + + # (2) Mount main partition # + sudo mount ${DEV}2 /mnt || (echo "<<< error: can't mount ${DEV}2"; exit 1); echo "<<< done"; diff --git a/clone/utility/interfaces b/clone/utility/interfaces index 231e7e0..20dc85c 100644 --- a/clone/utility/interfaces +++ b/clone/utility/interfaces @@ -16,4 +16,5 @@ iface eth0 inet manual # wifi network interface #1 allow-hotplug wlan0 iface wlan0 inet dhcp + pre-up iwconfig wlan0 power off dns-nameservers 8.8.8.8 8.8.4.4 diff --git a/clone/utility/sats-feature@.service b/clone/utility/sats-feature@.service index 5425fee..aa18836 100644 --- a/clone/utility/sats-feature@.service +++ b/clone/utility/sats-feature@.service @@ -5,8 +5,8 @@ After=sats-sync.service [Service] Type=simple -User=sats -Group=sats +User=pi +Group=pi ExecStart=/bin/bash /home/sats/satsd/source/feature/%i/main [Install] diff --git a/clone/utility/sats-install b/clone/utility/sats-install index fe25597..d3f6daf 100644 --- a/clone/utility/sats-install +++ b/clone/utility/sats-install @@ -72,17 +72,8 @@ sudo -u sats git clone -b $BRANCH ssh://smmp-server/satsd/git /home/sats/satsd/s || failexit; - -# (2) Enable SPI device # -slog " * 8. Enabling spi device"; -echo "dtparam=spi=on" | sudo tee -a /boot/config.txt > /dev/null \ - || failexit; -echo "dtoverlay=spi-bcm2708" | sudo tee -a /boot/config.txt > /dev/null \ - || failexit; -slog " > done"; - # (3) Clone SPI python library # -slog " * 9. Cloning 'SPI-Py' lib"; +slog " * 8. Cloning 'SPI-Py' lib"; if [ -d /home/pi/spi-lib ]; then slog " > done (already cloned)"; else @@ -92,7 +83,7 @@ else fi; # (4) Install SPI python library # -slog " * 10. Installing 'SPI-Py' lib into the system"; +slog " * 9. Installing 'SPI-Py' lib into the system"; cd /home/pi/spi-lib; sudo python setup.py build \ || failexit; @@ -104,17 +95,17 @@ slog " > done"; # [2] Synchronization #========================================================# # (1) Process sync # -slog " * 11. Synchronizing the SATS with SMMP's server"; +slog " * 10. Synchronizing the SATS with SMMP's server"; test "$(sudo -u sats /home/sats/satsd/source/lib/api/sync)" = "0" \ && slog " > done" \ || failexit; # (2) Create target file # -slog " * 12. Creating target file 'sync'"; +slog " * 11. Creating target file 'sync'"; sudo -u sats touch /target/sync \ && slog " > done" \ || failexit; # (3) Reboot to activate SPI # -slog " * 13. Launching first reboot"; +slog " * 12. Launching first reboot"; sudo reboot; \ No newline at end of file diff --git a/clone/utility/wlan0.dwc b/clone/utility/wlan0.dwc index b5dd8df..739358d 100644 --- a/clone/utility/wlan0.dwc +++ b/clone/utility/wlan0.dwc @@ -68,7 +68,7 @@ slog "[`date +%s`] > done"; # [4] Update 'wpa_supplicant' configuration #========================================================# -echo -e "network={\n\tssid=\"SATS_$AP_HASH\"\n\tpsk=\"$PASS\"\n}" | sudo tee /etc/wpa_supplicant/$IFACE.conf; +echo -e "ctrl_interface=/var/run/wpa_supplicant\n\nnetwork={\n\tssid=\"SATS_$AP_HASH\"\n\tpsk=\"$PASS\"\n}" | sudo tee /etc/wpa_supplicant/$IFACE.conf; # [5] Restart connection