mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
nixos/swap: make sure all kernel modules are loaded before creating swap devices. (#239163)
Co-authored-by: iliana etaoin <iliana@buttslol.net>
This commit is contained in:
parent
6e7938422d
commit
1bee79f9f7
1 changed files with 5 additions and 0 deletions
|
@ -252,6 +252,11 @@ in
|
|||
let realDevice' = escapeSystemdPath sw.realDevice;
|
||||
in nameValuePair "mkswap-${sw.deviceName}"
|
||||
{ description = "Initialisation of swap device ${sw.device}";
|
||||
# The mkswap service fails for file-backed swap devices if the
|
||||
# loop module has not been loaded before the service runs.
|
||||
# We add an ordering constraint to run after systemd-modules-load to
|
||||
# avoid this race condition.
|
||||
after = [ "systemd-modules-load.service" ];
|
||||
wantedBy = [ "${realDevice'}.swap" ];
|
||||
before = [ "${realDevice'}.swap" ];
|
||||
path = [ pkgs.util-linux pkgs.e2fsprogs ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue