diff options
author | Will Fancher <elvishjerricco@gmail.com> | 2023-09-27 20:15:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-27 20:15:46 -0400 |
commit | 209f6f3c21a8cf3de1b708fef5cd1e6d7988475c (patch) | |
tree | d6c978550646a578e09042b67a3db7a8850c2848 /nixos | |
parent | e515dce8924197fceb090d9ba46cbb926a5784eb (diff) | |
parent | 37cac5f032f6da598eddde8dd49eb7a820d72ea3 (diff) | |
download | nixlib-209f6f3c21a8cf3de1b708fef5cd1e6d7988475c.tar nixlib-209f6f3c21a8cf3de1b708fef5cd1e6d7988475c.tar.gz nixlib-209f6f3c21a8cf3de1b708fef5cd1e6d7988475c.tar.bz2 nixlib-209f6f3c21a8cf3de1b708fef5cd1e6d7988475c.tar.lz nixlib-209f6f3c21a8cf3de1b708fef5cd1e6d7988475c.tar.xz nixlib-209f6f3c21a8cf3de1b708fef5cd1e6d7988475c.tar.zst nixlib-209f6f3c21a8cf3de1b708fef5cd1e6d7988475c.zip |
Merge pull request #257693 from NickCao/bindmount
nixos/stage-1-systemd: fix initrd-fstab generation for bind mounts, a…
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/tasks/filesystems.nix | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix index 7cb2ca23fa41..91e30aa4c0af 100644 --- a/nixos/modules/tasks/filesystems.nix +++ b/nixos/modules/tasks/filesystems.nix @@ -187,9 +187,8 @@ let 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; - in fstabFileSystems: { rootPrefix ? "" }: concatMapStrings (fs: - (optionalString (isBindMount fs) (escape rootPrefix)) - + (if fs.device != null then escape fs.device + in fstabFileSystems: { }: concatMapStrings (fs: + (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 @@ -199,9 +198,7 @@ let + "\n" ) fstabFileSystems; - initrdFstab = pkgs.writeText "initrd-fstab" (makeFstabEntries (filter utils.fsNeededForBoot fileSystems) { - rootPrefix = "/sysroot"; - }); + initrdFstab = pkgs.writeText "initrd-fstab" (makeFstabEntries (filter utils.fsNeededForBoot fileSystems) { }); in |