floppy.c (14321) | floppy.c (15242) |
---|---|
1/* 2 * The new sysinstall program. 3 * 4 * This is probably the last attempt in the `sysinstall' line, the next 5 * generation being slated to essentially a complete rewrite. 6 * | 1/* 2 * The new sysinstall program. 3 * 4 * This is probably the last attempt in the `sysinstall' line, the next 5 * generation being slated to essentially a complete rewrite. 6 * |
7 * $Id: floppy.c,v 1.8 1995/12/07 10:33:46 peter Exp $ | 7 * $Id: floppy.c,v 1.9 1996/03/02 07:31:52 jkh Exp $ |
8 * 9 * Copyright (c) 1995 10 * Jordan Hubbard. All rights reserved. 11 * Copyright (c) 1995 12 * Gary J Palmer. All rights reserved. 13 * 14 * Redistribution and use in source and binary forms, with or without 15 * modification, are permitted provided that the following conditions 16 * are met: 17 * 1. Redistributions of source code must retain the above copyright 18 * notice, this list of conditions and the following disclaimer, 19 * verbatim and that no modifications are made prior to this 20 * point in the file. 21 * 2. Redistributions in binary form must reproduce the above copyright 22 * notice, this list of conditions and the following disclaimer in the 23 * documentation and/or other materials provided with the distribution. | 8 * 9 * Copyright (c) 1995 10 * Jordan Hubbard. All rights reserved. 11 * Copyright (c) 1995 12 * Gary J Palmer. All rights reserved. 13 * 14 * Redistribution and use in source and binary forms, with or without 15 * modification, are permitted provided that the following conditions 16 * are met: 17 * 1. Redistributions of source code must retain the above copyright 18 * notice, this list of conditions and the following disclaimer, 19 * verbatim and that no modifications are made prior to this 20 * point in the file. 21 * 2. Redistributions in binary form must reproduce the above copyright 22 * notice, this list of conditions and the following disclaimer in the 23 * documentation and/or other materials provided with the distribution. |
24 * 3. All advertising materials mentioning features or use of this software 25 * must display the following acknowledgement: 26 * This product includes software developed by Jordan Hubbard 27 * for the FreeBSD Project. 28 * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to 29 * endorse or promote products derived from this software without specific 30 * prior written permission. | |
31 * 32 * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND 33 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 34 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 35 * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE 36 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 38 * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) --- 21 unchanged lines hidden (view full) --- 60 61static Device *floppyDev; 62static Boolean floppyMounted; 63 64static char *distWanted; 65 66/* For finding floppies */ 67static int | 24 * 25 * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND 26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) --- 21 unchanged lines hidden (view full) --- 53 54static Device *floppyDev; 55static Boolean floppyMounted; 56 57static char *distWanted; 58 59/* For finding floppies */ 60static int |
68floppyChoiceHook(char *str) | 61floppyChoiceHook(dialogMenuItem *self) |
69{ 70 Device **devs; 71 | 62{ 63 Device **devs; 64 |
72 /* Clip garbage off the ends */ 73 string_prune(str); 74 str = string_skipwhite(str); 75 if (!*str) 76 return RET_FAIL; 77 devs = deviceFind(str, DEVICE_TYPE_FLOPPY); | 65 devs = deviceFind(self->prompt, DEVICE_TYPE_FLOPPY); |
78 if (devs) 79 floppyDev = devs[0]; | 66 if (devs) 67 floppyDev = devs[0]; |
80 return devs ? RET_DONE : RET_FAIL; | 68 return devs ? DITEM_LEAVE_MENU : DITEM_FAILURE; |
81} 82 83/* Our last-ditch routine for getting ROOT from a floppy */ 84int 85getRootFloppy(void) 86{ 87 int fd = -1; 88 --- 11 unchanged lines hidden (view full) --- 100 else if (cnt == 1) { 101 floppyDev = devs[0]; 102 dialog_clear(); 103 msgConfirm("Please insert the ROOT floppy in %s and press [ENTER]", floppyDev->description); 104 } 105 else { 106 DMenu *menu; 107 | 69} 70 71/* Our last-ditch routine for getting ROOT from a floppy */ 72int 73getRootFloppy(void) 74{ 75 int fd = -1; 76 --- 11 unchanged lines hidden (view full) --- 88 else if (cnt == 1) { 89 floppyDev = devs[0]; 90 dialog_clear(); 91 msgConfirm("Please insert the ROOT floppy in %s and press [ENTER]", floppyDev->description); 92 } 93 else { 94 DMenu *menu; 95 |
108 menu = deviceCreateMenu(&MenuMediaFloppy, DEVICE_TYPE_FLOPPY, floppyChoiceHook); | 96 menu = deviceCreateMenu(&MenuMediaFloppy, DEVICE_TYPE_FLOPPY, floppyChoiceHook, NULL); |
109 menu->title = "Please insert the ROOT floppy"; 110 if (!dmenuOpenSimple(menu)) 111 return -1; 112 } 113 if (!floppyDev) 114 continue; 115 fd = open(floppyDev->devname, O_RDONLY); 116 if (isDebug()) --- 95 unchanged lines hidden --- | 97 menu->title = "Please insert the ROOT floppy"; 98 if (!dmenuOpenSimple(menu)) 99 return -1; 100 } 101 if (!floppyDev) 102 continue; 103 fd = open(floppyDev->devname, O_RDONLY); 104 if (isDebug()) --- 95 unchanged lines hidden --- |