Hello community,
here is the log from the commit of package pm-utils
checked in at Thu Mar 15 01:48:36 CET 2007.
--------
--- pm-utils/pm-utils.changes 2007-02-28 18:49:15.000000000 +0100
+++ /mounts/work_src_done/STABLE/pm-utils/pm-utils.changes 2007-03-14 21:30:42.000000000 +0100
@@ -1,0 +2,14 @@
+Wed Mar 14 21:24:22 CET 2007 - seife@suse.de
+
+- update to version 0.99.2+ (CVS as of today)
+ - move the executables from /etc/pm to /usr/lib/pm-utils
+ - config file from /etc/pm/config to /usr/lib/pm-utils/defaults
+ - many of our local fixes applied upstream
+ - add pm-suspend-hybrid (currently a no-op, will do s2both)
+ - add pm-is-supported that will show HAL what suspend modes are
+ available
+ - use bash for scripts, not sh
+ - fix module load/unload problems with module names that have
+ "-" and "_".
+
+-------------------------------------------------------------------
Old:
----
pm-utils-0.20.0.20070202-suse.diff
pm-utils-0.20.0.20070202.tar.gz
pm-utils-20070202-fix-94cpufreq-bug227854.diff
pm-utils-20070202-fix-reset-swap.diff
pm-utils-comment-configfile.diff
pm-utils-do-not-unload-button.diff
pm-utils-suse-20070218.tar.gz
pm-utils-uswsusp-support.diff
New:
----
pm-utils-0.99.2.20070314-suse.diff
pm-utils-0.99.2.20070314.tar.gz
pm-utils-0.99.2-comment-configfile.diff
pm-utils-0.99.2-fix-stopservice.diff
pm-utils-0.99.2-uswsusp-support.diff
pm-utils-suse-20070314.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ pm-utils.spec ++++++
--- /var/tmp/diff_new_pack.K22473/_old 2007-03-15 01:48:25.000000000 +0100
+++ /var/tmp/diff_new_pack.K22473/_new 2007-03-15 01:48:25.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package pm-utils (Version 0.20.0.20070202)
+# spec file for package pm-utils (Version 0.99.2.20070314)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -12,19 +12,17 @@
Name: pm-utils
URL: http://webcvs.freedesktop.org/pm-utils/
-Version: 0.20.0.20070202
-Release: 3
-%define pm_utils_suse_version 20070218
+Version: 0.99.2.20070314
+Release: 1
+%define pm_utils_suse_version 20070314
Summary: Tools to suspend and hibernate computers.
License: GNU General Public License (GPL)
Group: System/Base
Source: %{name}-%{version}.tar.gz
-Patch0: pm-utils-0.20.0.20070202-suse.diff
-Patch1: pm-utils-uswsusp-support.diff
-Patch2: pm-utils-do-not-unload-button.diff
-Patch3: pm-utils-comment-configfile.diff
-Patch4: pm-utils-20070202-fix-reset-swap.diff
-Patch5: pm-utils-20070202-fix-94cpufreq-bug227854.diff
+Patch0: pm-utils-0.99.2.20070314-suse.diff
+Patch1: pm-utils-0.99.2-uswsusp-support.diff
+Patch2: pm-utils-0.99.2-fix-stopservice.diff
+Patch3: pm-utils-0.99.2-comment-configfile.diff
Source1: pm-utils-suse-%{pm_utils_suse_version}.tar.gz
Source2: README.upstream-hooks
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -50,9 +48,7 @@
%patch1 -p0
%patch2 -p0
%patch3 -p0
-%patch4 -p0
%patch0 -p0
-%patch5 -p0
%build
export CFLAGS="$RPM_OPT_FLAGS"
@@ -62,27 +58,38 @@
%install
make install DESTDIR=$RPM_BUILD_ROOT
mkdir hooks
-for i in 01grub 20video 49bluetooth 60sysfont 65alsa 90clock; do
- mv $RPM_BUILD_ROOT/etc/pm/hooks/$i hooks
+for i in 01grub 20video 49bluetooth 60sysfont 65alsa 90clock 99video; do
+ mv $RPM_BUILD_ROOT/usr/lib/pm-utils/sleep.d/$i hooks
done
cp %{S:2} hooks
cd ../pm-utils-suse
-cp -r hooks $RPM_BUILD_ROOT/etc/pm/
+cp hooks/* $RPM_BUILD_ROOT/usr/lib/pm-utils/sleep.d/
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr (-,root,root)
-%config(noreplace) /etc/pm/config
/etc/pm
/usr/sbin/*
/usr/bin/*
+/usr/lib/pm-utils
%_mandir/man1/*
%doc README COPYING ChangeLog AUTHORS
%doc hooks
%changelog
+* Wed Mar 14 2007 - seife@suse.de
+- update to version 0.99.2+ (CVS as of today)
+ - move the executables from /etc/pm to /usr/lib/pm-utils
+ - config file from /etc/pm/config to /usr/lib/pm-utils/defaults
+ - many of our local fixes applied upstream
+ - add pm-suspend-hybrid (currently a no-op, will do s2both)
+ - add pm-is-supported that will show HAL what suspend modes are
+ available
+ - use bash for scripts, not sh
+ - fix module load/unload problems with module names that have
+ "-" and "_".
* Wed Feb 28 2007 - seife@suse.de
- fix cpufreq problem on multicore CPUs after resume (bug 227854)
* Tue Feb 20 2007 - seife@suse.de
++++++ pm-utils-0.20.0.20070202-suse.diff -> pm-utils-0.99.2.20070314-suse.diff ++++++
--- pm-utils/pm-utils-0.20.0.20070202-suse.diff 2007-02-20 16:23:22.000000000 +0100
+++ /mounts/work_src_done/STABLE/pm-utils/pm-utils-0.99.2.20070314-suse.diff 2007-03-14 19:35:04.000000000 +0100
@@ -1,6 +1,15 @@
--- pm/functions
+++ pm/functions
-@@ -69,7 +69,7 @@
+@@ -15,7 +15,7 @@
+ HIBERNATE_METHOD=""
+ S2DISK_BIN=/usr/sbin/s2disk
+ S2DISK_CONF=/var/lib/s2disk.conf
+-TEMPORARY_CPUFREQ_GOVERNOR="userspace"
++TEMPORARY_CPUFREQ_GOVERNOR="performance"
+
+ [ -f /usr/lib/pm-utils/defaults ] && . /usr/lib/pm-utils/defaults
+
+@@ -71,7 +71,7 @@
remove_suspend_lock()
{
@@ -9,7 +18,7 @@
chvt 1
chvt $VT
openvt -- sh -c "usleep $1 ; rm -f /.suspended >/dev/null 2>&1 0<&1" >/dev/null 2>&1 0<&1 &
-@@ -80,7 +80,7 @@
+@@ -97,7 +97,7 @@
[ -z "$1" ] && return 0
[ -f /var/run/pm-suspend ] && . /var/run/pm-suspend
@@ -20,7 +29,7 @@
--- pm/hooks/00clear
+++ pm/hooks/00clear
-@@ -3,7 +3,7 @@
+@@ -5,7 +5,7 @@
RETVAL=0
case "$1" in
hibernate|suspend)
@@ -47,14 +56,3 @@
modprobe $x
done
}
---- pm/hooks/94cpufreq
-+++ pm/hooks/94cpufreq
-@@ -11,7 +11,7 @@
- [ -f $x/cpufreq/scaling_governor ] || continue
-
- savestate ${x}_governor $(cat $x/cpufreq/scaling_governor)
-- sh -c "echo userspace > $x/cpufreq/scaling_governor" >/dev/null 2>&1
-+ echo performance > $x/cpufreq/scaling_governor 2>/dev/null
- done
- popd >/dev/null 2>&1
- }
++++++ pm-utils-0.20.0.20070202.tar.gz -> pm-utils-0.99.2.20070314.tar.gz ++++++
++++ 1778 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/ChangeLog new/pm-utils-0.99.2.20070314/ChangeLog
--- old/pm-utils-0.20.0.20070202/ChangeLog 2007-02-20 15:51:03.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/ChangeLog 2007-03-14 18:39:30.000000000 +0100
@@ -1,3 +1,186 @@
+2007-03-14 Peter Jones
+
+ * pm/power.d/laptop-tools:
+ - fix path for "functions"
+
+2007-03-14 Peter Jones
+
+ * pm/functions:
+ - fix use of "service" vs /etc/init.d/$x (based on input from Tim
+ Dijkstra, Stefan, and Caglar Onur)
+
+2007-03-14 Peter Jones
+
+ * pm/defaults:
+ - alphabetize
+
+ * pm/functions:
+ - add TEMPORARY_CPUFREQ_GOVERNOR and a default for it.
+
+ * pm/hooks/94cpufreq:
+ - don't change any cpu's governor until we've saved them
+ all (based on a patch from Frank Seidel via Stefan)
+
+2007-03-14 Peter Jones
+
+ * pm/defaults:
+ - add comment text (from Stefan)
+ - remove default "button" removal, it's no longer needed (from Stefan)
+
+ * src/pm-reset-swap.c:
+ - handle ulsuspend signature (from Stefan)
+ - fix errant "rc = 1;" (from Stefan)
+
+ * pm/functions:
+ - make stopservice and restartservice work with dashes and
+ underscores (from Stefan)
+
+2007-03-13 Peter Jones
+
+ * configure.in:
+ - bump version to 0.99.2
+
+2007-03-13 Peter Jones
+
+ * pm/functions:
+ - add do_suspend_hybrid function
+
+ * src/pm-action:
+ - handle pm-suspend-hybrid (by exiting with error status)
+
+ * src/pm-is-supported:
+ - add this file
+
+ * src/Makefile.am:
+ - add pm-is-supported
+
+2007-03-06 Peter Jones
+
+ * pm/functions:
+ - add /usr/lib/pm-utils/bin to $PATH
+
+2007-03-06 Peter Jones
+
+ * pm/hooks/00clear pm/hooks/00logging pm/hooks/10NetworkManager
+ * pm/hooks/20video pm/hooks/49bluetooth pm/hooks/50modules
+ * pm/hooks/55battery pm/hooks/60sysfont pm/hooks/65alsa
+ * pm/hooks/90clock pm/hooks/94cpufreq pm/hooks/99video:
+ - get the path for "functions" right.
+
+2007-03-06 Peter Jones
+
+ * configure.in:
+ - bump version to 0.99.1
+
+2007-03-06 Peter Jones
+
+ * pm/Makefile.am:
+ - rename "config" to "defaults"
+ - use $(libdir)/pm-utils instead of $(sysconfdir)
+
+ * pm/config pm/defaults:
+ - rename "config" to "defaults"
+
+ * pm/functions:
+ - rename "config" to "defaults", and look for it in usr/lib/pm-utils
+ - handle the new "two directories" style sleep.d
+
+ * pm/hooks/Makefile.am:
+ - make both sleep.d directories, but put our stuff in /usr/lib
+
+ * pm/power.d/Makefile.am:
+ - make both power.d directories, but put our stuff in /usr/lib
+
+ * src/Makefile.am:
+ - move locatons of files around to fit the new layout
+
+ * src/pm-action:
+ - changes for new layout
+
+ * src/pm-powersave:
+ - handle the new "two directories" style power.d
+
+2007-03-06 Peter Jones
+
+ * pm/hooks/05led:
+ - use "bash" not "sh"
+
+ * pm/hooks/10NetworkManager:
+ - use "bash" not "sh"
+
+ * pm/hooks/90clock:
+ - use "bash" not "sh"
+
+ * pm/hooks/95led:
+ - use "bash" not "sh"
+
+2007-03-01 Peter Jones
+
+ * pm/hooks/20video pm/hooks/99video:
+ - fix shell quoting in variable tests
+
+2007-03-01 Peter Jones
+
+ * pm/functions:
+ - fix use of [ with =~
+
+2007-03-01 Peter Jones
+
+ * pm/hooks/55battery:
+ - use hal-set-property not hal-device
+ - just do everything on resume/thaw, don't bother with saving state
+
+2007-03-01 Peter Jones
+
+ * pm/hooks/10NetworkManager: minor cleanups
+
+2007-02-28 Peter Jones
+
+ * pm/hooks/55battery: hook to reprobe batteries on hibernate/thaw,
+ because the acpi event gets eaten by the boot kernel.
+
+ * pm/hooks/Makefile.am: add 55battery here
+
+2007-02-20 Peter Jones
+
+ * man/Makefile.am: docbook2man doesn't output the man page on standard
+ output, it outputs it to ${NAME%.sgml}.1 . So redirecting stdout to
+ ${NAME%.sgml}.1 gets "Done.\n" stuck somewhere in the middle of the
+ file. Don't do this.
+
+2007-02-20 Peter Jones
+
+ * pm/hooks/20video: split resume/thaw out to another script
+
+ * pm/hooks/99video: split resume/thaw out to another script
+
+ * pm/hooks/Makefile.am: add 99video here
+
+2007-02-20 Peter Jones
+
+ * configure.in: Change version to 0.99.0
+
+2007-02-20 Peter Jones
+
+ * src/pm-action: Add error messages when we're exiting because of
+ missing data in sysfs.
+
+2007-02-20 Peter Jones
+
+ * src/pm-powersave: handle emacs files like we do in pm/functions
+
+2007-02-20 Peter Jones
+
+ * src/pm-action: handle options for video quirks
+
+ * pm/hooks/20video: use video quirk options (based largely on a
+ patch from Richard Hughes)
+
+2007-02-20 Peter Jones
+
+ * pm/functions: fix module load/unload problems with module names
+ that have - and _ .
+
2007-01-30 Peter Jones
* pm/hooks/65alsa: Add a hook to save and restore alsa settings (patch
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/configure.in new/pm-utils-0.99.2.20070314/configure.in
--- old/pm-utils-0.20.0.20070202/configure.in 2007-02-20 15:56:49.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/configure.in 2007-03-14 19:13:34.000000000 +0100
@@ -1,6 +1,6 @@
AC_PREREQ(2.52)
-AC_INIT(pm-utils, 0.20.0.20070202)
+AC_INIT(pm-utils, 0.99.2.20070314)
AC_CONFIG_SRCDIR(src)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_CONFIG_HEADER(config.h)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/INSTALL new/pm-utils-0.99.2.20070314/INSTALL
--- old/pm-utils-0.20.0.20070202/INSTALL 2007-02-20 15:58:02.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/INSTALL 2007-03-14 19:16:21.000000000 +0100
@@ -1,8 +1,8 @@
Installation Instructions
*************************
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006 Free Software Foundation, Inc.
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
+Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
@@ -10,10 +10,7 @@
Basic Installation
==================
-Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package. The following
-more-detailed instructions are generic; see the `README' file for
-instructions specific to this package.
+These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
@@ -26,9 +23,9 @@
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring. Caching is
+the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
-cache files.
+cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
@@ -38,17 +35,20 @@
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'. You need `configure.ac' if
-you want to change it or regenerate `configure' using a newer version
-of `autoconf'.
+`configure' by a program called `autoconf'. You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system.
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
- Running `configure' might take a while. While running, it prints
- some messages telling which features it is checking for.
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
2. Type `make' to compile the package.
@@ -78,7 +78,7 @@
by setting variables in the command line or in the environment. Here
is an example:
- ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+ ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
@@ -87,15 +87,17 @@
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
-own directory. To do this, you can use GNU `make'. `cd' to the
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
- With a non-GNU `make', it is safer to compile the package for one
-architecture at a time in the source code directory. After you have
-installed the package for one architecture, use `make distclean' before
-reconfiguring for another architecture.
+ If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory. After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
Installation Names
==================
@@ -188,12 +190,12 @@
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script).
+overridden in the site shell script). Here is a another example:
-Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf bug. Until the bug is fixed you can use this workaround:
+ /bin/bash ./configure CONFIG_SHELL=/bin/bash
- CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
`configure' Invocation
======================
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/man/Makefile.am new/pm-utils-0.99.2.20070314/man/Makefile.am
--- old/pm-utils-0.20.0.20070202/man/Makefile.am 2006-06-05 23:09:24.000000000 +0200
+++ new/pm-utils-0.99.2.20070314/man/Makefile.am 2007-03-09 17:12:29.000000000 +0100
@@ -8,10 +8,10 @@
$(man_MANS)
pm-pmu.1: pm-pmu.sgml
- docbook2man $? > $@
+ docbook2man $?
on_ac_power.1: on_ac_power.sgml
- docbook2man $? > $@
+ docbook2man $?
clean-local :
rm -f *~
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/man/on_ac_power.1 new/pm-utils-0.99.2.20070314/man/on_ac_power.1
--- old/pm-utils-0.20.0.20070202/man/on_ac_power.1 2007-02-20 15:58:40.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/man/on_ac_power.1 2007-03-14 08:11:26.000000000 +0100
@@ -0,0 +1,39 @@
+.\" This manpage has been automatically generated by docbook2man
+.\" from a DocBook document. This tool can be found at:
+.\" http://shell.ipoline.com/~elmert/comp/docbook2X/
+.\" Please send any bug reports, improvements, comments, patches,
+.\" etc. to Steve Cheng .
+.TH "ON_AC_POWER" "1" "06 March 2007" "" ""
+
+.SH NAME
+on_ac_power \- test whether the computer is running on line power
+.SH SYNOPSIS
+
+\fBon_ac_power\fR
+
+.SH "DESCRIPTION"
+.PP
+This manual page documents briefly the
+\fBon_ac_power\fR command.
+.PP
+\fBon_ac_power\fR is a command line program to test whether the computer is running on line power
+.SH "EXIT CODES"
+.PP
+The command succeeds (status 0) if the system is using line power
+and fails (status other than 0) otherwise.
+It is designed to be easy to use in shell scripts.
+.TP
+\fB 0 (true) \fR
+System is on line power.
+.TP
+\fB 1 (false) \fR
+System is not on line power.
+.TP
+\fB 255 (false) \fR
+Power status could not be determined.
+.SH "SEE ALSO"
+.PP
+pm-suspend (1).
+.SH "AUTHOR"
+.PP
+This manual page was written by Richard Hughes \&.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/man/pm-pmu.1 new/pm-utils-0.99.2.20070314/man/pm-pmu.1
--- old/pm-utils-0.20.0.20070202/man/pm-pmu.1 2007-02-20 15:59:04.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/man/pm-pmu.1 2007-03-14 08:11:26.000000000 +0100
@@ -0,0 +1,48 @@
+.\" This manpage has been automatically generated by docbook2man
+.\" from a DocBook document. This tool can be found at:
+.\" http://shell.ipoline.com/~elmert/comp/docbook2X/
+.\" Please send any bug reports, improvements, comments, patches,
+.\" etc. to Steve Cheng .
+.TH "PM-PMU" "1" "06 March 2007" "" ""
+
+.SH NAME
+pm-pmu \- suspend the computer on machines using a Macintosh-style PMU
+.SH SYNOPSIS
+
+\fBpm-pmu\fR
+
+.SH "DESCRIPTION"
+.PP
+This manual page documents briefly the
+\fBpm-pmu\fR command.
+.PP
+\fBpm-pmu\fR is a command line program to test whether the computer is running on line power
+.SH "EXIT CODES"
+.PP
+The command succeeds (status 0) if the machine uses a Macintosh-style
+PMU, and suspended successfully. The command fails (status other than
+0) otherwise.
+It is designed to be easy to use in shell scripts.
+.TP
+\fB 0 (true) \fR
+System was suspended using PMU.
+.TP
+\fB 1 (false) \fR
+System could not be suspended using PMU.
+.SH "OPTIONS"
+.PP
+This program follows the usual GNU command line syntax,
+with long options starting with two dashes (`-'). A summary of
+options is included below.
+.TP
+\fB --suspend \fR
+Suspend the computer.
+.TP
+\fB --help \fR
+Show help message.
+.SH "SEE ALSO"
+.PP
+pm-suspend (1).
+.SH "AUTHOR"
+.PP
+This manual page was written by Richard Hughes \&.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/config new/pm-utils-0.99.2.20070314/pm/config
--- old/pm-utils-0.20.0.20070202/pm/config 2006-02-28 18:04:19.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/pm/config 1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-SUSPEND_MODULES="button"
-
-HIBERNATE_RESUME_POST_VIDEO="no"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/defaults new/pm-utils-0.99.2.20070314/pm/defaults
--- old/pm-utils-0.20.0.20070202/pm/defaults 1970-01-01 01:00:00.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/pm/defaults 2007-03-14 18:42:22.000000000 +0100
@@ -0,0 +1,9 @@
+
+##########################################################
+# DO NOT EDIT THIS FILE, edit /etc/pm/config.d/ instead! #
+##########################################################
+
+HIBERNATE_RESUME_POST_VIDEO="no"
+
+SUSPEND_MODULES=""
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/functions new/pm-utils-0.99.2.20070314/pm/functions
--- old/pm-utils-0.20.0.20070202/pm/functions 2007-02-20 15:51:03.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/pm/functions 2007-03-14 19:15:11.000000000 +0100
@@ -1,6 +1,6 @@
#!/bin/bash
-export PATH=/sbin:/usr/sbin:/bin:/usr/bin
+export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/pm-utils/bin
# Default values go here. It is important to _not_ initialize some
# variables here. They are:
@@ -12,8 +12,9 @@
INHIBIT=/var/run/pm-utils.inhibit
PM_LOGFILE=${PM_LOGFILE:=/var/log/pm-suspend.log}
SUSPEND_MODULES=""
+TEMPORARY_CPUFREQ_GOVERNOR="userspace"
-[ -f /etc/pm/config ] && . /etc/pm/config
+[ -f /usr/lib/pm-utils/defaults ] && . /usr/lib/pm-utils/defaults
GLOBAL_CONFIG_VARIABLES=""
add_global() {
@@ -28,6 +29,7 @@
add_global PM_CMDLINE
add_global RESUME_MODULES
add_global SUSPEND_MODULES
+add_global TEMPORARY_CPUFREQ_GOVERNOR
source_configs()
{
@@ -69,6 +71,21 @@
openvt -- sh -c "usleep $1 ; rm -f /.suspended >/dev/null 2>&1 0<&1" >/dev/null 2>&1 0<&1 &
}
+find_sleepd_files()
+{
+ flist="/etc/pm/sleep.d/*[^~] /usr/lib/pm-utils/sleep.d/*[^~]"
+ bases=$(for file in $flist ; do echo $(basename $file) ; done | sort -n)
+ for base in $bases ; do
+ if [ -e "/etc/pm/sleep.d/$base" ]; then
+ if [ -x "/etc/pm/sleep.d/$base" ]; then
+ echo /etc/pm/sleep.d/$base
+ fi
+ elif [ -x "/usr/lib/pm-utils/sleep.d/$base" ]; then
+ echo /usr/lib/pm-utils/sleep.d/$base
+ fi
+ done
+}
+
run_hooks()
{
[ -z "$1" ] && return 0
@@ -78,24 +95,20 @@
echo "$(date): running $1 hooks."
- files="/etc/pm/hooks/*[^~]"
+ files=$(find_sleepd_files)
if [ "$2" = "reverse" ]; then
filea=($files)
filen=${#filea[*]}
while [ "$filen" -gt 0 ]; do
let filen--
file="${filea[$filen]}"
- if [ -x $file ]; then
- echo "===== $(date): running hook: $file ====="
- $file $1
- fi
+ echo "===== $(date): running hook: $file ====="
+ $file $1
done
else
for file in $files ; do
- if [ -x $file ]; then
- echo "===== $(date): running hook: $file ====="
- $file $1
- fi
+ echo "===== $(date): running hook: $file ====="
+ $file $1
done
fi
@@ -132,6 +145,11 @@
echo -n "disk" > /sys/power/state
}
+do_suspend_hybrid()
+{
+ return 1
+}
+
pm_main()
{
if [ -n "$PM_LOGFILE" ]; then
@@ -173,14 +191,15 @@
{
local MOD D C USED MODS I
local UNL=$1 RET=1
+ UNL=$(echo $UNL | sed -e 's/[_-]/\[_-\]/g')
# RET is the return code.
# If at least one module was unloaded, return 0.
# if the module was not loaded, also return 0 since this is no error.
# if no module was unloaded successfully, return 1
while read MOD D C USED D; do
- [ "$MOD" != "$UNL" ] && continue
+ [[ "$MOD" =~ "$UNL" ]] || continue
if [ "$USED" == "-" ]; then
- _rmmod $UNL $C
+ _rmmod $MOD $C
RET=$?
else
USED=${USED//,/ }
@@ -193,7 +212,7 @@
done
# if we unloaded at least one module, then let's
# try again!
- [ $RET -eq 0 ] && modunload $UNL
+ [ $RET -eq 0 ] && modunload $MOD
RET=$?
fi
return $RET
@@ -210,20 +229,34 @@
fi
}
+_service=$(type -p service)
+if [ -z "$_service" ]; then
+ service() {
+ if [ -x "/etc/init.d/$1" ]; then
+ "/etc/init.d/$@"
+ else
+ echo "$1" $": unrecognized service" 1>&2
+ return 1
+ fi
+ }
+fi
+unset _service
+
stopservice()
{
service "$1" status 2>/dev/null | grep -c -q running
- if [ "$?" == "0" -a -x "/etc/init.d/$1" ]; then
- echo "export ${1}_SERVICE_ACTIVATE=yes" >> /var/run/pm-suspend
- "/etc/init.d/$1" stop 2>&1
+ if [ "$?" == "0" ]; then
+ N=${1//[_.]/_}
+ echo "export ${N}_SERVICE_ACTIVATE=yes" >> /var/run/pm-suspend
+ service "$1" stop
fi
}
restartservice()
{
- if [ "x$(eval echo \$${1}_SERVICE_ACTIVATE)" == "xyes" \
- -a -x "/etc/init.d/$1" ]; then
- "/etc/init.d/$1" start 2>&1
+ N=${1//[-.]/_}
+ if [ "x$(eval echo \$${N}_SERVICE_ACTIVATE)" == "xyes" ]; then
+ service "$1" start
fi
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/hooks/00clear new/pm-utils-0.99.2.20070314/pm/hooks/00clear
--- old/pm-utils-0.20.0.20070202/pm/hooks/00clear 2006-03-14 15:56:27.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/pm/hooks/00clear 2007-03-09 17:12:29.000000000 +0100
@@ -1,5 +1,7 @@
#!/bin/bash
+. /usr/lib/pm-utils/functions
+
RETVAL=0
case "$1" in
hibernate|suspend)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/hooks/05led new/pm-utils-0.99.2.20070314/pm/hooks/05led
--- old/pm-utils-0.20.0.20070202/pm/hooks/05led 2006-04-28 17:56:07.000000000 +0200
+++ new/pm-utils-0.99.2.20070314/pm/hooks/05led 2007-03-09 17:12:29.000000000 +0100
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
[ -f /proc/acpi/ibm/led ] || exit 0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/hooks/10NetworkManager new/pm-utils-0.99.2.20070314/pm/hooks/10NetworkManager
--- old/pm-utils-0.20.0.20070202/pm/hooks/10NetworkManager 2007-02-20 15:51:03.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/pm/hooks/10NetworkManager 2007-03-09 17:12:29.000000000 +0100
@@ -1,14 +1,13 @@
-#!/bin/sh
+#!/bin/bash
+
+. /usr/lib/pm-utils/functions
suspend_nm() {
# Tell NetworkManager to shut down networking
dbus-send --system \
- --print-reply \
- --reply-timeout=2000 \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager \
- org.freedesktop.NetworkManager.sleep >/dev/null 2>&1 0<&1
- return $?
+ org.freedesktop.NetworkManager.sleep
}
resume_nm() {
@@ -16,10 +15,7 @@
dbus-send --system \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager \
- org.freedesktop.NetworkManager.wake >/dev/null 2>&1 0<&1
- rc=$?
-
- return $rc
+ org.freedesktop.NetworkManager.wake
}
case "$1" in
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/hooks/20video new/pm-utils-0.99.2.20070314/pm/hooks/20video
--- old/pm-utils-0.20.0.20070202/pm/hooks/20video 2006-04-27 10:05:43.000000000 +0200
+++ new/pm-utils-0.99.2.20070314/pm/hooks/20video 2007-03-14 19:13:09.000000000 +0100
@@ -1,48 +1,71 @@
#!/bin/bash
+#
+# Copyright 2006-2007 Richard Hughes
+# Copyright 2007 Peter Jones
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of version 2 of the GNU General Public License as
+# published by the Free Software Foundation.
-. /etc/pm/functions
+. /usr/lib/pm-utils/functions
-suspend_video()
-{
- # Suspend all video devices using the HAL dbus methods
- devices=`hal-find-by-capability --capability video_adapter_pm`
- for device in $devices
- do
- dbus-send --system --print-reply --dest=org.freedesktop.Hal \
- $device org.freedesktop.Hal.Device.VideoAdapterPM.SuspendVideo
- done
+vbetool=$(type -p vbetool)
+vbe() {
+ if [ -z "$vbetool" ]; then
+ echo "vbetool not found" 1>&2
+ return 1
+ fi
+ $vbetool "$@"
+}
+
+radeontool=$(type -p radeontool)
+radeon() {
+ if [ -z "$radeontool" ]; then
+ echo "radeontool not found" 1>&2
+ return 1
+ fi
+ $radeontool "$@"
}
-resume_video()
+suspend_video()
{
- # Resume all video devices using the HAL dbus methods
- devices=`hal-find-by-capability --capability video_adapter_pm`
- for device in $devices
- do
- dbus-send --system --print-reply --dest=org.freedesktop.Hal \
- $device org.freedesktop.Hal.Device.VideoAdapterPM.ResumeVideo
- done
+ # 0=nothing, 1=s3_bios, 2=s3_mode, 3=both
+ if [ "${DISPLAY_QUIRK_S3_BIOS}" == "true" -a \
+ "${DISPLAY_QUIRK_S3_MODE}" == "true" ]; then
+ sysctl -w kernel.acpi_video_flags=3
+ elif [ "${DISPLAY_QUIRK_S3_BIOS}" == "true" ]; then
+ sysctl -w kernel.acpi_video_flags=1
+ elif [ "${DISPLAY_QUIRK_S3_MODE}" == "true" ]; then
+ sysctl -w kernel.acpi_video_flags=2
+ else
+ sysctl -w kernel.acpi_video_flags=0
+ fi
+
+ # We might need to do one or many of these quirks
+ if [ "${DISPLAY_QUIRK_VBESTATE_RESTORE}" == "true" ]; then
+ vbe vbestate save > /var/run/vbestate
+ fi
+ if [ "${DISPLAY_QUIRK_VBEMODE_RESTORE}" == "true" ]; then
+ vbe vbemode get > /var/run/vbemode
+ fi
+ if [ "${DISPLAY_QUIRK_VGA_MODE_3}" == "true" ]; then
+ vbe vbemode set 3
+ fi
+ if [ "${DISPLAY_QUIRK_DPMS_SUSPEND}" == "true" ]; then
+ vbe dpms suspend
+ fi
}
+
case "$1" in
suspend)
suspend_video
;;
- resume)
- resume_video
- ;;
hibernate)
if [ "x$HIBERNATE_RESUME_POST_VIDEO" == "xyes" ]; then
suspend_video
fi
;;
- thaw)
- if [ "x$HIBERNATE_RESUME_POST_VIDEO" == "xyes" ]; then
- resume_video
- fi
- ;;
- *)
- ;;
esac
exit $?
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/hooks/49bluetooth new/pm-utils-0.99.2.20070314/pm/hooks/49bluetooth
--- old/pm-utils-0.20.0.20070202/pm/hooks/49bluetooth 2007-02-20 15:51:03.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/pm/hooks/49bluetooth 2007-03-09 17:12:29.000000000 +0100
@@ -1,6 +1,6 @@
#!/bin/bash
-. /etc/pm/functions
+. /usr/lib/pm-utils/functions
suspend_bluetooth()
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/hooks/50modules new/pm-utils-0.99.2.20070314/pm/hooks/50modules
--- old/pm-utils-0.20.0.20070202/pm/hooks/50modules 2006-10-25 20:22:38.000000000 +0200
+++ new/pm-utils-0.99.2.20070314/pm/hooks/50modules 2007-03-09 17:12:29.000000000 +0100
@@ -1,6 +1,6 @@
#!/bin/bash
-. /etc/pm/functions
+. /usr/lib/pm-utils/functions
suspend_modules()
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/hooks/55battery new/pm-utils-0.99.2.20070314/pm/hooks/55battery
--- old/pm-utils-0.20.0.20070202/pm/hooks/55battery 1970-01-01 01:00:00.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/pm/hooks/55battery 2007-03-06 20:55:31.000000000 +0100
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+. /usr/lib/pm-utils/functions
+
+resume_batteries()
+{
+ for x in $(hal-find-by-capability --capability battery 2>/dev/null); do
+# hal-set-property --udi "$x" --key battery.present --bool false
+# dbus-send --print-reply --system --reply-timeout=2000 \
+# --dest=org.freedesktop.Hal $x \
+# org.freedesktop.Hal.Device.Reprobe string:$x
+ dbus-send --print-reply --system --reply-timeout=2000 \
+ --dest=org.freedesktop.Hal $x \
+ org.freedesktop.Hal.Device.Rescan string:$x
+ done
+}
+
+case "$1" in
+ resume|thaw)
+ resume_batteries
+ ;;
+esac
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/hooks/60sysfont new/pm-utils-0.99.2.20070314/pm/hooks/60sysfont
--- old/pm-utils-0.20.0.20070202/pm/hooks/60sysfont 2007-02-02 18:53:55.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/pm/hooks/60sysfont 2007-03-14 18:57:32.000000000 +0100
@@ -1,8 +1,10 @@
#!/bin/bash
+. /usr/lib/pm-utils/functions
+
case "$1" in
resume|thaw)
- /sbin/setsysfont /dev/null 2>&1 ;;
+ setsysfont /dev/null 2>&1
+ alsactl store 0 >/dev/null 2>&1
;;
thaw|resume)
- /usr/sbin/alsactl restore 0 >/dev/null 2>&1
+ alsactl restore 0 >/dev/null 2>&1
;;
*)
;;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/hooks/90clock new/pm-utils-0.99.2.20070314/pm/hooks/90clock
--- old/pm-utils-0.20.0.20070202/pm/hooks/90clock 2006-04-17 21:07:40.000000000 +0200
+++ new/pm-utils-0.99.2.20070314/pm/hooks/90clock 2007-03-09 17:12:30.000000000 +0100
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
-. /etc/pm/functions
+. /usr/lib/pm-utils/functions
suspend_clock() {
if [ ! -f /var/run/pm-ntpd.lock ]; then
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/hooks/94cpufreq new/pm-utils-0.99.2.20070314/pm/hooks/94cpufreq
--- old/pm-utils-0.20.0.20070202/pm/hooks/94cpufreq 2007-02-20 15:51:03.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/pm/hooks/94cpufreq 2007-03-14 18:40:47.000000000 +0100
@@ -1,6 +1,6 @@
#!/bin/bash
-. /etc/pm/functions
+. /usr/lib/pm-utils/functions
hibernate_cpufreq()
{
@@ -11,7 +11,15 @@
[ -f $x/cpufreq/scaling_governor ] || continue
savestate ${x}_governor $(cat $x/cpufreq/scaling_governor)
- sh -c "echo userspace > $x/cpufreq/scaling_governor" >/dev/null 2>&1
+ done
+ for x in $(ls -1) ; do
+ [ -d $x/cpufreq ] || continue
+ [ -f $x/cpufreq/scaling_governor ] || continue
+
+ gov="$TEMPORARY_CPUFREQ_GOVERNOR"
+ grep -q "$GOVERNOR" $x/cpufreq/scaling_available_governors \
+ || gov="userspace"
+ sh -c "echo \"$gov\" > $x/cpufreq/scaling_governor"
done
popd >/dev/null 2>&1
}
@@ -23,7 +31,7 @@
gov=$(restorestate $(echo cpu${x}_governor))
[ -z "$gov" ] && break
- sh -c "echo \"$gov\" > /sys/devices/system/cpu/cpu$x/cpufreq/scaling_governor" >/dev/null 2>&1
+ sh -c "echo \"$gov\" > /sys/devices/system/cpu/cpu$x/cpufreq/scaling_governor"
unset gov
x=$(($x + 1))
done
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/hooks/95led new/pm-utils-0.99.2.20070314/pm/hooks/95led
--- old/pm-utils-0.20.0.20070202/pm/hooks/95led 2006-04-28 17:56:07.000000000 +0200
+++ new/pm-utils-0.99.2.20070314/pm/hooks/95led 2007-03-09 17:12:30.000000000 +0100
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
[ -f /proc/acpi/ibm/led ] || exit 0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/hooks/99video new/pm-utils-0.99.2.20070314/pm/hooks/99video
--- old/pm-utils-0.20.0.20070202/pm/hooks/99video 1970-01-01 01:00:00.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/pm/hooks/99video 2007-03-14 19:15:59.000000000 +0100
@@ -0,0 +1,64 @@
+#!/bin/bash
+#
+# Copyright 2006-2007 Richard Hughes
+# Copyright 2007 Peter Jones
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of version 2 of the GNU General Public License as
+# published by the Free Software Foundation.
+
+. /usr/lib/pm-utils/functions
+
+vbetool=$(type -p vbetool)
+vbe() {
+ if [ -z "$vbetool" ]; then
+ echo "vbetool not found" 1>&2
+ return 1
+ fi
+ $vbetool "$@"
+}
+
+radeontool=$(type -p radeontool)
+radeon() {
+ if [ -z "$radeontool" ]; then
+ echo "radeontool not found" 1>&2
+ return 1
+ fi
+ $radeontool "$@"
+}
+
+resume_video()
+{
+ if [ "${DISPLAY_QUIRK_RADEON_OFF}" == "true" ]; then
+ radeon dac on
+ radeon light on
+ fi
+ # We might need to do one or many of these quirks
+ if [ "${DISPLAY_QUIRK_VBE_POST}" == "true" ]; then
+ vbe post
-. /etc/pm/functions
+. /usr/lib/pm-utils/functions
setlowpowermode()
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/pm/power.d/Makefile.am new/pm-utils-0.99.2.20070314/pm/power.d/Makefile.am
--- old/pm-utils-0.20.0.20070202/pm/power.d/Makefile.am 2007-02-20 15:51:03.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/pm/power.d/Makefile.am 2007-03-09 17:12:30.000000000 +0100
@@ -1,4 +1,4 @@
-powerdir = $(sysconfdir)/pm/power.d
+powerdir = $(libdir)/pm-utils/power.d
power_SCRIPTS = \
laptop-tools \
@@ -6,5 +6,8 @@
EXTRA_DIST=$(power_SCRIPTS)
+install-exec-local:
+ -mkdir -p $(DESTDIR)$(sysconfdir)/pm/power.d
+
clean-local :
rm -f *~
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/src/Makefile.am new/pm-utils-0.99.2.20070314/src/Makefile.am
--- old/pm-utils-0.20.0.20070202/src/Makefile.am 2007-02-20 15:51:03.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/src/Makefile.am 2007-03-13 17:59:46.000000000 +0100
@@ -1,7 +1,17 @@
-sbin_PROGRAMS = \
+pm_utils_bindir = $(libdir)/pm-utils/bin
+
+pm_utils_bin_PROGRAMS = \
pm-pmu \
pm-reset-swap
+pm_utils_bin_SCRIPTS = \
+ pm-action
+
+pm_utils_usr_bindir = $(bindir)
+
+pm_utils_usr_bin_SCRIPTS = \
+ pm-is-supported
+
pm_pmu_SOURCES = \
pm-pmu.c
@@ -11,8 +21,7 @@
extradir = $(sbindir)
extra_SCRIPTS = \
- pm-powersave \
- pm-action
+ pm-powersave
acpowerdir = $(bindir)
@@ -20,12 +29,16 @@
on_ac_power
install-exec-hook:
- -ln -s pm-action $(DESTDIR)$(sbindir)/pm-suspend
- -ln -s pm-action $(DESTDIR)$(sbindir)/pm-hibernate
-
-EXTRA_DIST = \
- $(extra_SCRIPTS) \
- $(acpower_SCRIPTS)
+ -mkdir -p $(DESTDIR)$(sbindir)
+ -ln -s $(pm_utils_bindir)/pm-action $(DESTDIR)$(sbindir)/pm-suspend
+ -ln -s $(pm_utils_bindir)/pm-action $(DESTDIR)$(sbindir)/pm-hibernate
+ -ln -s $(pm_utils_bindir)/pm-action $(DESTDIR)$(sbindir)/pm-suspend-hybrid
+
+EXTRA_DIST = \
+ $(extra_SCRIPTS) \
+ $(acpower_SCRIPTS) \
+ $(pm_utils_bin_SCRIPTS) \
+ $(pm_utils_usr_bin_SCRIPTS)
clean-local :
rm -f *~
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/src/pm-action new/pm-utils-0.99.2.20070314/src/pm-action
--- old/pm-utils-0.20.0.20070202/src/pm-action 2006-11-08 12:16:07.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/src/pm-action 2007-03-13 17:59:46.000000000 +0100
@@ -8,6 +8,7 @@
# Bill Nottingham
# Peter Jones
# David Zeuthen
+# Richard Hughes
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
@@ -25,6 +26,25 @@
# The rule here? Simplicity.
+help_options() {
+ echo "pm-action [options]"
+ echo
+ echo "Options can change how the supend or hibernate is done."
+ echo
+ echo "Possible actions are:"
+ echo
+ echo " --quirk-dpms-on"
+ echo " --quirk-dpms-suspend"
+ echo " --quirk-radeon-off"
+ echo " --quirk-s3-bios"
+ echo " --quirk-s3-mode"
+ echo " --quirk-vbe-post"
+ echo " --quirk-vbemode-restore"
+ echo " --quirk-vbestate-restore"
+ echo " --quirk-vga-mode3"
+ echo
+}
+
if [ -n "$EUID" -a "$EUID" != "0" ]; then
echo This utility may only be run by the root user. 1>&2
exit 1
@@ -32,23 +52,63 @@
export LC_COLLATE=C
-. /etc/pm/functions
+# Get the command line options
+while [ $# -gt 0 ]
+do
+ case "$1" in
+ --quirk-dpms-on)
+ export DISPLAY_QUIRK_DPMS_ON="true" ;;
+ --quirk-dpms-suspend)
+ export DISPLAY_QUIRK_DPMS_SUSPEND="true" ;;
+ --quirk-radeon-off)
+ export DISPLAY_QUIRK_RADEON_OFF="true" ;;
+ --quirk-s3-bios)
+ export DISPLAY_QUIRK_S3_BIOS="true" ;;
+ --quirk-s3-mode)
+ export DISPLAY_QUIRK_S3_MODE="true" ;;
+ --quirk-vbe-post)
+ export DISPLAY_QUIRK_VBE_POST="true" ;;
+ --quirk-vbemode-restore)
+ export DISPLAY_QUIRK_VBEMODE_RESTORE="true" ;;
+ --quirk-vbestate-restore)
+ export DISPLAY_QUIRK_VBESTATE_RESTORE="true" ;;
+ --quirk-vga-mode3)
+ export DISPLAY_QUIRK_VGA_MODE_3="true" ;;
+ --help)
+ help_options
+ exit 0 ;;
+ *)
+ break ;; # terminate while loop
+ esac
+ shift
+done
+
+. /usr/lib/pm-utils/functions
[ -f /sys/power/state ] || exit 1
ACTION=$(basename "$0")
ACTION=${ACTION#pm-}
+ACTION=${ACTION/-/_}
case "$ACTION" in
suspend)
- grep -q mem /sys/power/state || exit 1
+ if ! grep -q mem /sys/power/state ; then
+ echo "Error: kernel cannot suspend to ram." 1>&2
+ exit 1
+ fi
REVERSE=resume ;;
hibernate)
- grep -q disk /sys/power/state || exit 1
- [ -f /sys/power/disk ] || exit 1
+ if ! grep -q disk /sys/power/state ; then
+ echo "Error: kernel cannot suspend to disk." 1>&2
+ exit 1
+ fi
REVERSE=thaw
;;
+ *)
+ exit 1
+ ;;
esac
export PM_CMDLINE="$@"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/src/pm-is-supported new/pm-utils-0.99.2.20070314/src/pm-is-supported
--- old/pm-utils-0.20.0.20070202/src/pm-is-supported 1970-01-01 01:00:00.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/src/pm-is-supported 2007-03-13 15:05:51.000000000 +0100
@@ -0,0 +1,52 @@
+#!/bin/bash
+#
+# Copyright 2007 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of version 2 of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+help_options() {
+ echo "pm-is-supported [--suspend | --hibernate | --suspend-hybrid ]"
+ echo
+}
+
+export LC_COLLATE=C
+
+ARG=${1#--}
+
+[ -f /sys/power/state ] || exit 1
+
+case "$ARG" in
+ suspend)
+ grep -q mem /sys/power/state || exit 1
+ ;;
+ hibernate)
+ [ -f /sys/power/disk ] || exit 1
+ grep -q disk /sys/power/state || exit 1
+ ;;
+ suspend-hybrid)
+ # grep -q mem /sys/power/state || exit 1
+ # grep -q disk /sys/power/state || exit 1
+ exit 1
+ ;;
+ help)
+ help_options
+ ;;
+ *)
+ help_options 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/src/pm-powersave new/pm-utils-0.99.2.20070314/src/pm-powersave
--- old/pm-utils-0.20.0.20070202/src/pm-powersave 2006-10-04 18:30:00.000000000 +0200
+++ new/pm-utils-0.99.2.20070314/src/pm-powersave 2007-03-09 17:12:30.000000000 +0100
@@ -24,11 +24,26 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
+find_powerd_files()
+{
+ flist="/etc/pm/power.d/*[^~] /usr/lib/pm-utils/power.d/*[^~]"
+ bases=$(for file in $flist ; do echo $(basename $file) ; done | sort -n)
+ for base in $bases ; do
+ if [ -e "/etc/pm/power.d/$base" ]; then
+ if [ -x "/etc/pm/power.d/$base" ]; then
+ echo /etc/pm/power.d/$base
+ fi
+ elif [ -x "/usr/lib/pm-utils/power.d/$base" ]; then
+ echo /usr/lib/pm-utils/power.d/$base
+ fi
+ done
+}
+
runpowerhooks()
{
- files="/etc/pm/power.d/*"
+ files=$(find_powerd_files)
for file in $files ; do
- [[ "$file" =~ ".*~$" ]] || [ -x $file ] && $file $1
+ $file $1
done
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pm-utils-0.20.0.20070202/src/pm-reset-swap.c new/pm-utils-0.99.2.20070314/src/pm-reset-swap.c
--- old/pm-utils-0.20.0.20070202/src/pm-reset-swap.c 2007-01-29 22:49:45.000000000 +0100
+++ new/pm-utils-0.99.2.20070314/src/pm-reset-swap.c 2007-03-14 18:39:31.000000000 +0100
@@ -95,7 +95,8 @@
if (fread(buf, sizeof (char), 10, dev) != 10)
return -1;
- if (!strncmp(buf, "S1SUSPEND", 9))
+ if (!strncmp(buf, "S1SUSPEND", 9) ||
+ !strncmp(buf, "ULSUSPEND", 9))
return 1;
return 0;
@@ -148,7 +149,7 @@
fclose(dev);
return 2;
}
- rc = 1;
+
if (rc == 1) {
if (clear_resume_block(dev, 0)) {
fprintf(stderr, "Could not clear swap signature on \"%s\": %m\n",
++++++ pm-utils-0.99.2-comment-configfile.diff ++++++
Index: pm/defaults
===================================================================
RCS file: /cvs/pm-utils/pm-utils/pm/defaults,v
retrieving revision 1.4
diff -u -p -r1.4 defaults
--- pm/defaults 14 Mar 2007 15:37:04 -0000 1.4
+++ pm/defaults 14 Mar 2007 18:22:45 -0000
@@ -3,7 +3,25 @@
# DO NOT EDIT THIS FILE, edit /etc/pm/config.d/ instead! #
##########################################################
+# this variable is not used in the SUSE package, we use s2ram instead
HIBERNATE_RESUME_POST_VIDEO="no"
+# what modules should be unloaded during suspend/hibernate?
+# note that this removes the module and all dependent modules, if possible.
SUSPEND_MODULES=""
+
+#######################################################################
+# the variables below here are specific to the SUSE package right now
+# what options should be passed to s2ram?
+# see http://en.opensuse.org/S2ram for more information
+S2RAM_OPTS=""
+
+# where is the s2disk binary located? Defaults to "/usr/sbin/s2disk"
+# (do not change unless you kow what you are doing)
+# S2DISK_BIN=""
+
+# which method should be used for suspend to disk?
+# defaults to "autodetect" ("userspace" if s2disk is available, "kernel" otherwise)
+# (do not change unless you kow what you are doing)
+HIBERNATE_METHOD=""
++++++ pm-utils-0.99.2-fix-stopservice.diff ++++++
--- pm/functions
+++ pm/functions
@@ -270,7 +270,7 @@
{
service "$1" status 2>/dev/null | grep -c -q running
if [ "$?" == "0" ]; then
- N=${1//[_.]/_}
+ N=${1//[-.]/_}
echo "export ${N}_SERVICE_ACTIVATE=yes" >> /var/run/pm-suspend
service "$1" stop
fi
++++++ pm-utils-0.99.2-uswsusp-support.diff ++++++
Index: pm/functions
===================================================================
RCS file: /cvs/pm-utils/pm-utils/pm/functions,v
retrieving revision 1.40
diff -u -p -r1.40 functions
--- pm/functions 14 Mar 2007 16:40:30 -0000 1.40
+++ pm/functions 14 Mar 2007 18:31:05 -0000
@@ -12,6 +12,9 @@ HIBERNATE_RESUME_POST_VIDEO=no
INHIBIT=/var/run/pm-utils.inhibit
PM_LOGFILE=${PM_LOGFILE:=/var/log/pm-suspend.log}
SUSPEND_MODULES=""
+HIBERNATE_METHOD=""
+S2DISK_BIN=/usr/sbin/s2disk
+S2DISK_CONF=/var/lib/s2disk.conf
TEMPORARY_CPUFREQ_GOVERNOR="userspace"
[ -f /usr/lib/pm-utils/defaults ] && . /usr/lib/pm-utils/defaults
@@ -30,6 +33,9 @@ add_global PM_CMDLINE
add_global RESUME_MODULES
add_global SUSPEND_MODULES
add_global TEMPORARY_CPUFREQ_GOVERNOR
+add_global HIBERNATE_METHOD
+add_global S2DISK_BIN
+add_global S2DISK_CONF
source_configs()
{
@@ -136,13 +142,31 @@ get_power_status()
do_suspend()
{
- pm-pmu --suspend || echo -n "mem" > /sys/power/state
+ if [ -x /usr/sbin/s2ram ]; then
+ /usr/sbin/s2ram $S2RAM_OPTS
+ else
+ pm-pmu --suspend || echo -n "mem" > /sys/power/state
+ fi
}
do_hibernate()
{
- echo -n "platform" > /sys/power/disk
- echo -n "disk" > /sys/power/state
+ if [ -z "$HIBERNATE_METHOD" ]; then
+ if [ -x $S2DISK_BIN -a -c /dev/snapshot ]; then
+ HIBERNATE_METHOD="userspace"
+ else
+ HIBERNATE_METHOD="kernel"
+ fi
+ fi
+ case $HIBERNATE_METHOD in
+ userspace)
+ $S2DISK_BIN -f $S2DISK_CONF
+ ;;
+ kernel)
+ echo -n "platform" > /sys/power/disk
+ echo -n "disk" > /sys/power/state
+ ;;
+ esac
}
do_suspend_hybrid()
++++++ pm-utils-suse-20070218.tar.gz -> pm-utils-suse-20070314.tar.gz ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pm-utils-suse/hooks/06autofs new/pm-utils-suse/hooks/06autofs
--- old/pm-utils-suse/hooks/06autofs 2006-10-11 21:43:27.000000000 +0200
+++ new/pm-utils-suse/hooks/06autofs 2007-03-14 21:18:23.000000000 +0100
@@ -1,6 +1,6 @@
#!/bin/bash
-. /etc/pm/functions
+. /usr/lib/pm-utils/functions
case "$1" in
hibernate|suspend)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org