Blame SOURCES/0072-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch

28f7f8
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
39700a
From: Vladimir Serbinenko <phcoder@gmail.com>
39700a
Date: Thu, 3 Apr 2014 21:31:12 +0200
28f7f8
Subject: [PATCH] * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk):
28f7f8
 Support NVMe device names.
39700a
39700a
---
39700a
 grub-core/osdep/linux/getroot.c | 17 +++++++++++++++++
28f7f8
 ChangeLog                       |  5 +++++
39700a
 2 files changed, 22 insertions(+)
39700a
39700a
diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
28f7f8
index 19581d32997..7007193d9c7 100644
39700a
--- a/grub-core/osdep/linux/getroot.c
39700a
+++ b/grub-core/osdep/linux/getroot.c
39700a
@@ -896,6 +896,23 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st,
39700a
 	  *pp = '\0';
39700a
 	  return path;
39700a
 	}
39700a
+
39700a
+      /* If this is a NVMe device */
39700a
+      if ((strncmp ("nvme", p, 4) == 0) && p[4] >= '0' && p[4] <= '9')
39700a
+	{
39700a
+	  char *pp = p + 4;
39700a
+	  while (*pp >= '0' && *pp <= '9')
39700a
+	    pp++;
39700a
+	  if (*pp == 'n')
39700a
+	    pp++;
39700a
+	  while (*pp >= '0' && *pp <= '9')
39700a
+	    pp++;
39700a
+	  if (*pp == 'p')
39700a
+	    *is_part = 1;
39700a
+	  /* /dev/nvme[0-9]+n[0-9]+p[0-9]* */
39700a
+	  *pp = '\0';
39700a
+	  return path;
39700a
+	}
39700a
     }
39700a
 
39700a
   return path;
28f7f8
diff --git a/ChangeLog b/ChangeLog
28f7f8
index accffade86b..4a484092a6f 100644
28f7f8
--- a/ChangeLog
28f7f8
+++ b/ChangeLog
28f7f8
@@ -1,3 +1,8 @@
28f7f8
+2014-04-03  Vladimir Serbinenko  <phcoder@gmail.com>
28f7f8
+
28f7f8
+	* grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Support NVMe
28f7f8
+	device names.
28f7f8
+
28f7f8
 2014-03-31  Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
28f7f8
 
28f7f8
 	btrfs: fix get_root key comparison failures due to endianness