[systemd-devel] Implementing resume from hibernation as a systemd unit file

Ivan Shapovalov intelfx100 at gmail.com
Mon Jul 28 03:06:07 PDT 2014


Hello all,

I'm trying to implement resuming from hibernation with systemd-based initramfs,
i. e. in terms of systemd unit files. That is, there should be a unit which
waits for the resume device and writes its major:minor into /sys/power/resume.

I've chosen to write a templated resume@<path>.service and a generator which
parses 'resume=' kernel parameter and enables a corresponding instance of the
resume at .service unit.

The resume at .service itself shall be ordered so that it is activated when there
are no filesystems mounted read-write, except tmpfs instances. It will be good
if it works both from initramfs and from real rootfs (if it is mounted RO).

So, here are some questions:
- is it the way to go (overall)?
- is it OK to use generators for outlined purpose?
- how to order resume at .service and where to symlink it?

I'm using Arch, if that matters -- but, IIUC, Arch strives to do everything
"in the upstream's way", so there should be no distro-specific details.

Thanks,
-- 
Ivan Shapovalov / intelfx /
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140728/0d9c8b8f/attachment.sig>


More information about the systemd-devel mailing list