7045ce6
From: Valdimir Serbinenko <phcoder@gmail.com>
7045ce6
Subject: Don't canonicalise /dev/root and /dev/dm-*.
7045ce6
7045ce6
upstream rev 4408
7045ce6
7045ce6
--- a/util/getroot.c	2012-05-28 15:43:12 +0000
7045ce6
+++ b/util/getroot.c	2012-06-02 12:36:27 +0000
7045ce6
@@ -1036,10 +1036,16 @@
7045ce6
 	{
7045ce6
 	  char *tmp = *cur;
7045ce6
 	  int root, dm;
7045ce6
-	  *cur = canonicalize_file_name (tmp);
7045ce6
-	  if (*cur == NULL)
7045ce6
-	    grub_util_error (_("failed to get canonical path of %s"), tmp);
7045ce6
-	  free (tmp);
7045ce6
+	  if (strcmp (*cur, "/dev/root") == 0
7045ce6
+	      || strncmp (*cur, "/dev/dm-", sizeof ("/dev/dm-") - 1) == 0)
7045ce6
+	    *cur = tmp;
7045ce6
+	  else
7045ce6
+	    {
7045ce6
+	      *cur = canonicalize_file_name (tmp);
7045ce6
+	      if (*cur == NULL)
7045ce6
+		grub_util_error (_("failed to get canonical path of %s"), tmp);
7045ce6
+	      free (tmp);
7045ce6
+	    }
7045ce6
 	  root = (strcmp (*cur, "/dev/root") == 0);
7045ce6
 	  dm = (strncmp (*cur, "/dev/dm-", sizeof ("/dev/dm-") - 1) == 0);
7045ce6
 	  if (!dm && !root)
7045ce6