resources: grub: config: fix non-working regexp.

If we do 'ls' in grub, the LVM volumes looks like that: '(lvm/[...])'
and while in certain conditions, the parenthesis are not necessary, in
the case of the code that does the regexp, it is required.

I vaguely remember having made the original tests with Trisquel 10,
and if we select LVM in Trisquel 10 both in the graphical and
netinstall installers, it ends up creating a BIOS boot partition (code
ef02), an UEFI partition (code ef00) in the case of the graphical
installer, and an LVM physical volume. I then migrated the automatic
test to Trisquel 11 before sending it.

But with the Trisquel 11 automatic test, we end up with a boot
partition, so the test will always succeed regardless of weather or
not GRUB is capable of booting from LVM partitions.

This was also tested on real hardware with Trisquel 10 installed with
the graphical installer.

The most likely explanation is that the GRUB config file being tested
also differed from the one in git, especially because both the
automatic tests and the manual tests were tested with both a
non-working GRUB configuration and a working one.

In addition using the new configuration file on a computer that was
using an old Libreboot version probably from around 2016 was made to
boot again using this new configuration file, and this looks even
more strange.

A possible explanation could be that the GRUB version is different,
though the given computer is not available for further testing, so
it's not possible to confirm that hypothesis.

Reported-by: Adrien Bourmault <neox@gnu.org>
neox: private bug report and the information on how to fix it.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Tested-by: Adrien 'neox' Bourmault <neox@gnu.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2024-12-13 14:58:50 +01:00 committed by Adrien 'neox' Bourmault
parent adff0c4436
commit ce01a8a7cf
Signed by: neox
GPG Key ID: 57BC26A3687116F6
1 changed files with 3 additions and 3 deletions

View File

@ -107,7 +107,7 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
fi fi
for device in (*) ; do for device in (*) ; do
if regexp ^lvm/ $device ; then if regexp "^\(lvm/" "${device}" ; then
try_user_config "${device}" try_user_config "${device}"
fi fi
done done
@ -141,7 +141,7 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
done done
for device in (*) ; do for device in (*) ; do
if regexp ^lvm/ "${device}" ; then if regexp "^\(lvm/" "${device}" ; then
if cryptomount "${device}" ; then break ; fi if cryptomount "${device}" ; then break ; fi
fi fi
done done
@ -152,7 +152,7 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
# after cryptomount, lvm volumes might be available # after cryptomount, lvm volumes might be available
for device in (*) ; do for device in (*) ; do
if regexp ^lvm/ $device ; then if regexp "^\(lvm/" "${device}" ; then
try_user_config "${device}" try_user_config "${device}"
fi fi
done done