diff options
Diffstat (limited to 'config/grub/nvme')
-rw-r--r-- | config/grub/nvme/config/payload | 36 | ||||
-rw-r--r-- | config/grub/nvme/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch | 2 |
2 files changed, 24 insertions, 14 deletions
diff --git a/config/grub/nvme/config/payload b/config/grub/nvme/config/payload index 52b8dfd9..22dd8fe1 100644 --- a/config/grub/nvme/config/payload +++ b/config/grub/nvme/config/payload @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later -# Copyright (C) 2014-2016,2020-2021,2023-2024 Leah Rowe <leah@libreboot.org> +# Copyright (C) 2014-2016,2020-2021,2023-2025 Leah Rowe <leah@libreboot.org> # Copyright (C) 2015 Klemens Nanni <contact@autoboot.org> set prefix=(memdisk)/boot/grub @@ -155,16 +155,12 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o # 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/grubcrypt-bootvol lvm/grubcrypt-rootvol" - 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 + # in practise, doing multiple redundant checks is perfectly fast # TODO: optimize grub itself, and use */? here for everything - for vol in ${lvmvol} ${raidvol} ; do + for vol in ${raidvol} ; do try_bootcfg "${vol}" done @@ -186,23 +182,37 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o set pager=0 echo -n "Attempting to unlock encrypted volumes" - for dev in ${bootdev} ${lvmvol} ${raidvol}; do + for dev in ${bootdev} ${raidvol}; do if cryptomount "${dev}" ; then break ; fi done set pager=1 echo + search_bootcfg crypto + + lvmvol="" + # after cryptomount, lvm volumes might be available + # using * is slow on some machines, but we use it here, + # just once. in so doing, we find every lvm volume + for vol in (*); do + if regexp ^lvm/ $vol; then + lvmvol="${lvmvol} ${vol}" + try_bootcfg "${vol}" + fi + done + + # user might have put luks inside lvm + set pager=0 + echo "Attempting to unlock encrypted LVMs" for vol in ${lvmvol}; do - try_bootcfg "${vol}" + cryptomount "$vol" done + set pager=1 + echo search_bootcfg crypto - for vol in lvm/* ; do - try_bootcfg "${vol}" - done - true # Prevent pager requiring to accept each line instead of whole screen } diff --git a/config/grub/nvme/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch b/config/grub/nvme/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch index 5036a859..259301cc 100644 --- a/config/grub/nvme/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch +++ b/config/grub/nvme/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch @@ -16,7 +16,7 @@ index bd4431000..ff16e0f2e 100644 grub_term_cls (term); - msg_formatted = grub_xasprintf (_("GNU GRUB version %s"), PACKAGE_VERSION); -+ msg_formatted = grub_xasprintf (_("Libreboot 20241206 release, based on coreboot. https://libreboot.org/")); ++ msg_formatted = grub_xasprintf (_("Libreboot 20241206, 8th revision (GRUB menu): https://libreboot.org/")); if (!msg_formatted) return; |