From 19e3f13632a20a0b1be12b6d6ff4c52ba4f3b4d6 Mon Sep 17 00:00:00 2001 From: Oleg Solovyov Date: Fri, 11 May 2018 13:55:46 +0300 Subject: [PATCH] Don't skip /dev/mapper/dm-* devices This patch ensures that grub-probe will find the root device placed in /dev/mapper/dm-[0-9]+-.* e.g. device named /dev/mapper/dm-0-luks will be found and grub.cfg will be updated properly, enabling the system to boot. Signed-off-by: Oleg Solovyov --- grub/grub-core/osdep/unix/getroot.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/grub/grub-core/osdep/unix/getroot.c b/grub/grub-core/osdep/unix/getroot.c index 4bf37b0..41d6574 100644 --- a/grub/grub-core/osdep/unix/getroot.c +++ b/grub/grub-core/osdep/unix/getroot.c @@ -428,8 +428,10 @@ grub_find_device (const char *dir, dev_t dev) { #ifdef __linux__ /* Skip device names like /dev/dm-0, which are short-hand aliases - to more descriptive device names, e.g. those under /dev/mapper */ - if (ent->d_name[0] == 'd' && + to more descriptive device names, e.g. those under /dev/mapper + Also, don't skip devices under /dev/mapper */ + if (strcmp (dir, "/dev") == 0 && + ent->d_name[0] == 'd' && ent->d_name[1] == 'm' && ent->d_name[2] == '-' && ent->d_name[3] >= '0' && -- 2.10.2