gnu: system: Disable EFI pstore backend by default

This commit disables one of the backends for the persistent storage driver
pstore in the Linux kernel, in particular the backend which allows it to save
data to EFI variables storage in UEFI NVRAM, such as error log "dump" files.

This reduces writes to UEFI to reduce the chances of it wearing out or
malfunctioning for other reasons, as well as prevents situations when the efivar
is full and cannot take new variables, which is known to cause "Could not
prepare Boot variable: No space left on device" errors on computers with some
UEFI implementations which are susceptible to such problems, typically on
relatively older machines. The user is confronted by the issue at the later
stages of guix system reconfiguration when the new boot entry is created. It may
be difficult to recover from because the exact cause depends on UEFI. Sometimes
it is enough to remove dumps from efivars. Disabling the EFI pstore backend is
expected to reduce the chances of unaware users running into issues with UEFI
and failing to boot their Guix Systems.

Sophisticated users may still enable the backend by changing the option via the
kernel arguments, either in the system configuration or in GRUB.

The above is my summary of what was previously discussed in guix-help mailing
list: <https://lists.gnu.org/archive/html/help-guix/2025-01/msg00173.html>.

* gnu/packages/linux.scm (default-extra-linux-options): Enable the kernel
build-time configuration option CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE.

Change-Id: Id0294fa90ccbf3bacbb55a22aeb4f0a863efe22c
Signed-off-by: Leo Famulari <leo@famulari.name>
This commit is contained in:
Leo Famulari 2025-01-28 13:50:29 -05:00
parent e727db72fc
commit b57cdccc7c
No known key found for this signature in database
GPG key ID: 6AAC1963757F47FF

View file

@ -920,7 +920,11 @@ (define (default-extra-linux-options version)
("CONFIG_VIRTIO_MMIO" . m) ("CONFIG_VIRTIO_MMIO" . m)
("CONFIG_FUSE_FS" . m) ("CONFIG_FUSE_FS" . m)
("CONFIG_CIFS" . m) ("CONFIG_CIFS" . m)
("CONFIG_9P_FS" . m))) ("CONFIG_9P_FS" . m)
;; Disable the EFI pstore storage backend to avoid causing
;; unrecoverable failures on some EFI systems:
;; https://lists.gnu.org/archive/html/help-guix/2025-01/msg00173.html
("CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE" . #t)))
(define (config->string options) (define (config->string options)
(string-join (map (match-lambda (string-join (map (match-lambda