ressources/grub, website: add LVM2 support (fix bug #65663 "No support for LVM2").

This commit fixes a bug causing the GRUB2 payload not finding
LVM2 partitions.

See https://savannah.gnu.org/bugs/index.php?65663

Reported-by: WodeShengli <wodeshengli@disroot.org>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien Bourmault <neox@gnu.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2024-06-27 02:40:56 +02:00 committed by Adrien Bourmault
parent f55201d2f3
commit 860b00bf1e
Signed by: neox
GPG Key ID: 57BC26A3687116F6
2 changed files with 20 additions and 12 deletions

View File

@ -1,4 +1,4 @@
# Copyright (C) 2013 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
# Copyright (C) 2013, 2024 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
# Copyright (C) 2013-2016, 2020-2021 Leah Rowe <leah@libreboot.org>
# Copyright (C) 2021 Vitali64 <vitali64pmemail@protonmail.com>
# Copyright (C) 2023 Adrien 'neox' Bourmault <neox@gnu.org>
@ -102,18 +102,18 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
search_grub ata
fi
# grub device enumeration is very slow, so checks are hardcoded
# TODO: add more strings, based on what distros set up when
# the user select auto-partitioning on those installers
lvmvol="lvm/matrix-bootvol lvm/matrix-rootvol"
for device in (*) ; do
if regexp ^lvm/ $device ; then
try_user_config "${device}"
fi
done
raidvol="md/0 md/1 md/2 md/3 md/4 md/5 md/6 md/7 md/8 md/9"
# in practise, doing multiple redundant checks is perfectly fast and
# TODO: optimize grub itself, and use */? here for everything
for vol in ${lvmvol} ${raidvol} ; do
for vol in ${raidvol} ; do
try_user_config "${vol}"
done
@ -132,15 +132,25 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
set pager=0
echo -n "Attempting to unlock encrypted volumes"
for dev in ${ahcidev} ${atadev} ${lvmvol} ${raidvol}; do
for dev in ${ahcidev} ${atadev} ${raidvol}; do
if cryptomount "${dev}" ; then break ; fi
done
for device in (*) ; do
if regexp ^lvm/ $dev ; then
if cryptomount "${dev}" ; then break ; fi
fi
done
set pager=1
echo
# after cryptomount, lvm volumes might be available
for vol in ${lvmvol}; do
try_user_config "${vol}"
for device in (*) ; do
if regexp ^lvm/ $device ; then
try_user_config "${device}"
fi
done
search_grub crypto

View File

@ -421,8 +421,6 @@ Limitations
+------------------+----------------------------------------+---------------------------------------------------------+
| Component | Limitations | Bug number |
+------------------+----------------------------------------+---------------------------------------------------------+
| GRUB images | - No support for LVM2 | [#65663](https://savannah.gnu.org/bugs/index.php?65663) |
+------------------+----------------------------------------+---------------------------------------------------------+
| SeaBIOS images | - No VGA support | [#65922](https://savannah.gnu.org/bugs/index.php?65922) |
| | => Require to edit /etc/default/grub | |
+------------------+----------------------------------------+---------------------------------------------------------+