]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2003-11-30 Yoshinori K. Okuji <okuji@enbug.org>
authorokuji <okuji@localhost>
Sun, 30 Nov 2003 17:13:12 +0000 (17:13 +0000)
committerokuji <okuji@localhost>
Sun, 30 Nov 2003 17:13:12 +0000 (17:13 +0000)
* lib/device.c (read_device_map) (sho_warning): New internal
function.
(read_device_map): If DRIVE is greater than 8, emit a warning
and ignore the drive, rather than exiting abnormally.
Reported by Greg Newby <newby@arsc.edu>.

ChangeLog
lib/device.c

index f65b1995a608946d73cb18490403deaff649a86d..988db64be3b429b224957b3c2dfbcf4592681e1e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-11-30  Yoshinori K. Okuji  <okuji@enbug.org>
+
+       * lib/device.c (read_device_map) (sho_warning): New internal
+       function.
+       (read_device_map): If DRIVE is greater than 8, emit a warning
+       and ignore the drive, rather than exiting abnormally.
+       Reported by Greg Newby <newby@arsc.edu>.
+
 2003-10-19  Yoshinori K. Okuji  <okuji@enbug.org>
 
        Migrated to newer autotools. Also, don't install mkbimage
index a88a2db908047ffb07b923c3d44ebeb8b84f9b0a..69a8dab4f405fca60704d9515fe0a0050bcd93e1 100644 (file)
@@ -34,6 +34,7 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <limits.h>
+#include <stdarg.h>
 
 #ifdef __linux__
 # if !defined(__GLIBC__) || \
@@ -395,6 +396,16 @@ read_device_map (FILE *fp, char **map, const char *map_file)
       fprintf (stderr, "%s:%d: error: %s\n", map_file, no, msg);
     }
   
+  static void show_warning (int no, const char *msg, ...)
+    {
+      va_list ap;
+      
+      va_start (ap, msg);
+      fprintf (stderr, "%s:%d: warning: ", map_file, no);
+      vfprintf (stderr, msg, ap);
+      va_end (ap);
+    }
+  
   /* If there is the device map file, use the data in it instead of
      probing devices.  */
   char buf[1024];              /* XXX */
@@ -440,11 +451,18 @@ read_device_map (FILE *fp, char **map, const char *map_file)
       
       ptr += 2;
       drive = strtoul (ptr, &ptr, 10);
-      if (drive < 0 || drive > 8)
+      if (drive < 0)
        {
          show_error (line_number, "Bad device number");
          return 0;
        }
+      else if (drive > 8)
+       {
+         show_warning (line_number,
+                       "Ignoring %cd%d due to a BIOS limitation",
+                       is_floppy ? 'f' : 'h', drive);
+         continue;
+       }
       
       if (! is_floppy)
        drive += 0x80;