~broder/ubuntu/natty/grub2/gfxpayload-blacklist

« back to all changes in this revision

Viewing changes to debian/patches/dmraid_mapper_paths.patch

  • Committer: Colin Watson
  • Date: 2010-09-19 22:54:11 UTC
  • mfrom: (1892.1.300 grub)
  • Revision ID: cjwatson@canonical.com-20100919225411-9d09pttxo2ry5rfb
merge from Debian 1.98+20100804-5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Fix DM-RAID probing with recent device-mapper udev rules
 
2
Author: Colin Watson <cjwatson@debian.org>
 
3
Origin: upstream, http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/2780
 
4
Forwarded: yes
 
5
Last-Update: 2010-09-17
 
6
 
 
7
Index: b/kern/emu/hostdisk.c
 
8
===================================================================
 
9
--- a/kern/emu/hostdisk.c
 
10
+++ b/kern/emu/hostdisk.c
 
11
@@ -968,13 +968,16 @@
 
12
 #ifdef __linux__
 
13
       /* On Linux, the devfs uses symbolic links horribly, and that
 
14
         confuses the interface very much, so use realpath to expand
 
15
-        symbolic links.  */
 
16
-      map[drive].device = xmalloc (PATH_MAX);
 
17
-      if (! realpath (p, map[drive].device))
 
18
-       grub_util_error ("cannot get the real path of `%s'", p);
 
19
-#else
 
20
-      map[drive].device = xstrdup (p);
 
21
+        symbolic links.  Leave /dev/mapper/ alone, though.  */
 
22
+      if (strncmp (p, "/dev/mapper/", 12) != 0)
 
23
+       {
 
24
+         map[drive].device = xmalloc (PATH_MAX);
 
25
+         if (! realpath (p, map[drive].device))
 
26
+           grub_util_error ("cannot get the real path of `%s'", p);
 
27
+       }
 
28
+      else
 
29
 #endif
 
30
+      map[drive].device = xstrdup (p);
 
31
     }
 
32
 
 
33
   fclose (fp);
 
34
@@ -1156,8 +1159,10 @@
 
35
        }
 
36
 
 
37
 #ifdef HAVE_DEVICE_MAPPER
 
38
-      /* If this is a DM-RAID device.  */
 
39
-      if ((strncmp ("mapper/", p, 7) == 0))
 
40
+      /* If this is a DM-RAID device.
 
41
+         Compare os_dev rather than path here, since nodes under
 
42
+         /dev/mapper/ are often symlinks.  */
 
43
+      if ((strncmp ("/dev/mapper/", os_dev, 12) == 0))
 
44
        {
 
45
          static struct dm_tree *tree = NULL;
 
46
          uint32_t maj, min;