]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
linux/getroot: Handle rssd storage device names
authorPeter Jones <pjones@redhat.com>
Wed, 4 Mar 2020 11:58:40 +0000 (12:58 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 10 Mar 2020 20:39:34 +0000 (21:39 +0100)
The Micron PCIe SSDs Linux driver (mtip32xx) exposes block devices
as /dev/rssd[a-z]+[0-9]*. Add support for these rssd device names.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/osdep/linux/getroot.c

index 90d92d3ad5ca71fc64e57e0b08eada4813f16c37..6d9f4e5faa24934ab022cc9995d87f95aa5f1317 100644 (file)
@@ -921,6 +921,19 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st,
          return path;
        }
 
+      /* If this is an rssd device. */
+      if ((strncmp ("rssd", p, 4) == 0) && p[4] >= 'a' && p[4] <= 'z')
+       {
+         char *pp = p + 4;
+         while (*pp >= 'a' && *pp <= 'z')
+           pp++;
+         if (*pp)
+           *is_part = 1;
+         /* /dev/rssd[a-z]+[0-9]* */
+         *pp = '\0';
+         return path;
+       }
+
       /* If this is a loop device */
       if ((strncmp ("loop", p, 4) == 0) && p[4] >= '0' && p[4] <= '9')
        {