]> git.proxmox.com Git - grub2.git/commitdiff
Probe FusionIO devices
authorColin Watson <cjwatson@ubuntu.com>
Mon, 13 Jan 2014 12:13:31 +0000 (12:13 +0000)
committerColin Watson <cjwatson@debian.org>
Mon, 13 Jan 2014 12:30:40 +0000 (12:30 +0000)
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1237519
Forwarded: no
Last-Update: 2013-11-15

Patch-Name: probe_fusionio.patch

grub-core/osdep/linux/getroot.c
util/deviceiter.c

index 772de0a9bc4492a321c2dfccf7740148a53d2a39..6788e394404f09500a3ce932f0866db18c748824 100644 (file)
@@ -883,6 +883,19 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st,
          *pp = '\0';
          return path;
        }
+
+      /* If this is a FusionIO disk.  */
+      if ((strncmp ("fio", p, 3) == 0) && p[3] >= 'a' && p[3] <= 'z')
+       {
+         char *pp = p + 3;
+         while (*pp >= 'a' && *pp <= 'z')
+           pp++;
+         if (*pp)
+           *is_part = 1;
+         /* /dev/fio[a-z]+[0-9]* */
+         *pp = '\0';
+         return path;
+       }
     }
 
   return path;
index bd7b993215e9b8500c399904a82eda35685cd3af..e160fa015ab3a146d0cbca1451161f1175f388a8 100644 (file)
@@ -365,6 +365,12 @@ get_xvd_disk_name (char *name, int unit)
 {
   sprintf (name, "/dev/xvd%c", unit + 'a');
 }
+
+static void
+get_fio_disk_name (char *name, int unit)
+{
+  sprintf (name, "/dev/fio%c", unit + 'a');
+}
 #endif
 
 static struct seen_device
@@ -856,6 +862,19 @@ grub_util_iterate_devices (int (*hook) (const char *, int, void *), void *hook_d
        }
     }
 
+  /* FusionIO.  */
+  for (i = 0; i < 26; i++)
+    {
+      char name[16];
+
+      get_fio_disk_name (name, i);
+      if (check_device_readable_unique (name))
+       {
+         if (hook (name, 0, hook_data))
+           goto out;
+       }
+    }
+
 # ifdef HAVE_DEVICE_MAPPER
 #  define dmraid_check(cond, ...) \
   if (! (cond)) \