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
5
Last-Update: 2010-09-17
7
Index: b/kern/emu/hostdisk.c
8
===================================================================
9
--- a/kern/emu/hostdisk.c
10
+++ b/kern/emu/hostdisk.c
13
/* On Linux, the devfs uses symbolic links horribly, and that
14
confuses the interface very much, so use realpath to expand
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);
20
- map[drive].device = xstrdup (p);
21
+ symbolic links. Leave /dev/mapper/ alone, though. */
22
+ if (strncmp (p, "/dev/mapper/", 12) != 0)
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);
30
+ map[drive].device = xstrdup (p);
34
@@ -1156,8 +1159,10 @@
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))
45
static struct dm_tree *tree = NULL;