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

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