* docs/grub.texi (Networking commands): Add documentation for
network related commands.
+2013-09-19 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * util/getroot.c (grub_util_open_dm): Check major rather than the name
+ to determine if device is handled by devmapper.
+ (convert_system_partition_to_system_disk): Likewise.
+ (get_dm_uuid): Don't check explicitly if device is mapped, it's
+ already done in grub_util_open_dm.
+
2013-09-19 Leif Lindholm <leif.lindholm@linaro.org>
* kern/arm/cache.S: Correct access to ilinesz/dlinesz variables.
*node = NULL;
*tree = NULL;
- if ((strncmp ("/dev/mapper/", os_dev, 12) != 0))
+ if (stat (os_dev, &st) < 0)
return 0;
- if (stat (os_dev, &st) < 0)
+ maj = major (st.st_rdev);
+ min = minor (st.st_rdev);
+
+ if (!dm_is_dm_major (maj))
return 0;
*tree = dm_tree_create ();
return 0;
}
- maj = major (st.st_rdev);
- min = minor (st.st_rdev);
-
if (! dm_tree_add_dev (*tree, maj, min))
{
grub_dprintf ("hostdisk", "dm_tree_add_dev failed\n");
const char *node_uuid;
char *ret;
- if ((strncmp ("/dev/mapper/", os_dev, 12) != 0))
- return NULL;
-
if (!grub_util_open_dm (os_dev, &tree, &node))
return NULL;
}
#ifdef HAVE_DEVICE_MAPPER
- if ((strncmp ("/dev/mapper/", path, sizeof ("/dev/mapper/") - 1) == 0)
- || (strncmp ("/dev/dm-", path, sizeof ("/dev/dm-") - 1) == 0))
+ if (dm_is_dm_major (major (st->st_rdev)))
{
struct dm_tree *tree;
uint32_t maj, min;