From: Arne Fitzenreiter Date: Tue, 19 Jun 2018 08:58:47 +0000 (+0200) Subject: core121/122: update needed diskspace X-Git-Tag: v2.21-core122~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2f0bae8cb5af8e8f7557aa5a40759932d2c87e8;p=people%2Fstevee%2Fipfire-2.x.git core121/122: update needed diskspace Signed-off-by: Arne Fitzenreiter --- diff --git a/config/rootfiles/core/121/update.sh b/config/rootfiles/core/121/update.sh index 4d19e48f59..18019c1d79 100644 --- a/config/rootfiles/core/121/update.sh +++ b/config/rootfiles/core/121/update.sh @@ -41,6 +41,23 @@ for (( i=1; i<=$core; i++ )); do rm -f /var/cache/pakfire/core-upgrade-*-$i.ipfire done +# Do some sanity checks. +case $(uname -r) in + *-ipfire*) + # Ok. + ;; + *) + exit_with_error "ERROR cannot update. No IPFire Kernel." 1 + ;; +esac + +# Check diskspace on root +ROOTSPACE=`df / -Pk | sed "s| * | |g" | cut -d" " -f4 | tail -n 1` + +if [ $ROOTSPACE -lt 220000 ]; then + exit_with_error "ERROR cannot update because not enough free space on root." 2 + exit 2 +fi # Stop services @@ -95,3 +112,4 @@ sync # Don't report the exitcode last command exit 0 + diff --git a/config/rootfiles/core/122/update.sh b/config/rootfiles/core/122/update.sh index 925886e276..e678e98a35 100644 --- a/config/rootfiles/core/122/update.sh +++ b/config/rootfiles/core/122/update.sh @@ -61,7 +61,7 @@ esac # Check diskspace on root ROOTSPACE=`df / -Pk | sed "s| * | |g" | cut -d" " -f4 | tail -n 1` -if [ $ROOTSPACE -lt 100000 ]; then +if [ $ROOTSPACE -lt 80000 ]; then exit_with_error "ERROR cannot update because not enough free space on root." 2 exit 2 fi