]> Zhao Yanbai Git Server - minix.git/commitdiff
/home size check
authorBen Gras <ben@minix3.org>
Tue, 13 Sep 2005 13:27:35 +0000 (13:27 +0000)
committerBen Gras <ben@minix3.org>
Tue, 13 Sep 2005 13:27:35 +0000 (13:27 +0000)
commands/scripts/setup.sh

index 01a13375fb491c5c06c057be7b1383b0a90dc878..76f9fb10bac2a40a2f2d11a4f90cb0db530230ee 100755 (executable)
@@ -396,8 +396,17 @@ done
 
 nohome="0"
 
+homesize=""
 if [ ! "$auto" = r ]
-then   homesize=""
+then   homesize="`devsize /dev/$home` / 2 / 1024"
+       if [ "$homesize" -gt "$maxhome" ]
+       then
+               echo "Sorry, but your /home is too big ($homesize MB) to leave enough"
+               echo "space on the rest of the partition ($devsizemb MB) for your"
+               echo "selected installation size ($TOTALMB MB)."
+               exit 1
+       fi
+else
 echo ""
 echo " --- Step 6: Select the size of /home ----------------------------------"
        while [ -z "$homesize" ]
@@ -418,9 +427,10 @@ echo " --- Step 6: Select the size of /home ----------------------------------"
                if [ "$homesize" = "" ] ; then homesize=$defmb; fi
                if [ "$homesize" -lt 1 ]
                then    nohome=1
+                       echo "Ok, not making a /home."
                        homesize=0
                else
-                       if [ "`expr $TOTALMB + $homesize`" -gt "$devsizemb" ]
+                       if [ "$homesize" -gt "$maxhome" ]
                        then    echo "That won't fit!"
                        else
                                echo -n "$homesize MB Ok? [Y] "