All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Solovyov <mcpain@basealt.ru>
To: grub-devel@gnu.org
Subject: [PATCH] Enable /dev/mapper/dm-[0-9]-* scanning
Date: Thu, 10 May 2018 16:32:46 +0300	[thread overview]
Message-ID: <6ef0e108-9b3c-0bb8-bf28-7fa013f01963@basealt.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1605 bytes --]

             reply	other threads:[~2018-05-10 14:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10 13:32 Oleg Solovyov [this message]
2018-05-10 19:35 ` [PATCH] Enable /dev/mapper/dm-[0-9]-* scanning Daniel Kiper
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=6ef0e108-9b3c-0bb8-bf28-7fa013f01963@basealt.ru \
    --to=mcpain@basealt.ru \
    --cc=grub-devel@gnu.org \
    /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.