From: Ben Gras Date: Sun, 11 Sep 2005 20:23:46 +0000 (+0000) Subject: Test mount of /home readonly X-Git-Tag: v3.1.0~123 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/Bv9ARM.html?a=commitdiff_plain;h=c594325b325fd3eec38d9c4b58e47fa1e7409b28;p=minix.git Test mount of /home readonly --- diff --git a/commands/scripts/setup.sh b/commands/scripts/setup.sh index 3176bad91..3e939a559 100755 --- a/commands/scripts/setup.sh +++ b/commands/scripts/setup.sh @@ -297,6 +297,7 @@ umount /dev/$usr 2>/dev/null && echo "Unmounted $usr for you." devsize="`devsize /dev/$primary`" devsizemb="`expr $devsize / 1024 / 2`" +maxhome="`expr $devsizemb - $TOTALMB - 1`" if [ $devsizemb -lt $TOTALMB ] then echo "The selected partition ($devsizemb MB) is too small." @@ -304,6 +305,11 @@ then echo "The selected partition ($devsizemb MB) is too small." exit 1 fi +if [ $maxhome -lt 1 ] +then echo "Note: you can't have /home with that size partition." + maxhome=0 +fi + TMPMP=/m mkdir $TMPMP >/dev/null 2>&1 @@ -313,7 +319,7 @@ while [ "$confirm" = "" ] do auto="" echo "" - if mount /dev/$home $TMPMP >/dev/null 2>&1 + if mount -r /dev/$home $TMPMP >/dev/null 2>&1 then umount /dev/$home >/dev/null 2>&1 echo "" echo "You have selected an existing MINIX 3 partition." @@ -340,10 +346,9 @@ then homesize="" while [ -z "$homesize" ] do - maxhome="`expr $devsizemb - $TOTALMB - 1`" # 20% of what is left over after /home and /usr # are taken. - defmb="`$maxhome / 5`" + defmb="`expr $maxhome / 5`" if [ $defmb -gt $maxhome ] then defmb=$maxhome