just expand FS once when swap is created

This commit is contained in:
rootzoll
2018-08-09 14:05:02 +02:00
parent cfd38f453b
commit 0545c96811

View File

@@ -4,7 +4,7 @@ echo ""
# add bonus scripts # add bonus scripts
./91addBonus.sh ./91addBonus.sh
###### SWAP ###### SWAP & FS
echo "*** SWAP file ***" echo "*** SWAP file ***"
swapExists=$(swapon -s | grep -c /mnt/hdd/swapfile) swapExists=$(swapon -s | grep -c /mnt/hdd/swapfile)
if [ ${swapExists} -eq 1 ]; then if [ ${swapExists} -eq 1 ]; then
@@ -20,6 +20,12 @@ else
sudo dphys-swapfile setup sudo dphys-swapfile setup
sudo chmod 0600 /mnt/hdd/swapfile sudo chmod 0600 /mnt/hdd/swapfile
sudo dphys-swapfile swapon sudo dphys-swapfile swapon
# expand FS of SD
echo "*** Expand RootFS ***"
sudo raspi-config --expand-rootfs
echo ""
fi fi
swapExists=$(swapon -s | grep -c /mnt/hdd/swapfile) swapExists=$(swapon -s | grep -c /mnt/hdd/swapfile)
if [ ${swapExists} -eq 1 ]; then if [ ${swapExists} -eq 1 ]; then
@@ -32,11 +38,6 @@ else
sleep 60 sleep 60
fi fi
# expand FS of SD
echo "*** Expand RootFS ***"
sudo raspi-config --expand-rootfs
echo ""
# mark setup is done # mark setup is done
echo "90" > /home/admin/.setup echo "90" > /home/admin/.setup