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.
This commit is contained in:
hyperfekt 2021-05-25 23:52:46 +02:00
parent 2c3cbef68d
commit 92cbe52e19

View File

@ -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" ];
};