rpms/pm-utils/F-7 pm-utils-0.99.4-hibernate_mode.patch, NONE, 1.1 pm-utils-0.99.4-manpage-typo.patch, NONE, 1.1 pm-utils-0.99.4-no-nv-suspend.patch, NONE, 1.1 pm-utils-0.99.4-readme_update.patch, NONE, 1.1 pm-utils-0.99.4-tty0_permissions.patch, NONE, 1.1 pm-utils-correct-filename-in-help.patch, NONE, 1.1 pm-utils-missing-uniq.patch, NONE, 1.1 pm-utils-nullglob.patch, NONE, 1.1
Till Maas (till)
fedora-extras-commits at redhat.com
Sat Apr 19 11:23:24 UTC 2008
Author: till
Update of /cvs/pkgs/rpms/pm-utils/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31378
Added Files:
pm-utils-0.99.4-hibernate_mode.patch
pm-utils-0.99.4-manpage-typo.patch
pm-utils-0.99.4-no-nv-suspend.patch
pm-utils-0.99.4-readme_update.patch
pm-utils-0.99.4-tty0_permissions.patch
pm-utils-correct-filename-in-help.patch
pm-utils-missing-uniq.patch pm-utils-nullglob.patch
Log Message:
* Sat Apr 19 2008 Till Maas <opensource till name> - 0.99.4-17
- remove hd-apm script for Fedora 8 and 7
- Adjust Requires:/remove Conflicts:
pm-utils-0.99.4-hibernate_mode.patch:
--- NEW FILE pm-utils-0.99.4-hibernate_mode.patch ---
This patch makes it possible to use a different hibernate mode, valid modes are
according to Documentation/power/interface.txt
platform shutdown reboot testproc test
Author: Till Maas <opensource till name>
License: same as pm-utils
Red Hat Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=375701
diff -up pm-utils-0.99.4/pm/functions.hibernate_mode pm-utils-0.99.4/pm/functions
--- pm-utils-0.99.4/pm/functions.hibernate_mode 2008-01-08 19:07:17.000000000 +0100
+++ pm-utils-0.99.4/pm/functions 2008-01-08 19:11:33.000000000 +0100
@@ -10,6 +10,7 @@ export PATH=/sbin:/usr/sbin:/bin:/usr/bi
# RESUME_MODULES
#
set -a
+HIBERNATE_MODE="platform"
HIBERNATE_RESUME_POST_VIDEO=no
INHIBIT=/var/run/pm-utils.inhibit
PM_LOGFILE=${PM_LOGFILE:=/var/log/pm-suspend.log}
@@ -132,7 +133,7 @@ do_suspend()
do_hibernate()
{
[ ${DISABLE_HIBERNATE} == "yes" ] && return 0
- echo -n "platform" > /sys/power/disk
+ echo -n "${HIBERNATE_MODE}" > /sys/power/disk
echo -n "disk" > /sys/power/state
}
pm-utils-0.99.4-manpage-typo.patch:
--- NEW FILE pm-utils-0.99.4-manpage-typo.patch ---
RedHat Bugzilla report: https://bugzilla.redhat.com/show_bug.cgi?id=286201
diff -up pm-utils-0.99.4/man/pm-pmu.sgml.manpage-typo pm-utils-0.99.4/man/pm-pmu.sgml
--- pm-utils-0.99.4/man/pm-pmu.sgml.manpage-typo 2007-09-20 01:37:22.000000000 +0200
+++ pm-utils-0.99.4/man/pm-pmu.sgml 2007-09-20 01:37:06.000000000 +0200
@@ -37,7 +37,7 @@
<title>DESCRIPTION</title>
<para>This manual page documents briefly the
<command>&package;</command> command.</para>
- <para><command>&package;</command> is a command line program to test whether the computer is running on line power</para>
+ <para><command>&package;</command> is a command line program to suspend a computer on machines using a Macintosh-style PMU</para>
</refsect1>
<refsect1>
<title>EXIT CODES</title>
pm-utils-0.99.4-no-nv-suspend.patch:
--- NEW FILE pm-utils-0.99.4-no-nv-suspend.patch ---
diff -up pm-utils-0.99.4/src/pm-is-supported.nv pm-utils-0.99.4/src/pm-is-supported
--- pm-utils-0.99.4/src/pm-is-supported.nv 2007-10-23 15:50:20.000000000 -0400
+++ pm-utils-0.99.4/src/pm-is-supported 2007-10-23 15:50:31.000000000 -0400
@@ -21,15 +21,46 @@ help_options() {
echo
}
+get_video_type() {
+ vendor=""
+ vendor=$(/sbin/lspci -mn|awk '{if ($2 ~ /^"0300"$/ ) {print $3;exit;}}')
+ vendor=$(eval echo $vendor)
+ [ -z "$vendor" ] && return 1
+ case "$vendor" in
+ 1002)
+ echo ATI
+ return 0
+ ;;
+ 10de)
+ echo nVidia
+ return 0
+ ;;
+ 8086)
+ echo Intel
+ return 0
+ ;;
+ *)
+ echo $vendor
+ return 0
+ ;;
+ esac
+}
+
export LC_COLLATE=C
ARG=${1#--}
[ -f /sys/power/state ] || exit 1
+. /usr/lib/pm-utils/functions
+
case "$ARG" in
suspend)
grep -q mem /sys/power/state || exit 1
+ videovendor=$(get_video_type)
+ if [ "$videovendor" = "nVidia" -a "$(grep "Driver.*nvidia" /etc/X11/xorg.conf)" = "" -a -z "$ALLOW_NV_SUSPEND" ]; then
+ exit 1
+ fi
;;
hibernate)
[ -f /sys/power/disk ] || exit 1
pm-utils-0.99.4-readme_update.patch:
--- NEW FILE pm-utils-0.99.4-readme_update.patch ---
diff -up pm-utils-0.99.4/README.readme_update pm-utils-0.99.4/README
--- pm-utils-0.99.4/README.readme_update 2006-10-30 19:16:48.000000000 +0100
+++ pm-utils-0.99.4/README 2008-01-09 03:41:48.000000000 +0100
@@ -24,30 +24,108 @@ file into the hooks directory, for examp
- setting grub to be the default target for a hibernate-resume
- other wacky things that need doing on specific systems
-How do "hooks" work?
+How does pm-utils work?
-* You put a file in /etc/pm/hooks, which is executable. When suspend or
+Pm-utils contains the following executables:
+
+* on_ac_power - checks whether the system is on ac power
+ (see man 1 on_ac_power)
+* pm-is-supported - checks whether the system is capables of suspend or resume
+ (see man 1 pm-is-supported)
+* pm-powersave - This runs the power.d hooks, it takes true or false as first
+ argument, depending on whether power should be saved
+* pm-suspend - This runs the sleep.d hooks with suspend as first argument
+ (this is usually run by another tool, e.g. gnome-power-manager)
+ and finally suspends the machine (suspend to ram)
+* pm-hibernate - Thus runs the sleep.d hooks with hibernate as first argument
+ (this is usually run by another tool, e.g. gnome-power-manager)
+ and finally hibernates the machine (suspend to disk)
+* pm-suspend-hybrid - not yet implemented
+
+
+Pm-utils has the following directory structure in /usr/lib,
+the contens of the power.d and sleep.d may vary.
+
+/usr/lib/pm-utils/
+|-- bin
+| |-- pm-action
+| |-- pm-pmu
+| `-- pm-reset-swap
+|-- defaults
+|-- functions
+|-- power.d
+| `-- sched-powersave
+`-- sleep.d
+ |-- 00clear
+ |-- 01grub
+ |-- 05led
+ |-- 10NetworkManager
+ |-- 20video
+ |-- 49bluetooth
+ |-- 50modules
+ |-- 55battery
+ |-- 60sysfont
+ |-- 65alsa
+ |-- 90clock
+ |-- 94cpufreq
+ |-- 95led
+ |-- 99hd-apm-restore.hook
+ `-- 99video
+
+Within the power.d and sleep.d directories, the default hooks are stored.
+Adjustments can be done within /etc/pm:
+
+/etc/pm
+|-- config.d
+| |-- 02oldconfig.conf
+| `-- hd-apm-restore.conf
+|-- power.d
+`-- sleep.d
+ `-- 95ac-power-indicator.hook
+
+The config.d directory may contain bash scripts, that are sourced by
+pm-suspend and pm-hibernate to change the beheaviour of pm-utils.
+The power.d and sleep.d directories can be used to add your own hooks
+to pm-utils or to overwrite the default hooks. To overwrite an hook simply
+add a hook with the same name to the directory.
+
+
+How do hooks work?
+
+* You put a file in /etc/pm/sleep.d, which is executable. When suspend or
hibernate is called, several things happen:
1) a new virtual terminal is alloced and switched to
- 2) /etc/pm/config is evaluated . This config file that should only be
- modified by end-users.
- 3) /etc/pm/config.d/* are evaluated in C sort order. These files can be
- provided by individual packages outside of pm-utils. If a global config
- variable is set, the value set to will be appended to the previous value.
- If any other variable is set, it will be ignored.
- 4) each of /etc/pm/hooks/* are executed in C sort order. The first command
+ 2) /etc/pm/config.d/* are sourced in bash filename expansion sort order.
+ These files can be provided by individual packages outside of pm-utils or
+ provided by the user.
+ To append to a global variable, please use BAR+=" foo", to append
+ the value foo separated with a space to the variable BAR
+ 3) each of /etc/pm/sleep.d/* are executed in C sort order. The first command
line argument is "suspend" or "hibernate". These files may source
configuration files from /etc/pm/config.d/ on their own in order to pick
- up variables set there that aren't part of the global list. Note that
+ up variables set there that aren't part of the global list. Note that
hooks should take care to preserve any global configuration variable
which _that_ hook will later need to use, as sourcing this config file
will clobber any such variables.
- 5) the system suspends or hibernates.
- 6) some event happens to wake the machine up
- 7) each of /etc/pm/hooks/* are executed in reverse C sort order. The first
+ 4) the system suspends or hibernates.
+ 5) some event happens to wake the machine up
+ 6) each of /etc/pm/sleep.d/* are executed in reverse C sort order. The first
command line argument is "resume" or "thaw".
- 8) the system switches back to the original virtual terminal from step 1.
+ 7) the system switches back to the original virtual terminal from step 1.
That's it!
+Which variables can be used to configure pm-utils?
+
+SUSPEND_MODULES
+ This is a space separted list of modules, that should be removed before sleep and
+ reloaded afterwards.
+
+HIBERNATE_MODE
+ This can be used to change the mode for hibernate. Default is platform. In case you
+ need to change it to shutdown, please file a bug report, because this usually is a
+ bug. Other valid modes are listed with
+ cat /sys/power/disk
+ You can find more info about them in the kernel documentation in
+ Documentation/power/*
pm-utils-0.99.4-tty0_permissions.patch:
--- NEW FILE pm-utils-0.99.4-tty0_permissions.patch ---
Bug Report:
https://bugzilla.redhat.com/show_bug.cgi?id=236394
diff -up pm-utils-0.99.4/pm/hooks/60sysfont.tty0_permissions pm-utils-0.99.4/pm/hooks/60sysfont
--- pm-utils-0.99.4/pm/hooks/60sysfont.tty0_permissions 2007-09-20 02:38:40.000000000 +0200
+++ pm-utils-0.99.4/pm/hooks/60sysfont 2007-09-20 02:36:52.000000000 +0200
@@ -3,8 +3,10 @@
. /usr/lib/pm-utils/functions
case "$1" in
- resume|thaw)
- setsysfont </dev/tty0 ;;
+ resume|thaw)
+ if [ -x /sbin/setsysfont -a -c /dev/tty1 ]; then
+ /sbin/setsysfont < /dev/tty1 > /dev/tty1 2>/dev/null
+ fi
esac
exit $?
pm-utils-correct-filename-in-help.patch:
--- NEW FILE pm-utils-correct-filename-in-help.patch ---
This patch makes pm-action show the filename in help, that was used
to invoke it, e.g. pm-suspend
Index: src/pm-action
===================================================================
RCS file: /cvs/pm-utils/pm-utils/src/pm-action,v
retrieving revision 1.12
diff -u -r1.12 pm-action
--- src/pm-action 18 Jun 2007 20:42:36 -0000 1.12
+++ src/pm-action 24 Dec 2007 12:30:38 -0000
@@ -27,7 +27,7 @@
# The rule here? Simplicity.
help_options() {
- echo "pm-action [options]"
+ echo "$(basename "$0") [options]"
echo
echo "Options can change how the supend or hibernate is done."
echo
pm-utils-missing-uniq.patch:
--- NEW FILE pm-utils-missing-uniq.patch ---
Red Hat Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=302401
(Issue 2 in the bug report)
Without the uniq files in the sleep.d or power.d directory may run twice.
Also this patch removes a uneccessary "-e" test in the if statements, the
"-x" test already includes a "-e" test.
Also this patch adds a modeline for vim no to expand tabs, because tabs are
used in the files for indentation.
Index: pm/functions
===================================================================
RCS file: /cvs/pm-utils/pm-utils/pm/functions,v
retrieving revision 1.47
diff -u -r1.47 functions
--- pm/functions 23 Dec 2007 23:01:46 -0000 1.47
+++ pm/functions 24 Dec 2007 12:24:25 -0000
@@ -1,4 +1,5 @@
#!/bin/bash
+# vim:noexpandtab
export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/pm-utils/bin
@@ -58,12 +59,10 @@
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)
+ bases=$(for file in $flist ; do echo $(basename $file) ; done | sort -n | uniq)
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
+ if [ -x "/etc/pm/sleep.d/$base" ]; then
+ echo /etc/pm/sleep.d/$base
elif [ -x "/usr/lib/pm-utils/sleep.d/$base" ]; then
echo /usr/lib/pm-utils/sleep.d/$base
fi
Index: src/pm-powersave
===================================================================
RCS file: /cvs/pm-utils/pm-utils/src/pm-powersave,v
retrieving revision 1.7
diff -u -r1.7 pm-powersave
--- src/pm-powersave 6 Mar 2007 19:08:06 -0000 1.7
+++ src/pm-powersave 24 Dec 2007 12:24:25 -0000
@@ -1,5 +1,5 @@
#!/bin/bash
-#
+# vim:noexpandtab
# Simple powersave script
#
# Copyright 2006 Red Hat, Inc.
@@ -27,12 +27,10 @@
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)
+ bases=$(for file in $flist ; do echo $(basename $file) ; done | sort -n | uniq)
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
+ if [ -x "/etc/pm/power.d/$base" ]; then
+ echo /etc/pm/power.d/$base
elif [ -x "/usr/lib/pm-utils/power.d/$base" ]; then
echo /usr/lib/pm-utils/power.d/$base
fi
pm-utils-nullglob.patch:
--- NEW FILE pm-utils-nullglob.patch ---
Red Hat Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=302401
(Issue 1 in the bug report)
This patch makes sure that the nullglob option is set. This makes
sure that the result of a filename expansion is empty, when the
pattern does not match.
Index: pm/functions
===================================================================
RCS file: /cvs/pm-utils/pm-utils/pm/functions,v
retrieving revision 1.47
diff -u -r1.47 functions
--- pm/functions 23 Dec 2007 23:01:46 -0000 1.47
+++ pm/functions 24 Dec 2007 12:37:00 -0000
@@ -18,6 +18,10 @@
[ -f /usr/lib/pm-utils/defaults ] && . /usr/lib/pm-utils/defaults
set +a
+# set nullglob to make glob results empty in case the pattern does not
+# match any files
+shopt -s nullglob
+
source_configs()
{
cfgs="/etc/pm/config.d/*[^~]"
Index: src/pm-powersave
===================================================================
RCS file: /cvs/pm-utils/pm-utils/src/pm-powersave,v
retrieving revision 1.7
diff -u -r1.7 pm-powersave
--- src/pm-powersave 6 Mar 2007 19:08:06 -0000 1.7
+++ src/pm-powersave 24 Dec 2007 12:37:00 -0000
@@ -24,6 +24,10 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
+# set nullglob to make glob results empty in case the pattern does not
+# match any files
+shopt -s nullglob
+
find_powerd_files()
{
flist="/etc/pm/power.d/*[^~] /usr/lib/pm-utils/power.d/*[^~]"
More information about the fedora-extras-commits
mailing list