grub-devel
[Top][All Lists]
Advanced

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

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


From: Daniel Kiper
Subject: Re: [PATCH] Enable /dev/mapper/dm-[0-9]-* scanning
Date: Thu, 10 May 2018 21:35:51 +0200
User-agent: Mutt/1.3.28i

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



reply via email to

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