>From 810f62351dbb181843fdfdff7add4893e4e17710 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Tue, 5 May 2015 17:58:45 +0200 Subject: [PATCH] Allow for "lvmid/*" device map entries --- grub-core/kern/emu/hostdisk.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c index a3b00c8..81b9840 100644 --- a/grub-core/kern/emu/hostdisk.c +++ b/grub-core/kern/emu/hostdisk.c @@ -538,8 +538,14 @@ read_device_map (const char *dev_map) map[drive].device = grub_canonicalize_file_name (p); if (! map[drive].device) map[drive].device = xstrdup (p); - - if (!map[drive].drive) + + if (strncmp(drive_e, "lvmid/", sizeof("lvmid/") - 1) == 0) + { + map[drive].drive = xmalloc (drive_p - drive_e + sizeof ('\0')); + strncpy (map[drive].drive, drive_e, drive_p - drive_e + sizeof ('\0')); + map[drive].drive[drive_p - drive_e] = '\0'; + } + else if (!map[drive].drive) { char c; map[drive].drive = xmalloc (sizeof ("hostdisk/") + strlen (p)); -- 2.1.4