Conversation
c1ff0c2 to
c94f334
Compare
There's currently no link to the upstream PR, making it very hard to check if upstream has been poked in the meantime or not. We normally try to not increase our patch count, so please ask upstream first. |
|
@flokli Ah, sorry. I've updated the OP with a link to the PR, and I've asked there if it could be backported to systemd-stable |
|
(Note that although that PR was a followup to systemd/systemd#25710, it is not required, because NixOS currently doesn't use the cmdline for root and usrt. But |
c94f334 to
14b7758
Compare
|
Now that v252.5 is in staging, the new patch file that was needed has been backported and is no longer needed. |
lilyinstarlight
left a comment
There was a problem hiding this comment.
The diff looks reasonable to me, and the new fsck test passes on my system
I've been running this on my machine (only patching systemdStage1 to avoid too many rebuilds) for a few days now and have not noticed issues, but I admittedly don't have any filesystems marked neededForBoot that need fsck
Other systemd-stage-1 tests I ran all still succeeded as well
Thank you for this work!
| boot.initrd.systemd.storePaths = [initrdFstab]; | ||
| boot.initrd.systemd.managerEnvironment.SYSTEMD_SYSROOT_FSTAB = initrdFstab; | ||
| boot.initrd.systemd.services.initrd-parse-etc.environment.SYSTEMD_SYSROOT_FSTAB = initrdFstab; |
There was a problem hiding this comment.
@ElvishJerricco Could you share the reason for removing /etc/fstab from the initrd filesystem? I found that this broke one of my custom initrd units, which had a mount <mountpoint> line. I have a workaround, but I'm curious to understand the reason for this change so that I can choose the best workaround in my config.
There was a problem hiding this comment.
@Majiir /etc/fstab was never the right choice; the systemd tooling wants you to use root= and mount.usr= on the cmdline. The service initrd-parse-etc.service reads /sysroot/etc/fstab, and so does the systemd-fstab-generator, which is what we're overriding with this environment variable.
Description of changes
Until now, systemd-stage-1 has not supported fsck, which is a major problem.
Incidentally, this will also technically help with hibernation. Currently, the unit ordering isn't quite right, so you'll find
/sysrootmounting at the same time thatsystemd-hibernate-resumeis starting, which is very dangerous. The problem is that mount units in stage 1 don't get theAfter=local-fs-pre.targetdependency, which is the sync point thatsystemd-hibernate-resumeorders itself before. Butsystemd-fsckis ordered afterlocal-fs-pre.target, so it works if fsck is working. Realistically, I think the lack of this ordering on the mount units should be considered a bug in systemd, and the patch to fix that bug is like one line, but I haven't opened an issue/PR about that yet.Targeting staging because the systemd patch that changes how systemd finds fsck had to be modified.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes