diff options
author | jkh <jkh@FreeBSD.org> | 1995-05-20 11:10:35 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1995-05-20 11:10:35 +0000 |
commit | 313edfd29f40789c3329aeddd29752bad68767f6 (patch) | |
tree | 0076f3488cc11a274a77a6849d04fb69931c1c79 /usr.sbin/sysinstall/media.c | |
parent | 3b6a142d8de0c7c6fc16424823c1c574c26a6019 (diff) | |
download | FreeBSD-src-313edfd29f40789c3329aeddd29752bad68767f6.zip FreeBSD-src-313edfd29f40789c3329aeddd29752bad68767f6.tar.gz |
Fix the DOS discovery code to now re-allocate another virtual device if
it's called multiple times in a row. Add a new device type "DEVICE_TYPE_DOS"
so that we can look up an previous results.
Diffstat (limited to 'usr.sbin/sysinstall/media.c')
-rw-r--r-- | usr.sbin/sysinstall/media.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c index 87e8cda..237d930 100644 --- a/usr.sbin/sysinstall/media.c +++ b/usr.sbin/sysinstall/media.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: media.c,v 1.8 1995/05/20 03:49:09 gpalmer Exp $ + * $Id: media.c,v 1.9 1995/05/20 10:33:06 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -150,18 +150,27 @@ mediaSetDOS(char *str) Chunk *c1; int i; - devs = deviceFind(NULL, DEVICE_TYPE_DISK); - if (!devs) + devs = deviceFind(NULL, DEVICE_TYPE_DOS); + if (devs) { + /* XXX If count > 1 then at some point then we should put up a menu and allow the user to choose XXX */ + mediaDevice = devs[0]; + return 1; + } + else + devs = deviceFind(NULL, DEVICE_TYPE_DISK); + if (!devs) { msgConfirm("No disk devices found!"); + return 0; + } + + /* Now go chewing through looking for a DOS FAT partition */ for (i = 0; devs[i]; i++) { - if (!devs[i]->enabled) - continue; d = (Disk *)devs[i]->private; /* Now try to find a DOS partition */ for (c1 = d->chunks->part; c1; c1 = c1->next) { if (c1->type == fat) { /* Got one! */ - mediaDevice = deviceRegister(c1->name, c1->name, c1->name, DEVICE_TYPE_DISK, TRUE, + mediaDevice = deviceRegister(c1->name, c1->name, c1->name, DEVICE_TYPE_DOS, TRUE, mediaInitDOS, mediaGetDOS, mediaCloseDOS, NULL); msgDebug("Found a DOS partition %s on drive %s\n", c1->name, d->name); break; |