Fix DM-RAID probing with recent versions of device-mapper udev
rules. * grub-core/kern/emu/hostdisk.c (read_device_map): Don't canonicalise device paths under /dev/mapper/. (convert_system_partition_to_system_disk): Compare the uncanonicalised path to /dev/mapper/ rather than the canonicalised path, since device nodes under /dev/mapper/ are often symlinks.
This commit is contained in:
parent
0f7ee3c969
commit
a939d135ec
2 changed files with 24 additions and 8 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2010-09-17 Colin Watson <cjwatson@ubuntu.com>
|
||||||
|
|
||||||
|
Fix DM-RAID probing with recent versions of device-mapper udev
|
||||||
|
rules.
|
||||||
|
|
||||||
|
* grub-core/kern/emu/hostdisk.c (read_device_map): Don't
|
||||||
|
canonicalise device paths under /dev/mapper/.
|
||||||
|
(convert_system_partition_to_system_disk): Compare the
|
||||||
|
uncanonicalised path to /dev/mapper/ rather than the canonicalised
|
||||||
|
path, since device nodes under /dev/mapper/ are often symlinks.
|
||||||
|
|
||||||
2010-09-17 Yves Blusseau <blusseau@zetam.org>
|
2010-09-17 Yves Blusseau <blusseau@zetam.org>
|
||||||
|
|
||||||
* .bzrignore: *.d removed (old rule), add *.image and symlist.h.
|
* .bzrignore: *.d removed (old rule), add *.image and symlist.h.
|
||||||
|
|
|
@ -955,13 +955,16 @@ read_device_map (const char *dev_map)
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
/* On Linux, the devfs uses symbolic links horribly, and that
|
/* On Linux, the devfs uses symbolic links horribly, and that
|
||||||
confuses the interface very much, so use realpath to expand
|
confuses the interface very much, so use realpath to expand
|
||||||
symbolic links. */
|
symbolic links. Leave /dev/mapper/ alone, though. */
|
||||||
map[drive].device = xmalloc (PATH_MAX);
|
if (strncmp (p, "/dev/mapper/", 12) != 0)
|
||||||
if (! realpath (p, map[drive].device))
|
{
|
||||||
grub_util_error ("cannot get the real path of `%s'", p);
|
map[drive].device = xmalloc (PATH_MAX);
|
||||||
#else
|
if (! realpath (p, map[drive].device))
|
||||||
map[drive].device = xstrdup (p);
|
grub_util_error ("cannot get the real path of `%s'", p);
|
||||||
|
}
|
||||||
|
else
|
||||||
#endif
|
#endif
|
||||||
|
map[drive].device = xstrdup (p);
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
|
@ -1153,8 +1156,10 @@ convert_system_partition_to_system_disk (const char *os_dev, struct stat *st)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_DEVICE_MAPPER
|
#ifdef HAVE_DEVICE_MAPPER
|
||||||
/* If this is a DM-RAID device. */
|
/* If this is a DM-RAID device.
|
||||||
if ((strncmp ("mapper/", p, 7) == 0))
|
Compare os_dev rather than path here, since nodes under
|
||||||
|
/dev/mapper/ are often symlinks. */
|
||||||
|
if ((strncmp ("/dev/mapper/", os_dev, 12) == 0))
|
||||||
{
|
{
|
||||||
static struct dm_tree *tree = NULL;
|
static struct dm_tree *tree = NULL;
|
||||||
uint32_t maj, min;
|
uint32_t maj, min;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue