Received: from list by lists.gnu.org with archive (Exim 4.71) id 1fGmA2-0005QR-S9 for mharc-grub-devel@gnu.org; Thu, 10 May 2018 10:03:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGlgc-0004wz-Cn for grub-devel@gnu.org; Thu, 10 May 2018 09:32:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGlgX-0005Ra-GQ for grub-devel@gnu.org; Thu, 10 May 2018 09:32:46 -0400 Received: from air.basealt.ru ([194.107.17.39]:57110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGlgX-0005Qy-40 for grub-devel@gnu.org; Thu, 10 May 2018 09:32:41 -0400 Received: by air.basealt.ru (Postfix, from userid 490) id D93AB589EA0; Thu, 10 May 2018 13:32:38 +0000 (UTC) Received: from Work-PC.localdomain (obninsk.basealt.ru [217.15.195.17]) by air.basealt.ru (Postfix) with ESMTPSA id 9A5C6589AA4 for ; Thu, 10 May 2018 13:32:36 +0000 (UTC) From: Oleg Solovyov Subject: [PATCH] Enable /dev/mapper/dm-[0-9]-* scanning To: grub-devel@gnu.org Message-ID: <6ef0e108-9b3c-0bb8-bf28-7fa013f01963@basealt.ru> 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 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------314C013A7EF07FC04EBEB4A0" Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 194.107.17.39 X-Mailman-Approved-At: Thu, 10 May 2018 10:03:09 -0400 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 May 2018 13:32:47 -0000 This is a multi-part message in MIME format. --------------314C013A7EF07FC04EBEB4A0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable This code was modified because the original code skips any device with=20 basename starts with /dm-[0-9]/ e.g. if the root device path is //dev/mapper/dm-0-luks/ it won't be=20 detected by grub-probe and "root=3D" parameter in grub.cfg will be empty=20 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=20 > 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) > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ent->d_name[1] = =3D=3D 'm' && > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ent->d_name[2] = =3D=3D '-' && > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ent->d_name[3] = >=3D '0' && > -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ent->d_name[3] <=3D = '9') > +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ent->d_name[3] <=3D = '9' && > +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ent->d_name[4] =3D=3D= '\0') > =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 continue; > =C2=A0#endif > PS I don't know what to do in case of //dev/dm-[0-9]+$/ yet --------------314C013A7EF07FC04EBEB4A0 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=3D" 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) =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ent->d_n= ame[1] =3D=3D 'm' &&
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ent->d_n= ame[2] =3D=3D '-' &&
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ent->d_n= ame[3] >=3D '0' &&
-=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ent->d_name[3= ] <=3D '9')
+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ent->d_name[3= ] <=3D '9' &&
+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ent->d_name[4= ] =3D=3D '\0')
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 continue;
=C2=A0#endif
=C2=A0
PS
I don't know what to do in case of /dev/dm-[0-9]+$ yet
--------------314C013A7EF07FC04EBEB4A0--