]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
systemd: Add mkinitcpio support to plymouth-switch-root-initramfs.service
authorMaxim Mikityanskiy <maxtram95@gmail.com>
Sat, 1 Oct 2022 11:52:19 +0000 (14:52 +0300)
committerRay Strode <halfline@gmail.com>
Sat, 15 Oct 2022 14:44:03 +0000 (14:44 +0000)
plymouth-switch-root-initramfs.service commands plymouth to release
rootfs to allow the shutdown ramfs to unmount rootfs. However, it only
integrates with dracut. Arch Linux uses mkinitcpio by default, and it
uses shutdown ramfs when layered block storage (e.g. LUKS) is used for
rootfs. Therefore, it fails to unmount rootfs on shutdown if LUKS and
plymouth are used together.

Add a new trigger for plymouth-switch-root-initramfs.service to start
when /run/initramfs/shutdown exists (/run/initramfs/bin/sh may not exist
with mkinitcpio when systemd-based initramfs is used), and add a
dependency to start it after mkinitcpio generates the shutdown ramfs.

systemd-units/plymouth-switch-root-initramfs.service.in

index 0610803cbca968e89ef6ca7f49970f83da633238..e7b5a5eaf82945460f2fe150d489a0c75386cfde 100644 (file)
@@ -4,8 +4,9 @@ DefaultDependencies=no
 # dracut-shutdown.service restores the initramfs when it is _stopped_
 # use Conflicts to make sure its ExecStop has run before we do
 Conflicts=dracut-shutdown.service
-After=plymouth-halt.service plymouth-reboot.service plymouth-poweroff.service plymouth-kexec.service dracut-shutdown.service
-ConditionPathExists=/run/initramfs/bin/sh
+After=plymouth-halt.service plymouth-reboot.service plymouth-poweroff.service plymouth-kexec.service dracut-shutdown.service mkinitcpio-generate-shutdown-ramfs.service
+ConditionPathExists=|/run/initramfs/bin/sh
+ConditionPathExists=|/run/initramfs/shutdown
 
 [Service]
 Type=oneshot