summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/floppy.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-05-09 09:42:17 +0000
committerjkh <jkh@FreeBSD.org>1996-05-09 09:42:17 +0000
commit0f600e3b3639c4d0d645e43e9b3790d659fdfbbc (patch)
tree47e7c675397ffb7f38fb8ea89b10f5d6718bff8d /usr.sbin/sysinstall/floppy.c
parent37b4c046b896694291284f351c7bc95a1819cda1 (diff)
downloadFreeBSD-src-0f600e3b3639c4d0d645e43e9b3790d659fdfbbc.zip
FreeBSD-src-0f600e3b3639c4d0d645e43e9b3790d659fdfbbc.tar.gz
Some cosmetic changes:
Make "selection bar" inverse video white-on-blue on color screens to avoid it getting muddled up with popup dialogs. Do disk selection in a more friendly fashion (for one thing, allow a drive to be de-selected again if you change your mind). Add a few strategic screen-saves to prevent corruption of screen contents (thanks, Michael Elbel!).
Diffstat (limited to 'usr.sbin/sysinstall/floppy.c')
-rw-r--r--usr.sbin/sysinstall/floppy.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/usr.sbin/sysinstall/floppy.c b/usr.sbin/sysinstall/floppy.c
index 16b5301..e3cb41e 100644
--- a/usr.sbin/sysinstall/floppy.c
+++ b/usr.sbin/sysinstall/floppy.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: floppy.c,v 1.10 1996/04/13 13:31:34 jkh Exp $
+ * $Id: floppy.c,v 1.11 1996/04/23 01:29:20 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -74,7 +74,9 @@ getRootFloppy(void)
{
int fd = -1;
- while (floppyDev == NULL || fd == -1) {
+ if (mediaDevice->type == DEVICE_TYPE_FLOPPY)
+ floppyDev = mediaDevice;
+ else {
Device **devs;
int cnt;
@@ -84,23 +86,28 @@ getRootFloppy(void)
msgConfirm("No floppy devices found! Something is seriously wrong!");
return -1;
}
- else if (cnt == 1) {
+ else if (cnt == 1)
floppyDev = devs[0];
- msgConfirm("Please insert the ROOT floppy in %s and press [ENTER]", floppyDev->description);
- }
- else {
+ else {
DMenu *menu;
+ int ret;
+ WINDOW *save = savescr();
menu = deviceCreateMenu(&MenuMediaFloppy, DEVICE_TYPE_FLOPPY, floppyChoiceHook, NULL);
menu->title = "Please insert the ROOT floppy";
- if (!dmenuOpenSimple(menu))
+ ret = dmenuOpenSimple(menu);
+ restorescr(save);
+ if (!ret)
return -1;
}
- if (!floppyDev)
- continue;
+ }
+ while (fd == -1) {
+ msgConfirm("Please insert the ROOT floppy in %s and press [ENTER]", floppyDev->description);
fd = open(floppyDev->devname, O_RDONLY);
if (isDebug())
msgDebug("getRootFloppy on %s yields fd of %d\n", floppyDev->devname, fd);
+ if (fd == -1 && msgYesNo("Couldn't open the floppy - do you want to try again?"))
+ break;
}
return fd;
}
OpenPOWER on IntegriCloud