[systemd-devel] [PATCHv4 3/3] resume-generator: add a generator for instantiating the resume unit.

Dave Reisner d at falconindy.com
Tue Aug 26 06:18:30 PDT 2014


On Tue, Aug 26, 2014 at 04:11:05PM +0400, Ivan Shapovalov wrote:
> resume-generator understands resume= kernel command line parameter and
> instantiates the systemd-resume at .service accordingly if it is passed.
> 
> This enables resume from hibernation using device specified on the kernel
> command line, where the device path may point to an arbitrary udev-created
> symlink, not only "/dev/sdXY" which is understood by the in-kernel
> implementation.
> ---

...

> diff --git a/src/resume-generator/resume-generator.c b/src/resume-generator/resume-generator.c
> new file mode 100644
> index 0000000..38179ff
> --- /dev/null
> +++ b/src/resume-generator/resume-generator.c
> @@ -0,0 +1,95 @@

...

> +
> +static int parse_proc_cmdline_item(const char *key, const char *value) {
> +        if (streq(key, "resume") && value) {
> +                free(arg_resume_dev);
> +                arg_resume_dev = strdup(value);

Shouldn't this be fstab_node_to_udev_node() so that we can support
things like resume=LABEL=myawesomedevice ?

d


More information about the systemd-devel mailing list