diff options
Diffstat (limited to '')
-rw-r--r-- | upslak.sh | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -1280,7 +1280,19 @@ if [ $CHANGES2SXZ -eq 1 ]; then echo "*** Unable to create file '/mnt/live/changes/.wipe'!" echo "*** Are you sure you are running ${DISTRO^} Live Edition?" else - # Squash the persistence data into a Live .sxz module: + # Squash the persistence data into a Live .sxz module, + # but only if we find the space to do so: + CHANGESSIZE=$(du -sm /mnt/live/changes/ |tr '\t' ' ' |cut -d' ' -f1) + if [ $(( $USBPFREE - $CHANGESSIZE )) -lt $MINFREE ]; then + CHANGES2SXZ=-1 + fi + if [ $CHANGES2SXZ -eq -1 ]; then + echo "*** Not enough space to squash persistence data into a module." + # Don't wipe persistence data on next boot! + rm -f /mnt/live/changes/.wipe + cleanup + exit 1 + fi LIVE_MOD_SYS=$(dirname $(find ${USBMNT} -name "0099-${DISTRO}_zzzconf*.sxz" |head -1)) LIVE_MOD_ADD=$(dirname ${LIVE_MOD_SYS})/addons MODNAME="0100-${DISTRO}_customchanges-$(date +%Y%m%d%H%M%S).sxz" |