[Nix-dev] systemd in initrd
Luca Bruno
lethalman88 at gmail.com
Wed Oct 29 20:49:37 CET 2014
Ok I'm stuck :)
lvm works, that's simple... luks works, but lvm on luks does not.
I've forwarded the problem in the systemd mailing list here [1].
I've pushed very hacky commits in the systemd branch [2]. To use it:
1) Enable the vdaDisk service in nixos/tests/luksLvm.nix
2) nix-build nixos/tests/luksLvm.nix -A driver
3) result/bin/nixos-run-vms
It will fail, no worries, the important thing is that we created a disk in
/tmp/vm-state-luksLVMMachine with luks+lvm.
Now disable the vdaDisk service back and rebuild the driver as in steps 1
and 2.
To get an emergency shell + systemd debug you can run the vm as follows:
QEMU_KERNEL_PARAMS="boot.shell_on_fail systemd.log_target=console
systemd.log_level=debug" result/bin/nixos-run-vms
To resume the problem: luks gets opened with systemd-cryptsetup, however
some udev rule or whatever tells systemd that /dev/mapper/vg-lv is ready,
but it's not! Because we didn't do any vgchange -a y, we only opened luks.
Therefore systemd will try to mount sysroot.mount, instead of waiting for
/dev/mapper/vg-lv to appear. In normal circumstances, systemd waits for
/dev/mapper/vg-lv to appear.
I'm trying to read udev rules, looking for other people having the same
problem (couldn't find any in particular), but I'm unable to solve this
problem.
If anybody wants to help, I'd really appreciate it :)
Best regards,
[1]
http://lists.freedesktop.org/archives/systemd-devel/2014-October/024668.html
[2] https://github.com/lethalman/nixpkgs/commits/systemd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20141029/ac46e742/attachment.html
More information about the nix-dev
mailing list