From: Ben Gras Date: Wed, 31 Aug 2005 15:48:15 +0000 (+0000) Subject: autopart now guesses the bios drive number and the setup script tells it X-Git-Tag: v3.1.0~227 X-Git-Url: http://zhaoyanbai.com/repos/host.html?a=commitdiff_plain;h=509394f2baaf55542dea17e9152fa61add8f86f4;p=minix.git autopart now guesses the bios drive number and the setup script tells it to the user. minixsize has fallback default sizes set before specifics set by input list. --- diff --git a/commands/ibm/autopart.c b/commands/ibm/autopart.c index 3ae1d9bf5..c3b4ccb5f 100755 --- a/commands/ibm/autopart.c +++ b/commands/ibm/autopart.c @@ -280,6 +280,7 @@ typedef struct device { char *name; /* E.g. /dev/c0d0 */ char *subname; /* E.g. /dev/c0d0:2 */ parttype_t parttype; + int biosdrive; } device_t; typedef struct region { @@ -307,6 +308,7 @@ device_t *firstdev= nil, *curdev; static struct { device_t *dev; int nr_partitions, free_regions, used_regions, sectors, nr_regions; + int biosdrive; region_t regions[NR_REGIONS]; } devices[MAX_DEVICES]; @@ -1840,7 +1842,7 @@ void regionize(void) } -void m_read(int ev, object_t *op) +void m_read(int ev, int *biosdrive) /* Read the partition table from the current device. */ { int si, i, mode, n, r, v; @@ -1860,15 +1862,6 @@ void m_read(int ev, object_t *op) v = 2*HZ; ioctl(device, DIOCTIMEOUT, &v); - /* Assume up to five lines of kernel messages. */ - statusrow+= 5-1; - stat_end(5); - - if (mode == O_RDONLY) { - stat_start(1); - printf("%s: Readonly", curdev->name); - stat_end(5); - } memset(bootblock, 0, sizeof(bootblock)); n= boot_readwrite(0); @@ -1887,6 +1880,8 @@ void m_read(int ev, object_t *op) if (n < SECTOR_SIZE) n= SECTOR_SIZE; + if(biosdrive) (*biosdrive)++; + if(!open_ct_ok(device)) { printf("\n%s: device in use! skipping it.", curdev->subname); fflush(stdout); @@ -2139,7 +2134,7 @@ void event(int ev, object_t *op) m_magic(ev, op); m_in(ev, op); m_out(ev, op); - m_read(ev, op); + m_read(ev, NULL); m_write(ev, op); m_shell(ev, op); m_quit(ev, op); @@ -2437,6 +2432,7 @@ select_disk(void) int done = 0; int i, choice, drives; static char line[500]; + int biosdrive = 0; printstep(1, "Select a disk to install MINIX 3"); printf("\nProbing for disks. This may take a short while."); @@ -2447,7 +2443,7 @@ select_disk(void) for(; i < MAX_DEVICES;) { printf("."); fflush(stdout); - m_read('r', NULL); + m_read('r', &biosdrive); if(device >= 0) { devices[i].dev = curdev; devices[i].free_regions = free_regions; @@ -2455,6 +2451,7 @@ select_disk(void) devices[i].nr_partitions = nr_partitions; devices[i].used_regions = used_regions; devices[i].sectors = table[0].size; + curdev->biosdrive = biosdrive-1; memcpy(devices[i].regions, regions, sizeof(regions)); i++; } @@ -2688,7 +2685,9 @@ do_autopart(int resultfd) name=strrchr(curdev->name, '/'); if(!name) name = curdev->name; else name++; - sprintf(partbuf, "%sp%d\n", name, found-1); + + sprintf(partbuf, "%sp%d d%dp%d\n", name, found-1, + curdev->biosdrive, found-1); sprintf(devname, "/dev/%sp%d", name, found-1); if(resultfd >= 0 && write(resultfd, partbuf, strlen(partbuf)) < strlen(partbuf)) { fprintf(stderr, "Autopart internal error (couldn't write result).\n"); diff --git a/commands/scripts/minixsize.sh b/commands/scripts/minixsize.sh index 8c4fa8a60..25f054a96 100644 --- a/commands/scripts/minixsize.sh +++ b/commands/scripts/minixsize.sh @@ -3,6 +3,7 @@ t=/usr/src/etc/binary_sizes if [ "$1" = big ] then t=$t.big fi +chmem =200000 /usr/lib/* /usr/lib/i386/* if [ -f $t ] then cat "$t" | while read line do awk '{ print "chmem =" $2 " " $1 }' diff --git a/commands/scripts/setup.sh b/commands/scripts/setup.sh index 1bce5bf67..afe80e0c3 100755 --- a/commands/scripts/setup.sh +++ b/commands/scripts/setup.sh @@ -172,6 +172,7 @@ echo -n "Are you sure you want to continue? Please enter 'yes' or 'no': " read confirmation if [ "$confirmation" = yes ]; then step2=ok; fi done +biosdrivename="Actual BIOS device name unknown, due to expert mode." else # Automatic mode @@ -182,6 +183,8 @@ else then if [ -s "$PF" ] then bd="`cat $PF`" + cat "$PF" | read bd bdn + biosdrivename="Probably, the right command is \"boot $bdn\"." if [ -b "/dev/$bd" ] then primary="$bd" else echo "Funny device $bd from autopart." @@ -440,6 +443,7 @@ echo " Please type 'shutdown' to exit MINIX 3 and enter the boot monitor. At the boot monitor prompt, type 'boot $bios', where X is the bios drive number of the drive you installed on, to try your new MINIX system. +$biosdrivename This ends the MINIX setup script. After booting your newly set up system, you can run the test suites as indicated in the setup manual. You also