aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/sysinstall
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1995-05-20 11:10:35 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1995-05-20 11:10:35 +0000
commit8f1fd59b90d15ef678a444ca3f713833508b8a90 (patch)
tree0076f3488cc11a274a77a6849d04fb69931c1c79 /usr.sbin/sysinstall
parentf10eb488f667ad2b0e855fcc2ac3747e787f9695 (diff)
downloadsrc-8f1fd59b90d15ef678a444ca3f713833508b8a90.tar.gz
src-8f1fd59b90d15ef678a444ca3f713833508b8a90.zip
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.
Notes
Notes: svn path=/head/; revision=8642
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r--usr.sbin/sysinstall/media.c21
-rw-r--r--usr.sbin/sysinstall/sysinstall.h3
2 files changed, 17 insertions, 7 deletions
diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c
index 87e8cda2295d..237d9301974f 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;
diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h
index b4b946323518..fb4732d8e857 100644
--- a/usr.sbin/sysinstall/sysinstall.h
+++ b/usr.sbin/sysinstall/sysinstall.h
@@ -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: sysinstall.h,v 1.22 1995/05/20 03:49:10 gpalmer Exp $
+ * $Id: sysinstall.h,v 1.23 1995/05/20 10:33:11 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -137,6 +137,7 @@ typedef enum {
DEVICE_TYPE_NETWORK,
DEVICE_TYPE_CDROM,
DEVICE_TYPE_TAPE,
+ DEVICE_TYPE_DOS,
DEVICE_TYPE_ANY,
} DeviceType;