Blame 0075-resume-make-use-of-systemd-hibernate-resume-if-exist.patch

Harald Hoyer b94732
From 733c71ce9e2d161c9e04772aeb1c5fb38e3fcb3a Mon Sep 17 00:00:00 2001
Harald Hoyer b94732
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer b94732
Date: Wed, 17 Dec 2014 12:08:37 +0100
Harald Hoyer b94732
Subject: [PATCH] resume: make use of systemd-hibernate-resume, if existant
Harald Hoyer b94732
Harald Hoyer b94732
In systemd mode, and if systemd-hibernate-resume exists, use it
Harald Hoyer b94732
exclusively.
Harald Hoyer b94732
---
Harald Hoyer b94732
 modules.d/95resume/module-setup.sh | 9 +++++++++
Harald Hoyer b94732
 1 file changed, 9 insertions(+)
Harald Hoyer b94732
Harald Hoyer b94732
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
Harald Hoyer b94732
index dfd4350..7fe6df3 100755
Harald Hoyer b94732
--- a/modules.d/95resume/module-setup.sh
Harald Hoyer b94732
+++ b/modules.d/95resume/module-setup.sh
Harald Hoyer b94732
@@ -33,6 +33,15 @@ install() {
Harald Hoyer b94732
 	[[ $_resumeconf ]] && printf "%s\n" "$_resumeconf" >> "${initdir}/etc/cmdline.d/95resume.conf"
Harald Hoyer b94732
     fi
Harald Hoyer b94732
 
Harald Hoyer b94732
+    # if systemd is included and has the hibernate-resume tool, use it and nothing else
Harald Hoyer b94732
+    if dracut_module_included "systemd" && [[ -x $systemdutildir/systemd-hibernate-resume ]]; then
Harald Hoyer b94732
+        inst_multiple -o \
Harald Hoyer b94732
+                      $systemdutildir/system-generators/systemd-hibernate-resume-generator \
Harald Hoyer b94732
+                      $systemdsystemunitdir/systemd-hibernate-resume@.service \
Harald Hoyer b94732
+                      $systemdutildir/systemd-hibernate-resume
Harald Hoyer b94732
+        return 0
Harald Hoyer b94732
+    fi
Harald Hoyer b94732
+
Harald Hoyer b94732
     # Optional uswsusp support
Harald Hoyer b94732
     for _bin in /usr/sbin/resume /usr/lib/suspend/resume /usr/lib/uswsusp/resume
Harald Hoyer b94732
     do