From 92cbe52e19c42ba606b040bee5933dd35b0e8267 Mon Sep 17 00:00:00 2001 From: hyperfekt Date: Tue, 25 May 2021 23:52:46 +0200 Subject: [PATCH] nixos/filesystems: condition mount-pstore.service on pstore module systemd's modprobe@.service does not require success so mount-pstore executed despite a non-present pstore module, leading to an error about the /sys/fs/pstore mountpoint not existing on CONFIG_PSTORE=n systems. --- nixos/modules/tasks/filesystems.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix index 065d6cc95d18..330facdca637 100644 --- a/nixos/modules/tasks/filesystems.nix +++ b/nixos/modules/tasks/filesystems.nix @@ -309,6 +309,8 @@ in "mount-pstore" = { serviceConfig = { Type = "oneshot"; + # skip on kernels without the pstore module + ExecCondition = "${pkgs.kmod}/bin/modprobe -b pstore"; ExecStart = "${pkgs.util-linux}/bin/mount -t pstore -o nosuid,noexec,nodev pstore /sys/fs/pstore"; ExecStartPost = pkgs.writeShellScript "wait-for-pstore.sh" '' set -eu @@ -325,8 +327,6 @@ in ConditionVirtualization = "!container"; DefaultDependencies = false; # needed to prevent a cycle }; - after = [ "modprobe@pstore.service" ]; - requires = [ "modprobe@pstore.service" ]; before = [ "systemd-pstore.service" ]; wantedBy = [ "systemd-pstore.service" ]; };