New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modules/boot: Specify the type for tmpfs mounts #108860
Conversation
NixOS#107497 broke booting on many systems that use tmpOnTmpfs due to the lack of specifying the mount type. This commit explicitly adds the mount type, which should fix booting such systems. The original change may want to be revisited however too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diff LGTM.
@@ -34,6 +34,7 @@ with lib; | |||
{ | |||
what = "tmpfs"; | |||
where = "/tmp"; | |||
type = "tmpfs"; | |||
mountConfig.Options = [ "mode=1777" "strictatime" "rw" "nosuid" "nodev" "size=50%" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where we differ from upstream: we don't have an inode limit, whereas upstream does:
https://github.com/systemd/systemd/blob/4d484e14bb9864cef1d124885e625f33bf31e91c/units/tmp.mount#L25
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I saw that after I posted the PR and forgot to update 😅, although that has been there since May, so probably isn't something that is worth us forking it for IMO (As most people will never run into it)
@ofborg test boot |
Are you able to come up with a test configuration that fails currently? I've tried enable |
@andir FWIW without this change, a system rebuild succeeds because the tmpfs mount doesn't get cleaned up, but a reboot would fail. NixOS Tests can't really be used to test this afaict because they have their own implementation of tmpOnTmpfs inside nixos/modules/qemu-vm. |
Another option would be re-adding With that, you get something like
|
@ajs124 thats my preference too, but I wanted to avoid starting a revert/re request cycle if I could help it, while in the mean time systems are unbootable |
EDIT: https://logs.nix.samueldr.com/nixos/2021-01-10#1610240617-1610240313 (In summary: I don't have a preference for which PR is merged.) |
systemd doesn't merge these options, but overwrites. So even with #108881, you'd have no inode limit. |
@ajs124 , @endocrimes I'm a bit lost on if this or #108881 is the right way forward, which work, and which one is cleaner. Can you sort that out, so we can merge one fix or the other? |
FYI: |
I think we should stick with this PR. It is precise in what it does and we can update it when needed. Upstream systemd shouldn't be the authorative source for how things are done but rather a source for inspiration and guidance. |
Also using upstream units is what got us into this situation in the first place. We have the ability to merge options properly without weird empty line hacks etc.. |
Works on my machine. |
Motivation for this change
#107497 broke booting on many systems that
use tmpOnTmpfs due to the lack of specifying the mount type.
This commit explicitly adds the mount type, which should fix booting
such systems.
The original change may want to be revisited however too, because we don't differ from the upstream unit (for 247 at least) https://github.com/systemd/systemd/blob/v247/units/tmp.mount
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)