- I'm running ArchLinux, using the systemd binary to start necessary services as part of the initramfs (root fs decryption, mounting etc.).
- I would like to examine what systemd units are started as part of this stage, and when.
systemd-analyze plotonly shows me a time-graph of all the units after the switch-root has taken place.
The switch root unit (by definition the last unit in the initrd boot sequence) states:
[Service] # ... ExecStart=/usr/bin/systemctl --no-block --force switch-root /sysroot # ...
The systemctl man page on the switch-root system command has this to say:
switch-root ROOT [INIT]
Switches to a different root directory and executes a new system manager process below it. This is intended for usage in initial RAM disks ("initrd"), and will transition from the initrd's system manager process (a.k.a. "init" process) to the main system manager process which is loaded from the actual host volume. This call takes twoarguments: the directory that is to become the new root directory, and the path to the new system manager binary below it to execute as PID 1. If the latter is omitted or the empty string, a systemd binary will automatically be searched for and used as init. If the system manager path is omitted, equal to the empty string or identical to the path to the systemd binary, the state of the initrd's system manager process is passed to the main system manager, which allows later introspection of the state of the services involved in the initrd boot phase.
and then is quiet on the matter of initrds...
After boot, how can I introspect the state of the services involved in the initrd boot phase as inferred above, or discover what units were even run (as some are dynamically generated)?