Add: more convenience error message about /boot free space
This commit is contained in:
parent
901b451bd5
commit
957b1298d5
1 changed files with 6 additions and 7 deletions
13
install.sh
13
install.sh
|
@ -8,21 +8,20 @@ if [[ $EUID -ne 0 ]]; then
|
|||
fi
|
||||
|
||||
# Check if enough space on /boot volume
|
||||
boot_line=$(df -h | grep /boot | head -n 1)
|
||||
boot_line=$(df -BM | grep /boot | head -n 1)
|
||||
MIN_BOOT_SPC=25 # MegaBytes
|
||||
if [ "x${boot_line}" = "x" ]; then
|
||||
echo "Warning: /boot volume not found .."
|
||||
else
|
||||
boot_space=$(echo $boot_line | awk '{print $4;}')
|
||||
free_space=$(echo "${boot_space%?}")
|
||||
unit="${boot_space: -1}"
|
||||
if [[ "$unit" = "K" ]]; then
|
||||
if [[ "$unit" != "M" ]]; then
|
||||
echo "Warning: /boot volume not found .."
|
||||
elif [ "$free_space" -lt "$MIN_BOOT_SPC" ]; then
|
||||
echo "Error: Not enough space left ($boot_space) on /boot"
|
||||
echo " at least $MIN_BOOT_SPC MB required"
|
||||
exit 1
|
||||
elif [[ "$unit" = "M" ]]; then
|
||||
if [ "$free_space" -lt "25" ]; then
|
||||
echo "Error: Not enough space left ($boot_space) on /boot"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue