]> 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, 27 Sep 2021 19:09:38 +0000 (20:09 +0100)
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1237519
Forwarded: no
Last-Update: 2016-09-18

Patch-Name: probe-fusionio.patch

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

index 001b818fe581da2b5eecbdb2025cef316e3ff1ae..c506f4cb502663eccf7181f48547d3270cc9b085 100644 (file)
@@ -963,6 +963,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 b5b9ac6aba0cb201d2da3b4cc50833e5b54570dc..3a8f2770eb0fa99b7e45ae4b46b848db96ad7d8a 100644 (file)
@@ -384,6 +384,12 @@ get_nvme_disk_name (char *name, int controller, int namespace)
 {
   sprintf (name, "/dev/nvme%dn%d", controller, namespace);
 }
+
+static void
+get_fio_disk_name (char *name, int unit)
+{
+  sprintf (name, "/dev/fio%c", unit + 'a');
+}
 #endif
 
 static struct seen_device
@@ -929,6 +935,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)) \