From 6f88dc8713c2b958f9fd5d0139c9b63cc0e312a9 Mon Sep 17 00:00:00 2001 From: Evgeniy Ivanov Date: Tue, 7 Feb 2012 19:14:27 +0400 Subject: [PATCH] Support reinstall and new boot. --- commands/setup/setup.sh | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/commands/setup/setup.sh b/commands/setup/setup.sh index f4959fe97..bc72ccf5d 100644 --- a/commands/setup/setup.sh +++ b/commands/setup/setup.sh @@ -12,6 +12,7 @@ LOCALRC=/usr/etc/rc.local MYLOCALRC=/mnt/etc/rc.local ROOTMB=64 ROOTSECTS="`expr $ROOTMB '*' 1024 '*' 2`" +BOOTXXSECTS=32 USRKBFILE=/.usrkb if [ ! -f "$USRKBFILE" ] then echo "Are you really running from CD?" @@ -391,11 +392,21 @@ else ROOTMB="`expr $ROOTSECTS / 2048`" if [ $ROOTSECTS -ne $ROOTSECTSDEFAULT ] then + # Check if we 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 + # Check if enough space for new boot (even if old used) + let bootspace=`devsize /dev/$primary`-`devsize /dev/$root`-`devsize /dev/$home`-`devsize /dev/$usr` >/dev/null + if [ $bootspace -lt $BOOTXXSECTS ] + then + echo "Root partition size will be reduced by up to 16Kb to fit new bootloader." + echo "This is not a problem." + ROOTSECTS=`expr $ROOTSECTS - $BOOTXXSECTS + $bootspace` + fi + # Recompute totals based on root size TOTALMB="`expr 3 + $USRKB / 1024 + $ROOTMB`" maxhome="`expr $devsizemb - $TOTALMB - 1`" @@ -441,26 +452,22 @@ else blocksize=$blockdefault fi +blocksizebytes="`expr $blocksize '*' 1024`" + usenewboot=1 -bootsectors=32 -if [ ! "$auto" = "r" ] -then - echo "" +bootsectors=$BOOTXXSECTS +echo "" echo " --- Step 7: Select a boot scheme --------------------------------------" - echo "" +echo "" - echo -n "Do you want to use new boot? [Y] " - read ok - if [ "$ok" != Y -a "$ok" != y -a "$ok" != "" ] - then - usenewboot=0 - bootsectors=1 - fi +echo -n "Do you want to use new boot? [Y] " +read ok +if [ "$ok" != Y -a "$ok" != y -a "$ok" != "" ] +then + usenewboot=0 + bootsectors=1 fi - -blocksizebytes="`expr $blocksize '*' 1024`" - echo " You have selected to (re)install MINIX 3 in the partition /dev/$primary. The following subpartitions are now being created on /dev/$primary: -- 2.44.0