All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Kiper <dkiper@net-space.pl>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: mcpain@basealt.ru, dkiper@net-space.pl
Subject: Re: [PATCH] Enable /dev/mapper/dm-[0-9]-* scanning
Date: Thu, 10 May 2018 21:35:51 +0200	[thread overview]
Message-ID: <20180510193551.GL25320@router-fw-old.local.net-space.pl> (raw)
In-Reply-To: <6ef0e108-9b3c-0bb8-bf28-7fa013f01963@basealt.ru>

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	other threads:[~2018-05-10 19:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10 13:32 [PATCH] Enable /dev/mapper/dm-[0-9]-* scanning Oleg Solovyov
2018-05-10 19:35 ` Daniel Kiper [this message]
2018-05-11 11:32   ` Oleg Solovyov
2018-05-14 17:13     ` Daniel Kiper
2018-05-29 11:57       ` Oleg Solovyov
2018-05-29 13:50         ` Vladimir 'phcoder' Serbinenko
2018-05-29 13:55           ` Oleg Solovyov
2018-05-29 14:31             ` Daniel Kiper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180510193551.GL25320@router-fw-old.local.net-space.pl \
    --to=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=mcpain@basealt.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.