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