Configure suspend-then-hibernate to use uswsusp
I'm using uswsusp for suspend to RAM and suspend to disk (hibernate) via systemd. Therefore I've adjusted /etc/systemd/system/systemd-suspend.service.d/override.conf
and /etc/systemd/system/systemd-hibernate.service.d/override.conf
.
Suspend and hibernate works find using uswsusp. My problem is that systemd still uses the kernel's swsusp for suspend-then-hibernate. This, of course, results in a failure while restoring from hibernate because of the wrong mkinitcpio hook.
I assume that it is necessary to adjust the systemd configuration for suspend-then-hibernate (/etc/systemd/system/systemd-suspend-then-hibernate.service.d/override.conf
) as well. But I've no idea what it must look like. Is it even possible or would it require uswsusp to support suspend-then-hibernate?
I'm on arch linux. This question is somehow related to this one.
/etc/systemd/system/systemd-suspend.service.d/override.conf:
[Service]
ExecStart=
ExecStartPre=-/usr/bin/run-parts -v -a pre /usr/lib/systemd/system-sleep
ExecStart=/usr/bin/s2ram
ExecStartPost=-/usr/bin/run-parts -v --reverse -a post /usr/lib/systemd/system-sleep
/etc/systemd/system/systemd-hibernate.service.d/override.conf:
[Service]
ExecStart=
ExecStartPre=-/usr/bin/run-parts -v -a pre /usr/lib/systemd/system-sleep
ExecStart=/usr/bin/s2disk
ExecStartPost=-/usr/bin/run-parts -v --reverse -a post /usr/lib/systemd/system-sleep