Bug#495049: don't scan floppy disks for LVM or RAID

ian_bruce at fastmail.fm ian_bruce at fastmail.fm
Sat Aug 16 13:48:51 UTC 2008


Bean wrote:

> Just like raid, lvm needs to scan all device. I think this is caused
> when it try to open (fd0), and fails. The grub_errno is not cleared,
> it's carried out and cause the rescue shell. I think we can improve
> the test of (fd0) so that it won't appear in machine that don' t have
> floppy, or reset grub_errno in lvm scan code when error occurs.


http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495049


--- grub2/disk/lvm.c.orig	2008-08-16 03:00:30.000000000 -0700
+++ grub2/disk/lvm.c	2008-08-16 06:07:43.000000000 -0700
@@ -221,10 +221,15 @@
   struct grub_lvm_vg *vg;
   struct grub_lvm_pv *pv;
   
+  if (name[0]=='f' && name[1]=='d')
+    return 0;
+
   disk = grub_disk_open (name);
   if (!disk)
     return 0;
 
+  grub_dprintf ("lvm", "Scanning (%s) for LVM devices\n", name);
+
   /* Search for label. */
   for (i = 0; i < GRUB_LVM_LABEL_SCAN_SECTORS; i++)
     {
--- grub2/disk/raid.c.orig	2008-08-16 03:00:30.000000000 -0700
+++ grub2/disk/raid.c	2008-08-16 06:07:46.000000000 -0700
@@ -358,12 +358,15 @@
   struct grub_raid_super_09 sb;
   struct grub_raid_array *p, *array = NULL;
 
-  grub_dprintf ("raid", "Scanning for RAID devices\n");
+  if (name[0]=='f' && name[1]=='d')
+    return 0;
 
   disk = grub_disk_open (name);
   if (!disk)
     return 0;
 
+  grub_dprintf ("raid", "Scanning (%s) for RAID devices\n", name);
+
   /* The sector where the RAID superblock is stored, if available. */
   size = grub_disk_get_size (disk);
   sector = GRUB_RAID_NEW_SIZE_SECTORS(size);






More information about the Pkg-grub-devel mailing list