Thank you all for the replies. After the first answers I've ported the initrd to systemd (only the basic stuff, no luks, lvm, etc.) and works very fine. Except one thing, that I hoped to find in dracut but does not seem to do anything special about it. It just goes through switch-root it seems.
As I understood it, systemctl switch-root will either run the specified init, or exec to the systemd in the new root. Looking a little through the code, it seems to do some kind of state-passing that I still have to study (--switched-root --deserialize etc.). Problem: in NixOS we need to run a further stage in the new root, before starting systemd. For example /etc is a symlink to a configuration tree which gets created at boot (we call it activation), and so on. Our init script activates the NixOS system and ultimately exec to systemd. initrd init -> setup some env vars and mount points -> systemd/initrd -> switch-root -> system activation script -> systemd. Questions: 1) What are the advantages to let switch-root exec to systemd directly? Does executing it from our init is the same thing? 2) In case it's not the same thing, where is the best place to run that script? As a service in the new-root systemd? Thanks. Best regards,
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel