Skip to contentSkip to conversation

don't scan floppy disks for LVM or RAID

PATCH [email protected] 1 participant 1 message Aug 18, 2008

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines · Bean

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

disk/lvm.c renamed from disk/lvm.c.orig +5 -0
@@ -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++)
     {
disk/raid.c renamed from disk/raid.c.orig +4 -1
@@ -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);