From: Maxim Mikityanskiy Date: Sat, 1 Oct 2022 11:52:19 +0000 (+0300) Subject: systemd: Add mkinitcpio support to plymouth-switch-root-initramfs.service X-Git-Tag: 23.51.283~75^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f12aa4c5d27d1ee5a46f412559073f016d236ae;p=thirdparty%2Fplymouth.git systemd: Add mkinitcpio support to plymouth-switch-root-initramfs.service 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. --- diff --git a/systemd-units/plymouth-switch-root-initramfs.service.in b/systemd-units/plymouth-switch-root-initramfs.service.in index 0610803c..e7b5a5ea 100644 --- a/systemd-units/plymouth-switch-root-initramfs.service.in +++ b/systemd-units/plymouth-switch-root-initramfs.service.in @@ -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