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