From 616ae36e0f557cecb4abe58c5b0973b9428d25e0 Mon Sep 17 00:00:00 2001 From: Roman Riabenko Date: Tue, 28 Jan 2025 13:50:29 -0500 Subject: [PATCH] gnu: system: Disable EFI pstore backend by default 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. This commit disables one of the backends for the persistent storage driver 'pstore' in the Linux kernel. In particular, we disable the backend which stores the data in EFI variable storage in UEFI NVRAM. More information about the pstore system: https://www.kernel.org/doc/Documentation/ABI/testing/pstore https://docs.kernel.org/admin-guide/pstore-blk.html https://blogs.oracle.com/linux/post/pstore-linux-kernel-persistent-storage-file-system This change reduces writes to UEFI to reduce the chances of it wearing out or malfunctioning for other reasons, with the goal of preventing situations where the EFI variable storage is full and cannot take new variables. This 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, but sometimes the storage will remain full permanently with no way to reclaim space. Users may still enable the backend by changing the option via the kernel command-line arguments, either in the Guix system configuration or in GRUB. The above is my summary of what was previously discussed in guix-help mailing list: . * gnu/packages/linux.scm (default-extra-linux-options): Enable the kernel build-time configuration option CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE. Change-Id: Id0294fa90ccbf3bacbb55a22aeb4f0a863efe22c Co-authored-by: Leo Famulari --- gnu/packages/linux.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 308583f54d43da16e7ddd3ca54f082772b900210..4d5988ab970d918829424644232d807b247ae45d 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -920,7 +920,11 @@ ARCH and optionally VARIANT, or #f if there is no such configuration." ("CONFIG_VIRTIO_MMIO" . m) ("CONFIG_FUSE_FS" . 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) (string-join (map (match-lambda