]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
resume: make use of systemd-hibernate-resume, if existant
authorHarald Hoyer <harald@redhat.com>
Wed, 17 Dec 2014 11:08:37 +0000 (12:08 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 17 Dec 2014 11:08:37 +0000 (12:08 +0100)
In systemd mode, and if systemd-hibernate-resume exists, use it
exclusively.

modules.d/95resume/module-setup.sh

index dfd435070254f92dd512d3abc0cb220a2d31c9f2..7fe6df3a3ee20acd361c44f8bcbb72cbed595902 100755 (executable)
@@ -33,6 +33,15 @@ install() {
        [[ $_resumeconf ]] && printf "%s\n" "$_resumeconf" >> "${initdir}/etc/cmdline.d/95resume.conf"
     fi
 
+    # if systemd is included and has the hibernate-resume tool, use it and nothing else
+    if dracut_module_included "systemd" && [[ -x $systemdutildir/systemd-hibernate-resume ]]; then
+        inst_multiple -o \
+                      $systemdutildir/system-generators/systemd-hibernate-resume-generator \
+                      $systemdsystemunitdir/systemd-hibernate-resume@.service \
+                      $systemdutildir/systemd-hibernate-resume
+        return 0
+    fi
+
     # Optional uswsusp support
     for _bin in /usr/sbin/resume /usr/lib/suspend/resume /usr/lib/uswsusp/resume
     do