]> git.ipfire.org Git - thirdparty/plymouth.git/commit
systemd: Add plymouth-switch-root-initramfs.service to switch back to initramfs on...
authorRay Strode <rstrode@redhat.com>
Fri, 17 Jul 2020 20:06:44 +0000 (16:06 -0400)
committerHans de Goede <hdegoede@redhat.com>
Tue, 6 Apr 2021 11:45:41 +0000 (13:45 +0200)
commit2a7755febb2daa92f785abb710aee00d48cb7e3a
tree770d8e8cccbf65e4a78c6d6ba6f260b772a46fd3
parenta0c743c76a3436b8db088398b8fee10d902bf9fd
systemd: Add plymouth-switch-root-initramfs.service to switch back to initramfs on shutdown

Add a plymouth-switch-root-initramfs.service, which will call
"plymouth update-root-fs --new-root-dir=/run/initramfs" to switch back
to the initramfs (when applicable).

Systemd will run this service before plymouthd receives the SIGTERM on
shutdown, so this will cause the plymouthd-fd-escrow helper to run
from the initramfs.

This avoids the plymouthd-fd-escrow helper keeping the rootfs busy.

Changes by Hans de Goede:
- Fix a couple of typos
- Add Conflicts=dracut-shutdown.service to plymouth-switch-root-initramfs.service
  dracut-shutdown.service restores the initramfs when it is _stopped_
  use Conflicts to make sure its ExecStop has run before we do
- Add a check for switching back to the initramfs to on_newroot () and dump
  the debug-buffer before the switch (while we still have access to /var/log).
- Also add plymouth-switch-root-initramfs.service to kexec.target.wants.
  kexec.target.wants uses --mode=shutdown, so the plymouthd-fd-escrow helper
  will run, so we need to switch to the initramfs.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
configure.ac
scripts/plymouth-populate-initrd.in
src/main.c
systemd-units/Makefile.am
systemd-units/plymouth-switch-root-initramfs.service.in [new file with mode: 0644]