Skip to content

Commit

Permalink
Include initrd mounts in the final system also
Browse files Browse the repository at this point in the history
Without this, things like `RequiresMountsFor` do not work correctly
during shutdown.

See systemd/systemd#34327
  • Loading branch information
r-vdp committed Sep 9, 2024
1 parent f58a36d commit 3fae1ab
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,12 @@ rec {
let
allDirectories = getAllDirectories stateConfig;
allFiles = getAllFiles stateConfig;
mountedDirectories = onlyBindMounts forInitrd allDirectories;
mountedFiles = onlyBindMounts forInitrd allFiles;
mountedDirectories =
onlyBindMounts forInitrd allDirectories
++ lib.optionals (!forInitrd) (onlyBindMounts true allDirectories);
mountedFiles =
onlyBindMounts forInitrd allFiles
++ lib.optionals (!forInitrd) (onlyBindMounts true allFiles);

prefix = if forInitrd then "/sysroot" else "/";

Expand Down

0 comments on commit 3fae1ab

Please sign in to comment.