[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Enable /dev/mapper/dm-[0-9]-* scanning

From: Oleg Solovyov
Subject: [PATCH] Enable /dev/mapper/dm-[0-9]-* scanning
Date: Thu, 10 May 2018 16:32:46 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

This code was modified because the original code skips any device with basename starts with dm-[0-9]
e.g. if the root device path is /dev/mapper/dm-0-luks it won't be detected by grub-probe and "root=" parameter in grub.cfg will be empty and the system will be unbootable unless you manually edit grub.cfg


diff --git a/grub/grub-core/osdep/unix/getroot.c b/grub/grub-core/osdep/unix/getroot.c
index 4bf37b0..2964dcd 100644
--- a/grub/grub-core/osdep/unix/getroot.c
+++ b/grub/grub-core/osdep/unix/getroot.c
@@ -433,7 +433,8 @@ grub_find_device (const char *dir, dev_t dev)
           ent->d_name[1] == 'm' &&
           ent->d_name[2] == '-' &&
           ent->d_name[3] >= '0' &&
-          ent->d_name[3] <= '9')
+          ent->d_name[3] <= '9' &&
+          ent->d_name[4] == '\0')
I don't know what to do in case of /dev/dm-[0-9]+$ yet

reply via email to

[Prev in Thread] Current Thread [Next in Thread]