From 860b00bf1e798d86c8bb2a70d77633599dfa1da2 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Thu, 27 Jun 2024 02:40:56 +0200 Subject: [PATCH] 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 Signed-off-by: Denis 'GNUtoo' Carikli Acked-by: Adrien Bourmault --- resources/grub/config/grub.cfg | 30 ++++++++++++++++++++---------- website/pages/status.md | 2 -- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/resources/grub/config/grub.cfg b/resources/grub/config/grub.cfg index 08f5011..511e4ce 100644 --- a/resources/grub/config/grub.cfg +++ b/resources/grub/config/grub.cfg @@ -1,4 +1,4 @@ -# Copyright (C) 2013 Denis 'GNUtoo' Carikli +# Copyright (C) 2013, 2024 Denis 'GNUtoo' Carikli # Copyright (C) 2013-2016, 2020-2021 Leah Rowe # Copyright (C) 2021 Vitali64 # Copyright (C) 2023 Adrien 'neox' Bourmault @@ -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 diff --git a/website/pages/status.md b/website/pages/status.md index 75df234..c157736 100644 --- a/website/pages/status.md +++ b/website/pages/status.md @@ -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 | | +------------------+----------------------------------------+---------------------------------------------------------+