diff options
Diffstat (limited to 'source/ap/pm-utils')
-rw-r--r-- | source/ap/pm-utils/49bluetooth-generic | 8 | ||||
-rw-r--r-- | source/ap/pm-utils/README.SLACKWARE | 33 | ||||
-rw-r--r-- | source/ap/pm-utils/patches/add-in-kernel-suspend-to-both.patch | 32 | ||||
-rw-r--r-- | source/ap/pm-utils/patches/fix-wrong-path-in-intel-audio-powersave.patch (renamed from source/ap/pm-utils/fix-wrong-path-in-intel-audio-powersave.patch) | 0 | ||||
-rw-r--r-- | source/ap/pm-utils/patches/hook-exit-code-log.patch | 19 | ||||
-rw-r--r-- | source/ap/pm-utils/patches/init-logfile-append.patch | 13 | ||||
-rw-r--r-- | source/ap/pm-utils/patches/log-line-spacing-fix.patch | 14 | ||||
-rw-r--r-- | source/ap/pm-utils/patches/use_more_sane_harddrive_defaults.patch (renamed from source/ap/pm-utils/use_more_sane_harddrive_defaults.patch) | 0 | ||||
-rwxr-xr-x | source/ap/pm-utils/pm-utils.SlackBuild | 53 |
9 files changed, 129 insertions, 43 deletions
diff --git a/source/ap/pm-utils/49bluetooth-generic b/source/ap/pm-utils/49bluetooth-generic index e62790e7..1c88f198 100644 --- a/source/ap/pm-utils/49bluetooth-generic +++ b/source/ap/pm-utils/49bluetooth-generic @@ -4,10 +4,14 @@ case "$1" in hibernate|suspend) - rfkill block bluetooth + if [ -d /sys/devices/virtual/misc/rfkill -a -x /usr/sbin/rfkill -a -x /etc/rc.d/rc.bluetooth ]; then + rfkill block bluetooth + fi ;; thaw|resume) - rfkill unblock bluetooth + if [ -d /sys/devices/virtual/misc/rfkill -a -x /usr/sbin/rfkill -a -x /etc/rc.d/rc.bluetooth ]; then + rfkill unblock bluetooth + fi ;; *) ;; diff --git a/source/ap/pm-utils/README.SLACKWARE b/source/ap/pm-utils/README.SLACKWARE index 7f91f228..1bbfbfe8 100644 --- a/source/ap/pm-utils/README.SLACKWARE +++ b/source/ap/pm-utils/README.SLACKWARE @@ -1,5 +1,5 @@ README.SLACKWARE -20101229 - rworkman@slackware.com +20130512 - rworkman@slackware.com =============================================================================== PLEASE READ THIS ENTIRE FILE BEFORE REPORTING PROBLEMS OR ASKING FOR HELP! @@ -29,7 +29,7 @@ it works at all. Here's the short version of using suspend to disk: Stanza in /etc/lilo.conf should look something like this: - image = /boot/vmlinuz-generic-smp-2.6.35.10-smp + image = /boot/vmlinuz-generic-smp-3.8.13-smp initrd = /boot/initrd.gz append = "resume=/dev/sda2" root = /dev/sda1 @@ -43,7 +43,7 @@ Stanza in /etc/lilo.conf should look something like this: RESUMEDEV="/dev/sda2" mkinitrd command invocation would be this: - mkinitrd -c -k 2.6.35.10-smp -F + mkinitrd -c -k 3.8.13-smp -F All of the above assumes at least a cursory understanding of what those commands and parameters do. If it's not clear, don't attempt it on a @@ -60,7 +60,11 @@ kde and xfce have one). /* TODO: these links are now dead. That's mostly okay, because the vast majority of the hardware out there these days doesn't require any quirks - at all any more. Hopefully you won't be in the minority :-) */ + at all any more. Hopefully you won't be in the minority :-) + Addendum: it's now been about three years since the above text was + written, and I've had zero reports of hardware requiring additional + quirks. Just FYI. :-) +*/ If it doesn't work by default for you, consider having a look at http://people.freedesktop.org/~hughsient/quirk/quirk-suspend-index.html @@ -97,11 +101,10 @@ also available; none of these will cause the suspend to fail: The default powersave hooks are in /usr/lib(64)/pm-utils/power.d/ -- if you need to override any parameters set in those, you can do so with same-named -files in /etc/pm/power.d/ (populated with only the parameters you wish to -change). As an example, if you wanted to change the hdparm setting for -your hard drive's power management setting: rather than copying the entire -contents of /usr/lib(64)/pm-utils/power.d/harddrive to /etc/pm/power.d/ and -editing the copy, you could place only these two lines: +files in /etc/pm/power.d/ As an example, if you wanted to change the hdparm +setting for your hard drive's power management setting, you would copy the +entire file at /usr/lib(64)/pm-utils/power.d/harddrive to /etc/pm/power.d/ +and edit the copy to reflect your needs, e.g.: DRIVE_POWER_MGMT_BAT=128 # edit value as desired DRIVE_POWER_MGMT_AC=128 # edit value as desired @@ -111,20 +114,8 @@ chmod +x) in order to be used by pm-utils; otherwise, they will be ignored. ============================================================================== -One way to contribute to pm-utils indirectly is by writing and sending any -needed hooks scripts to upstream projects; as an example, the hook that -ships with wicd was contributed by me. Ideally, the pm-utils package should -have a very minimum number of hooks shipped with it, as they should ship with -the package to which the hook pertains; for example, the grub package would -ship its own hook. - -============================================================================== - KNOWN ISSUES -/* TODO: remove? I've gotten *zero* mails about either of these since - we've been shipping pm-utils */ - **** If you encounter either of these, mail rworkman@slackware.com **** If your alsa drivers don't correctly save and restore state across a sleep / diff --git a/source/ap/pm-utils/patches/add-in-kernel-suspend-to-both.patch b/source/ap/pm-utils/patches/add-in-kernel-suspend-to-both.patch new file mode 100644 index 00000000..e09d0766 --- /dev/null +++ b/source/ap/pm-utils/patches/add-in-kernel-suspend-to-both.patch @@ -0,0 +1,32 @@ +diff --git a/pm/pm-functions.in b/pm/pm-functions.in +--- a/pm/pm-functions.in ++++ b/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/source/ap/pm-utils/fix-wrong-path-in-intel-audio-powersave.patch b/source/ap/pm-utils/patches/fix-wrong-path-in-intel-audio-powersave.patch index 90039710..90039710 100644 --- a/source/ap/pm-utils/fix-wrong-path-in-intel-audio-powersave.patch +++ b/source/ap/pm-utils/patches/fix-wrong-path-in-intel-audio-powersave.patch diff --git a/source/ap/pm-utils/patches/hook-exit-code-log.patch b/source/ap/pm-utils/patches/hook-exit-code-log.patch new file mode 100644 index 00000000..7eccd83b --- /dev/null +++ b/source/ap/pm-utils/patches/hook-exit-code-log.patch @@ -0,0 +1,19 @@ +diff -up pm-utils-1.4.1/pm/pm-functions.in.orig pm-utils-1.4.1/pm/pm-functions.in +--- pm-utils-1.4.1/pm/pm-functions.in.orig 2011-08-22 14:52:58.976213050 +0200 ++++ pm-utils-1.4.1/pm/pm-functions.in 2011-08-22 14:57:26.000000000 +0200 +@@ -195,11 +195,13 @@ hook_ok() + _run_hook() { + # $1 = hook to run + # rest of args passed to hook unchanged. ++ local hook_status + log "Running hook $*:" + hook_ok "$1" && "$@" ++ hook_status=$? + log "" +- log -n "$*: " +- hook_exit_status $? && LAST_HOOK="${1##*/}" || inhibit ++ log -n "$*: " ++ hook_exit_status $hook_status && LAST_HOOK="${1##*/}" || inhibit + } + + if profiling; then diff --git a/source/ap/pm-utils/patches/init-logfile-append.patch b/source/ap/pm-utils/patches/init-logfile-append.patch new file mode 100644 index 00000000..07978263 --- /dev/null +++ b/source/ap/pm-utils/patches/init-logfile-append.patch @@ -0,0 +1,13 @@ +--- pm-utils-1.4.1/pm/pm-functions.in.old 2010-07-04 16:50:13.000000000 +0200 ++++ pm-utils-1.4.1/pm/pm-functions.in 2010-12-07 16:48:39.555074652 +0100 +@@ -271,7 +271,9 @@ + return 1 + fi + export LOGGING=true +- exec > "$1" 2>&1 ++ rm -f "$1" ++ touch "$1" ++ exec >> "$1" 2>&1 + } + + check_suspend() { [ -n "$SUSPEND_MODULE" ]; } diff --git a/source/ap/pm-utils/patches/log-line-spacing-fix.patch b/source/ap/pm-utils/patches/log-line-spacing-fix.patch new file mode 100644 index 00000000..cf4fbe38 --- /dev/null +++ b/source/ap/pm-utils/patches/log-line-spacing-fix.patch @@ -0,0 +1,14 @@ +diff -up pm-utils-1.4.1/pm/pm-functions.in.orig pm-utils-1.4.1/pm/pm-functions.in +--- pm-utils-1.4.1/pm/pm-functions.in.orig 2011-11-02 11:43:24.000000000 +0100 ++++ pm-utils-1.4.1/pm/pm-functions.in 2011-11-02 11:43:49.987116603 +0100 +@@ -199,9 +199,9 @@ _run_hook() { + log "Running hook $*:" + hook_ok "$1" && "$@" + hook_status=$? +- log "" + log -n "$*: " + hook_exit_status $hook_status && LAST_HOOK="${1##*/}" || inhibit ++ log "" + } + + if profiling; then diff --git a/source/ap/pm-utils/use_more_sane_harddrive_defaults.patch b/source/ap/pm-utils/patches/use_more_sane_harddrive_defaults.patch index 3dcc8156..3dcc8156 100644 --- a/source/ap/pm-utils/use_more_sane_harddrive_defaults.patch +++ b/source/ap/pm-utils/patches/use_more_sane_harddrive_defaults.patch diff --git a/source/ap/pm-utils/pm-utils.SlackBuild b/source/ap/pm-utils/pm-utils.SlackBuild index 1ae12666..b8c82a8c 100755 --- a/source/ap/pm-utils/pm-utils.SlackBuild +++ b/source/ap/pm-utils/pm-utils.SlackBuild @@ -3,7 +3,7 @@ # Slackware build script for pm-utils # Copyright 2008, 2009, 2010 Robby Workman, Northport, Alabama, USA -# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2008, 2009, 2010, 2013 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -25,7 +25,7 @@ PKGNAM=pm-utils VERSION=$(echo ${PKGNAM}-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev) -BUILD=${BUILD:-2} +BUILD=${BUILD:-5} QUIRKS=20100619 # Version of the quirks database @@ -72,8 +72,18 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -zcat $CWD/use_more_sane_harddrive_defaults.patch.gz | patch -p1 || exit 1 -zcat $CWD/fix-wrong-path-in-intel-audio-powersave.patch.gz | patch -p1 || exit 1 +zcat $CWD/patches/use_more_sane_harddrive_defaults.patch.gz | patch -p1 || exit 1 +zcat $CWD/patches/fix-wrong-path-in-intel-audio-powersave.patch.gz | patch -p1 || exit 1 + +# Thanks to Fedora for these: +# Use append instead of write for init_logfile +zcat $CWD/patches/init-logfile-append.patch.gz | patch -p1 || exit 1 +# Fix hooks exit code logging +zcat $CWD/patches/hook-exit-code-log.patch.gz | patch -p1 || exit 1 +# Fix line spacing in logs to be easier to read +zcat $CWD/patches/log-line-spacing-fix.patch.gz | patch -p1 || exit 1 +# Add support for in-kernel (from kernel 3.6) suspend to both +zcat $CWD/patches/add-in-kernel-suspend-to-both.patch.gz | patch -p1 || exit 1 CFLAGS="$SLKCFLAGS" \ ./configure \ @@ -101,26 +111,29 @@ chown -R root:root $PKG/$PM_UTILS_LIBDIR/video-quirks chmod 0755 49bluetooth-generic ) -# Remove the NetworkManager hook since we don't ship it; -# it should be included with NetworkManager -rm -f $PKG/usr/lib64/pm-utils/sleep.d/55NetworkManager +# Remove the NetworkManager hook - recent NM listens to upower events +# directly to know when the system is suspending/waking +rm -f $PKG/usr/lib${LIBDIRSUFFIX}/pm-utils/sleep.d/55NetworkManager + +# Remove hooks which have shown to not reduce, or even increase power +# usage (thanks to Debian for this, and to Marin Glibic for the referral) +rm -f $PKG/usr/lib${LIBDIRSUFFIX}/pm-utils/power.d/journal-commit +rm -f $PKG/usr/lib${LIBDIRSUFFIX}/pm-utils/power.d/readahead + +# HAL is gone, so this should be too: +rm -f $PKG/usr/lib${LIBDIRSUFFIX}/pm-utils/power.d/hal-cd-polling + +# Actually, it is a bad thing(tm) for pm-utils to go messing around with all +# of the user's settings with the hooks in the power.d directory. Anything +# that wasn't already taken out back behind the shed should be disabled by +# default: +chmod 644 $PKG/usr/lib${LIBDIRSUFFIX}/pm-utils/power.d/* find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null -if [ -d $PKG/usr/man ]; then - ( cd $PKG/usr/man - for manpagedir in $(find . -type d -name "man*") ; do - ( cd $manpagedir - for eachpage in $( find . -type l -maxdepth 1) ; do - ln -s $( readlink $eachpage ).gz $eachpage.gz - rm $eachpage - done - gzip -9 *.* - ) - done - ) -fi +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION cp -a \ |