[systemd-devel] systemd hibernator generator does not function on default Fedora install

Lennart Poettering lennart at poettering.net
Thu Apr 21 16:48:36 UTC 2016


On Thu, 21.04.16 16:06, Michael Biebl (mbiebl at gmail.com) wrote:

> Hi Lennart
> 
> 2016-04-21 12:11 GMT+02:00 Lennart Poettering <lennart at poettering.net>:
> > On Thu, 21.04.16 02:50, Michael Biebl (mbiebl at gmail.com) wrote:
> >
> >> 2016-04-21 0:56 GMT+02:00 Michael Biebl <mbiebl at gmail.com>:
> >> On second thought, maybe not such a good idea as this would break
> >> hibernate on alternate initramfs generators, like initramfs-tools,
> >> which don't require resume= to be set on the kernel command line.
> >
> > So, what does initramfs-tools do instead? Does it actively search for
> > a hibernation partition? And how long does it look for one? Or does it
> > write the resume partition into the initrd image?
> 
> Our installer creates a file
> /etc/initramfs-tools/conf.d/resume which contains the name of the swap
> partition that was created during system installation.
> This file is embedded in the initramfs and used to resume the system
> from hibernate.
> http://anonscm.debian.org/cgit/kernel/initramfs-tools.git/tree/hooks/resume#n19

Does Debian also embedd the root disk name in the initrd? Or does it
do so only for the resume partition?

> Such a file looks like
> $ cat /etc/initramfs-tools/conf.d/resume
> RESUME=UUID=c0d2bc19-898f-4306-a734-85e547e249f0
> 
> But it also does some autodetection, if RESUME is not set.
> http://anonscm.debian.org/cgit/kernel/initramfs-tools.git/tree/hooks/resume#n42

But that's not boot-time autodetection but initrd-rebuild-time autodetection?

In general I think for systemd we should really optimize things so
that as little system-specific info needs to be carried in the
initrd as possible. In fact I think, having exactly zero system-specific
information in it is a good goal, so that initrds can be generated
nicely at compile-time instead of on the system itself. And for that I
think two strategies are nice:

a) Require devices to be configured on the kernel cmdline, via root=
   and resume=

and

b) Autodetect devices at boot, automatically deriving them from the
   selected boot device, i.e. look for properly tagged partitions on
   the same harddisk as the ESP.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list