Basic free space check for build process

This commit is contained in:
zador-blood-stained 2016-05-24 18:44:45 +03:00
parent e86e18a4a0
commit 68d6a4ab56

View File

@ -401,4 +401,8 @@ prepare_host() {
# TODO: needs better documentation
echo 'Place your patches and kernel.config / u-boot.config / lib.config here.' > $SRC/userpatches/readme.txt
echo 'They will be automatically included if placed here!' >> $SRC/userpatches/readme.txt
# check free space (basic)
local freespace=$(( $(findmnt --target $SRC -n -o AVAIL -b) / 1024 / 1024 / 1024 )) # in GiB
[[ -n $freespace && $freespace -lt 10 ]] && display_alert "Low free space left" "$freespace GiB" "wrn"
}