nixos/filesystems: skip fsck for bind mounts
Without this change, configurations like ```nix fileSystems."/path/to/bindMountedDirectory" = { device = "/path/to/originalDirectory"; options = [ "bind" ]; }; ``` will lead to a warning message in `dmesg`: ``` systemd-fstab-generator: Checking was requested for "/path/to/originalDirectory", but it is not a device. ``` This happens because the generated /etc/fstab entry contains a non-zero fsck pass number, which doesn't make sense for a bind mount.
This commit is contained in:
parent
b3d94a9273
commit
db4fdd6247
|
@ -280,7 +280,8 @@ in
|
|||
environment.etc.fstab.text =
|
||||
let
|
||||
fsToSkipCheck = [ "none" "bindfs" "btrfs" "zfs" "tmpfs" "nfs" "vboxsf" "glusterfs" "apfs" ];
|
||||
skipCheck = fs: fs.noCheck || fs.device == "none" || builtins.elem fs.fsType fsToSkipCheck;
|
||||
isBindMount = fs: builtins.elem "bind" fs.options;
|
||||
skipCheck = fs: fs.noCheck || fs.device == "none" || builtins.elem fs.fsType fsToSkipCheck || isBindMount fs;
|
||||
# https://wiki.archlinux.org/index.php/fstab#Filepath_spaces
|
||||
escape = string: builtins.replaceStrings [ " " "\t" ] [ "\\040" "\\011" ] string;
|
||||
swapOptions = sw: concatStringsSep "," (
|
||||
|
|
Loading…
Reference in a new issue