]> 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)
committerSteve McIntyre <93sam@debian.org>
Tue, 25 Jun 2019 09:11:12 +0000 (10:11 +0100)
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1237519
Forwarded: no
Last-Update: 2016-09-18

Patch-Name: probe_fusionio.patch

Gbp-Pq: Name probe_fusionio.patch

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

index 90d92d3ad5ca71fc64e57e0b08eada4813f16c37..7adc0f30eed2e56af010e88d4c5303bf1a16dac4 100644 (file)
@@ -950,6 +950,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 a4971ef4293796e4b6ad5c101f16d58bbf730d17..dddc50da7aa9326904fa2e75d6b48f55331a366e 100644 (file)
@@ -383,6 +383,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
@@ -923,6 +929,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)) \