nixos/stage-1-systemd: fix initrd-fstab generation for bind mounts, again

See https://github.com/NixOS/nixpkgs/pull/185089
This commit is contained in:
Nick Cao 2023-09-27 14:33:21 -04:00
parent 8a86b98f0b
commit 0fecd7edc8
No known key found for this signature in database

View file

@ -188,8 +188,7 @@ let
# https://wiki.archlinux.org/index.php/fstab#Filepath_spaces
escape = string: builtins.replaceStrings [ " " "\t" ] [ "\\040" "\\011" ] string;
in fstabFileSystems: { rootPrefix ? "" }: concatMapStrings (fs:
(optionalString (isBindMount fs) (escape rootPrefix))
+ (if fs.device != null then escape fs.device
(if fs.device != null then escape fs.device
else if fs.label != null then "/dev/disk/by-label/${escape fs.label}"
else throw "No device specified for mount point ${fs.mountPoint}.")
+ " " + escape fs.mountPoint