Open msanft opened 9 months ago
We need better handling of root=
stuff anyway, as evidenced by https://github.com/NixOS/nixpkgs/pull/282022. Systemd supports a variety of ways of specifying the root file system, and we need to reflect that as best as possible in nixos. So I think this issue is part of a broader concept we need to flesh out.
Describe the bug
The initrd builder of NixOS makes assertions on
fileSystems."/"
being specified when building an initrd (i.e. its fstab, from whichsystemd-fstab-generator
creates the mount units). When using a dm-verity system, with theroothash
option specified in the kernel command line,systemd-veritysetup-generator
will already have taken care of creating the mount unit, causing the subsequent try to create the unit bysystemd-fstab-generator
to fail. This makes it hard to build immutable, image-based appliances where one would want a dm-verity protected rootfs created through veritysetup without overrides to the module.Steps To Reproduce
Steps to reproduce the behavior:
roothash
option specified in the kernel command line.[ 0.406772] systemd-fstab-generator[69]: Failed to create unit file '/run/systemd/generator/sysroot.mount', as it already exists. Duplicate entry in '/nix/store/2y5fanvgc23zfqpq0pjcm0v8hmfv452s-initrd-fstab'? [ 0.409288] (sd-e[67]: /nix/store/vfmf8qh892jfl107hih0yfnic00byjgj-systemd-254.6/lib/systemd/system-generators/systemd-fstab-generator failed with exit status 1.
Add a :+1: reaction to issues you find important.