[systemd-devel] About systemd in initrd support

Luca Bruno lethalman88 at gmail.com
Mon Aug 25 12:04:42 PDT 2014

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
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.

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?


Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140825/888be2b2/attachment.html>

More information about the systemd-devel mailing list