mirror of
https://src.fedoraproject.org/rpms/grub2.git
synced 2024-11-28 07:44:52 +00:00
7045ce64ed
backport upstream rev 4408: Don't canonicalise /dev/root and /dev/dm-*.
29 lines
878 B
Diff
29 lines
878 B
Diff
From: Valdimir Serbinenko <phcoder@gmail.com>
|
|
Subject: Don't canonicalise /dev/root and /dev/dm-*.
|
|
|
|
upstream rev 4408
|
|
|
|
--- a/util/getroot.c 2012-05-28 15:43:12 +0000
|
|
+++ b/util/getroot.c 2012-06-02 12:36:27 +0000
|
|
@@ -1036,10 +1036,16 @@
|
|
{
|
|
char *tmp = *cur;
|
|
int root, dm;
|
|
- *cur = canonicalize_file_name (tmp);
|
|
- if (*cur == NULL)
|
|
- grub_util_error (_("failed to get canonical path of %s"), tmp);
|
|
- free (tmp);
|
|
+ if (strcmp (*cur, "/dev/root") == 0
|
|
+ || strncmp (*cur, "/dev/dm-", sizeof ("/dev/dm-") - 1) == 0)
|
|
+ *cur = tmp;
|
|
+ else
|
|
+ {
|
|
+ *cur = canonicalize_file_name (tmp);
|
|
+ if (*cur == NULL)
|
|
+ grub_util_error (_("failed to get canonical path of %s"), tmp);
|
|
+ free (tmp);
|
|
+ }
|
|
root = (strcmp (*cur, "/dev/root") == 0);
|
|
dm = (strncmp (*cur, "/dev/dm-", sizeof ("/dev/dm-") - 1) == 0);
|
|
if (!dm && !root)
|
|
|