From 0c79bac82b193ce80f38f84aea4bfbac85ca6542 Mon Sep 17 00:00:00 2001 From: Renato Aguiar Date: Mon, 8 Feb 2016 19:27:09 -0800 Subject: [PATCH] pm-utils: Add in kernel suspend to both --- ...-1.4.1-add-in-kernel-suspend-to-both.patch | 32 +++++++++++++++++++ srcpkgs/pm-utils/template | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/pm-utils/patches/pm-utils-1.4.1-add-in-kernel-suspend-to-both.patch diff --git a/srcpkgs/pm-utils/patches/pm-utils-1.4.1-add-in-kernel-suspend-to-both.patch b/srcpkgs/pm-utils/patches/pm-utils-1.4.1-add-in-kernel-suspend-to-both.patch new file mode 100644 index 0000000000..745bbf8304 --- /dev/null +++ b/srcpkgs/pm-utils/patches/pm-utils-1.4.1-add-in-kernel-suspend-to-both.patch @@ -0,0 +1,32 @@ +diff --git a/pm/pm-functions.in b/pm/pm-functions.in +--- pm/pm-functions.in ++++ pm/pm-functions.in +@@ -316,8 +316,28 @@ if [ -z "$HIBERNATE_MODULE" ] && \ + { + [ -n "${HIBERNATE_MODE}" ] && \ + grep -qw "${HIBERNATE_MODE}" /sys/power/disk && \ ++ HIBERNATE_MODE_SAVE=$(cat /sys/power/disk) && \ ++ HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE##*[}" && \ ++ HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE%%]*}" && \ + echo -n "${HIBERNATE_MODE}" > /sys/power/disk + echo -n "disk" > /sys/power/state ++ RET=$? ++ echo -n "$HIBERNATE_MODE_SAVE" > /sys/power/disk ++ return "$RET" ++ } ++fi ++ ++# for kernels that support suspend to both (i.e. hybrid suspend) ++# since kernel 3.6 ++if [ -z "$SUSPEND_HYBRID_MODULE" ] && \ ++ [ -f /sys/power/disk ] && \ ++ grep -q disk /sys/power/state && \ ++ grep -q suspend /sys/power/disk; then ++ SUSPEND_HYBRID_MODULE="kernel" ++ do_suspend_hybrid() ++ { ++ HIBERNATE_MODE="suspend" ++ do_hibernate + } + fi + diff --git a/srcpkgs/pm-utils/template b/srcpkgs/pm-utils/template index 978baa639f..09d47f2b30 100644 --- a/srcpkgs/pm-utils/template +++ b/srcpkgs/pm-utils/template @@ -1,7 +1,7 @@ # Template file for 'pm-utils' pkgname=pm-utils version=1.4.1 -revision=7 +revision=8 build_style=gnu-configure configure_args="--sbindir=/usr/bin" make_dirs="