Subject: [PATCH] gnu: grub: load lvm grub module.

From: [email-masked]
Date: Sat, 8 Jun 2024 18:13:36 +0200

From: Ashish SHUKLA <[email-masked]>

* gnu/bootloader/grub.scm (make-grub-configuration): load lvm grub module
  when generating configuration for cryptodisks setup.

Change-Id: I1dbb0c7dbf68a5f93db76dc29793a1f73be49ee2
---
Hi,

I have a Guix setup which has a LUKS2 partition containing a LVM
volume group on which kernels and initrds reside. I think this is one
of the common setups in which folks uses disk-encryption on
GNU/Linux. Since in Guix the kernels/initrd don't get copied to /boot
it requires GRUB to be able to unlock the LUKS2 volume, and look
inside the LVM partitions to find initrd, and kernel. The former part
is already there, this patch enables the latter part, so folks like me
who use LVM on top of LUKS be able to boot, otherwise it requires
going to grub command-line, and running "insmod lvm" prior to
selecting a boot option.

Thanks,
Ashish

 gnu/bootloader/grub.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 2723eda5f4..a4ca0bc217 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -445,7 +445,7 @@ (define* (make-grub-configuration grub config entries
           ;; Other type of devices aren't implemented.
           #~()))
     (let ((devices (map crypto-device->cryptomount store-crypto-devices))
-          (modules #~(format port "insmod luks~%insmod luks2~%")))
+          (modules #~(format port "insmod luks~%insmod luks2~%insmod lvm~%")))
       (if (null? devices)
           devices
           (cons modules devices))))

base-commit: 580d77d0fb12448ef1621699cc0c56e787e2aadb
-- 
2.45.2