On Thu, May 10, 2018 at 04:32:46PM +0300, Oleg Solovyov wrote: > 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 > > BUG: https://savannah.gnu.org/bugs/?53697 > > >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') > >???????? ?????? continue; > >??#endif > > > PS > I don't know what to do in case of //dev/dm-[0-9]+$/ yet
Your solution is not reliable. What about /dev/dm-10? I think that you should add check for /dev directory. This should work much better. Additionally, please use git format-patch/send-email to create and send patches. And do not forget about SOB (Signed-off-by). Good example is here: http://lists.gnu.org/archive/html/grub-devel/2018-04/msg00055.html Daniel _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel