[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Wait longer for usb floppy access (#211222)



Hi, Peter Jones and all.

I found the following changelog in RHEL5 anaconda.spec.

* Thu Jan  4 2007 Peter Jones <pjones redhat com> - 11.1.2.27-1
- Include cdroms in the scsi disk count (katzj, #207336)
- Translation display fixes (katzj, #216067)
- Wait longer for usb floppy access (#211222)   <-- here
- Make the package repo path list right (#221260)

and also find the following code in loader2/kickstart.c

/* usb can take some time to settle, even with the various hacks we
 * have in place.  so if we've been requested to ks from a floppy, try to
 * make sure there really isn't one before bailing */
while (!devices && (i++ < 10)) {
    logMessage(DEBUGLVL, "sleeping to wait for a floppy...");
    sleep(1);
    devices = probeDevices(CLASS_FLOPPY, BUS_MISC | BUS_IDE | BUS_SCSI,
PROBE_LOADED);
}

but sometimes anaconda can not do kickstart with usb-floppy and
go to reboot using anaconda-11.1.2.36-1(RHEL5 anaconda).
I found that even if devices is not NULL, it is possible that
devices[i]->device is NULL.

so I have three questions about it.
If you could (have a time), would you check these question, please?

1. in this case, do you think it is better that
   kudzu(not anaconda) care about it?
2. Would you give me your review about the attached patch?
3. How about CVS anaconda ?
   (CVS anaconda will not encounter this issue?)

thank you in advance


diff -uNrp anaconda-11.1.2.36.org/loader2/kickstart.c anaconda-11.1.2.36/loader2/kickstart.c
--- anaconda-11.1.2.36.org/loader2/kickstart.c	2007-01-10 02:37:10.000000000 +0900
+++ anaconda-11.1.2.36/loader2/kickstart.c	2007-06-22 19:34:42.000000000 +0900
@@ -238,32 +238,33 @@ int ksGetCommand(int cmd, char ** last, 
 }
 
 int kickstartFromFloppy(char *kssrc) {
-    struct device ** devices;
+    struct device ** devices = NULL;
     char *p, *kspath;
     int i = 0, rc;
 
     logMessage(INFO, "doing kickstart from floppy");
-    devices = probeDevices(CLASS_FLOPPY, BUS_MISC | BUS_IDE | BUS_SCSI, PROBE_LOADED);
     /* usb can take some time to settle, even with the various hacks we 
      * have in place.  so if we've been requested to ks from a floppy, try to
      * make sure there really isn't one before bailing */
     while (!devices && (i++ < 10)) { 
+        devices = probeDevices(CLASS_FLOPPY, BUS_MISC | BUS_IDE | BUS_SCSI, PROBE_LOADED);
+        if (devices) {
+            for (i = 0; devices[i]; i++) {
+                if (devices[i]->detached == 0 && devices[i]->device != NULL) {
+                    logMessage(INFO, "first non-detached floppy is %s", devices[i]->device);
+                    goto _detect;
+                }
+            }
+        }
         logMessage(DEBUGLVL, "sleeping to wait for a floppy...");
         sleep(1);
-        devices = probeDevices(CLASS_FLOPPY, BUS_MISC | BUS_IDE | BUS_SCSI, PROBE_LOADED);
     }
     if (!devices) {
         logMessage(ERROR, "no floppy devices");
         return 1;
     }
 
-    for (i = 0; devices[i]; i++) {
-        if (devices[i]->detached == 0) {
-            logMessage(INFO, "first non-detached floppy is %s", devices[i]->device);
-            break;
-        }
-    }
-
+_detect:
     if (!devices[i] || (devices[i]->detached != 0)) {
         logMessage(ERROR, "no floppy devices");
         return 1;

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]