Closed jakobrs closed 3 years ago
This is also a problem when using overlayfs
since the dependencies are specified in options
not device
or mountPoint
and for this problem #86967 is not enough to fix the issue. The fileSystem.<name>.depends
option sugested by @jakobrs in https://github.com/NixOS/nixpkgs/pull/86967#issuecomment-624207721 would solve it.
Actually the only reason the current ISO and netboot images aren't broken because of this (they use overlayfs
) is solely because /nix/.ro-store
and /nix/.rw-store
comes alphabetically before /nix/store
.
I marked this as stale due to inactivity. → More info
This is still an issue, and for me a fairly big one, since I can't generate secrets with agenix with my current setup: https://github.com/ryantm/agenix/issues/45#issuecomment-847852593 https://github.com/nix-community/impermanence/issues/22#issuecomment-847879359
Describe the bug
stage-1.nix
generates a list of file systems that are needed for boot. This list is not topologically sorted, which leads to situations where the system won't boot because the file systems aren't mounted in the right order.Edit: After looking at it for a while, it seems the real problem is that this function is too strict:
I think it should be something like this instead:
To Reproduce
Because
/nix
comes before/persist
alphabetically, it's mounted first (which fails). You can read theinitrd-fsinfo
file using:nixos-rebuild build
nix-store -qR ./result | grep initrd-linux
archivemount <result of last command>/initrd mnt
cat mnt/nix/store/*initrd-fsinfo*
Expected behavior The list of file systems to be topologically sorted.
Additional context Originally found this while trying to try out root-on-tmpfs.
Notify maintainers Couldn't find anyone.
Metadata
"x86_64-linux"
Linux 5.6.7, NixOS, 20.03.1619.ab3adfe1c76 (Markhor)
yes
yes
nix-env (Nix) 2.3.4
"nixos-20.03.1619.ab3adfe1c76, nixos-19.09-19.09.2477.a7ceb2536ab, nixos-unstable-20.09pre223023.fce7562cf46, nixos-unstable-small-20.09pre223385.3b00e78e63b"
"nixpkgs-20.09pre221814.10100a97c89"
/home/jakob/.nix-defexpr/channels/nixpkgs
Maintainer information: