From: Ben Gras Date: Tue, 13 Sep 2005 13:27:35 +0000 (+0000) Subject: /home size check X-Git-Tag: v3.1.0~101 X-Git-Url: http://zhaoyanbai.com/repos/rndc.html?a=commitdiff_plain;h=19534a8a96ed5253e5c3470bc5241b48eae74275;p=minix.git /home size check --- diff --git a/commands/scripts/setup.sh b/commands/scripts/setup.sh index 01a13375f..76f9fb10b 100755 --- a/commands/scripts/setup.sh +++ b/commands/scripts/setup.sh @@ -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] "