autopart and setup script STEP additions to be keyed to install manual

by ast@
This commit is contained in:
Ben Gras 2005-08-08 09:24:02 +00:00
parent 5789f7abec
commit e4d264bce9
2 changed files with 33 additions and 20 deletions

View File

@ -2556,19 +2556,19 @@ do_autopart(int resultfd)
probing = 1; probing = 1;
autopartmode = 1; autopartmode = 1;
printf("\nWelcome to the autopart process. There are three steps:\n\n" printf("\nWelcome to the autopart process. There are three sub-steps:\n\n"
"1. Select the drive you want to use.\n" "2.1. Select the drive you want to use.\n"
"2. Select a region to install MINIX in.\n" "2.2. Select a region to install MINIX in.\n"
"3. After confirmation, write new table to disk.\n" "2.3. After confirmation, write new table to disk.\n"
"\n" "\n"
"Nothing will happen to your disk before step 3.\n\n" "Nothing will happen to your disk before step 2.3.\n\n"
); );
printf("Press ENTER to continue: "); printf("Press ENTER to continue: ");
fflush(stdout); fflush(stdout);
if(!fgets(sure, sizeof(sure)-1, stdin)) exit(1); if(!fgets(sure, sizeof(sure)-1, stdin)) exit(1);
printf("\n\n+-- STEP 1 -- Select drive ----------------------------------------+\n"); printf("\n\n --- Step 2.1 --- Select drive ---------------------------------------\n\n");
do { do {
curdev = select_disk(); curdev = select_disk();
@ -2585,13 +2585,13 @@ do_autopart(int resultfd)
memcpy(orig_table, table, sizeof(table)); memcpy(orig_table, table, sizeof(table));
do { do {
printf("\n\n+-- STEP 2 -- Select region to install in --------------------------+\n"); printf("\n\n --- Step 2.2 --- Select region to install in ------------------------\n\n");
/* Show regions. */ /* Show regions. */
r = select_region(); r = select_region();
} while(!r); /* Back to step 2. */ } while(!r); /* Back to step 2. */
printf("\n\n+-- STEP 3 -- Write table to disk ----------------------------------+\n"); printf("\n\n --- Step 2.3 --- Write table to disk --------------------------------\n\n");
/* Write things. */ /* Write things. */
if(scribble_region(r, &pe)) { if(scribble_region(r, &pe)) {
@ -2600,10 +2600,12 @@ do_autopart(int resultfd)
char partbuf[100]; char partbuf[100];
#if 0
printf("\nThis is your current partition table:\n"); printf("\nThis is your current partition table:\n");
m_dump(orig_table); m_dump(orig_table);
printf("\nThis will be your new partition table:\n"); printf("\nThis will be your new partition table:\n");
m_dump(table); m_dump(table);
#endif
printf("\nThis is the point of no return. You have selected to install MINIX\n"); printf("\nThis is the point of no return. You have selected to install MINIX\n");
printf("into region %d of disk %d. If you agree with this selection, your\n", (int)(r-regions), (int) (curdev-firstdev)); printf("into region %d of disk %d. If you agree with this selection, your\n", (int)(r-regions), (int) (curdev-firstdev));

View File

@ -67,20 +67,16 @@ This is the Minix installation script.
Note 1: If the screen blanks suddenly then hit CTRL+F3 to select \"software Note 1: If the screen blanks suddenly then hit CTRL+F3 to select \"software
scrolling\". scrolling\".
Note 2: If things go wrong then hit DEL and start over. Note 2: If things go wrong then hit DEL and start over.
Note 3: Some questions have default answers, like this: [y]
Note 3: The installation procedure is described in the manual page
usage(8). It will be hard without it.
Note 4: Some questions have default answers, like this: [y]
Simply hit RETURN (or ENTER) if you want to choose that answer. Simply hit RETURN (or ENTER) if you want to choose that answer.
Note 4: If you see a colon (:) then you should hit RETURN to continue.
Note 5: If you see a colon (:) then you should hit RETURN to continue.
:" :"
read ret read ret
echo " echo "
--- Step 1 --- Select keyboard type. --------------------------------
What type of keyboard do you have? You can choose one of: What type of keyboard do you have? You can choose one of:
" "
ls -C /usr/lib/keymaps | sed -e 's/\.map//g' -e 's/^/ /' ls -C /usr/lib/keymaps | sed -e 's/\.map//g' -e 's/^/ /'
@ -91,7 +87,10 @@ test -n "$keymap" && loadkeys "/usr/lib/keymaps/$keymap.map"
ok="" ok=""
while [ "$ok" = "" ] while [ "$ok" = "" ]
do do
echo -n "Welcome to Minix partitioning. Do you want to echo "
--- Step 2 --- Partitioning -----------------------------------------
"
echo -n "Now is the MINIX 3 partitioning step. Do you want to
follow the (A)utomatic or the e(X)pert mode? [A] " follow the (A)utomatic or the e(X)pert mode? [A] "
read ch read ch
case "$ch" in case "$ch" in
@ -179,6 +178,9 @@ hex2int()
done done
echo $i echo $i
} }
echo "
--- Step 3 --- Networking -------------------------------------------
"
# Ask user about networking # Ask user about networking
echo "" echo ""
@ -234,11 +236,14 @@ i86)
esac esac
blockdefault=8 blockdefault=8
echo "
--- Step 4 --- Block size -------------------------------------------
"
echo "\ echo "\
The default block size on the disk is $blockdefault KB. However, sizes of 1 to $blockdefault KB The default block size on the disk is $blockdefault KB. However, sizes of 1 to $blockdefault KB
are also supported. If you have a small disk or small RAM you may want less are also supported. If you have a small disk or small RAM you may want less
than $blockdefault KB, in which case type a block size from 1 to 8 (1, 2, 4 or $blockdefault are than $blockdefault KB, in which case type a block size from 1 to 8 (1, 2, 4 or $blockdefault are
suggested values). Otherwise hit ENTER for the default of $blockdefault KB blocks, which suggested values). Otherwise hit RETURN for the default of $blockdefault KB blocks, which
should be fine in most cases." should be fine in most cases."
while [ -z "$blocksize" ] while [ -z "$blocksize" ]
@ -254,6 +259,9 @@ do echo -n "Block size [$blockdefault KB]? "
done done
blocksizebytes="`expr $blocksize '*' 1024`" blocksizebytes="`expr $blocksize '*' 1024`"
echo "
--- Step 5 --- Swap space -------------------------------------------
"
echo -n " echo -n "
How much swap space would you like? Swapspace is only needed if this How much swap space would you like? Swapspace is only needed if this
@ -294,8 +302,9 @@ else
# Forget about swap. # Forget about swap.
swap= swap=
fi fi
echo " echo "
Migrating to disk... --- Step 5 --- Copy files -------------------------------------------
" "
mkfs -B $blocksizebytes /dev/$usr mkfs -B $blocksizebytes /dev/$usr
@ -367,6 +376,8 @@ test -n "$keymap" && cp -p "/usr/lib/keymaps/$keymap.map" /mnt/etc/keymap
if [ -n "$driver" ] if [ -n "$driver" ]
then echo "eth0 $driver 0 { default; };" >/mnt/etc/inet.conf then echo "eth0 $driver 0 { default; };" >/mnt/etc/inet.conf
echo "$driverargs" >$LOCALRC echo "$driverargs" >$LOCALRC
disable=""
else disable=inet
fi fi
umount /dev/$root || exit # Unmount the new root. umount /dev/$root || exit # Unmount the new root.
@ -388,7 +399,7 @@ if [ $cache -eq 0 ]; then cache=; else cache="ramsize=$cache"; fi
# Make bootable. # Make bootable.
installboot -d /dev/$root /usr/mdec/bootblock /boot/boot >/dev/null || exit installboot -d /dev/$root /usr/mdec/bootblock /boot/boot >/dev/null || exit
edparams /dev/$root "rootdev=$root; ramimagedev=$root; $cache; main() { echo This is the MINIX 3 boot monitor.; echo MINIX will load in 5 seconds, or press ESC.; trap 5000 boot; menu; }; save" || exit edparams /dev/$root "rootdev=$root; ramimagedev=$root; disable=$disable; $cache; main() { echo This is the MINIX 3 boot monitor.; echo MINIX will load in 5 seconds, or press ESC.; trap 5000 boot; menu; }; save" || exit
pfile="/usr/src/tools/fdbootparams" pfile="/usr/src/tools/fdbootparams"
echo "Remembering boot parameters in ${pfile}." echo "Remembering boot parameters in ${pfile}."
echo "rootdev=$root; ramimagedev=$root; $cache; save" >$pfile || exit echo "rootdev=$root; ramimagedev=$root; $cache; save" >$pfile || exit