From fc29251444b4ba9a82af9335d8d9e86c91bd4dfa Mon Sep 17 00:00:00 2001 From: Erik van der Kouwe Date: Wed, 2 Jun 2010 17:07:10 +0000 Subject: [PATCH] setup: default root partition size is 64MB, reinstall keeps old root size --- commands/setup/setup.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/commands/setup/setup.sh b/commands/setup/setup.sh index a68af4446..4c7abdad0 100644 --- a/commands/setup/setup.sh +++ b/commands/setup/setup.sh @@ -10,7 +10,7 @@ LOCALRC=/usr/etc/rc.local MYLOCALRC=/mnt/etc/rc.local -ROOTMB=16 +ROOTMB=64 ROOTSECTS="`expr $ROOTMB '*' 1024 '*' 2`" USRKBFILE=/.usrkb if [ ! -f "$USRKBFILE" ] @@ -381,6 +381,21 @@ echo " --- Step 5: Select the size of /home ----------------------------------" homemb="$homesize MB" homesize="`expr $homesize '*' 1024 '*' 2`" else + # Root size same as our default? If not, warn and keep old root size + ROOTSECTSDEFAULT=$ROOTSECTS + ROOTSECTS="`devsize /dev/$root`" + ROOTMB="`expr $ROOTSECTS / 2048`" + if [ $ROOTSECTS -ne $ROOTSECTSDEFAULT ] + then + echo "Root partition size `expr $ROOTSECTS / 2`kb differs from default `expr $ROOTSECTSDEFAULT / 2`kb." + echo "This is not a problem, but you may want to do a fresh install at some point to" + echo "be able to benefit from the new default." + fi + + # Recompute totals based on root size + TOTALMB="`expr 3 + $USRKB / 1024 + $ROOTMB`" + maxhome="`expr $devsizemb - $TOTALMB - 1`" + homepart="`devsize /dev/$home`" homesize="`expr $homepart / 2 / 1024`" if [ "$homesize" -gt "$maxhome" ] -- 2.44.0