Hello community, here is the log from the commit of package pm-utils checked in at Mon Oct 30 22:50:29 CET 2006. -------- --- pm-utils/pm-utils.changes 2006-10-27 19:05:15.000000000 +0200 +++ /mounts/work_src_done/STABLE/pm-utils/pm-utils.changes 2006-10-30 21:20:54.000000000 +0100 @@ -1,0 +2,5 @@ +Mon Oct 30 21:20:16 CET 2006 - seife@suse.de + +- update to current CVS, some of our fixes incorporated upstream + +------------------------------------------------------------------- Old: ---- pm-utils-0.20.0.20061024-suse.diff pm-utils-0.20.0.20061024.tar.gz New: ---- pm-utils-0.20.0.20061030-suse.diff pm-utils-0.20.0.20061030.tar.gz pm-utils-fix-running-hooks-output.diff pm-utils-fix-source-configs.diff pm-utils-uswsusp-support.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pm-utils.spec ++++++ --- /var/tmp/diff_new_pack.NFKjsl/_old 2006-10-30 22:50:21.000000000 +0100 +++ /var/tmp/diff_new_pack.NFKjsl/_new 2006-10-30 22:50:21.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package pm-utils (Version 0.20.0.20061024) +# spec file for package pm-utils (Version 0.20.0.20061030) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -12,13 +12,16 @@ Name: pm-utils URL: http://webcvs.freedesktop.org/pm-utils/ -Version: 0.20.0.20061024 -Release: 2 +Version: 0.20.0.20061030 +Release: 1 Summary: Tools to suspend and hibernate computers. License: GNU General Public License (GPL) - all versions Group: System/Base Source: %{name}-%{version}.tar.gz -Patch0: pm-utils-0.20.0.20061024-suse.diff +Patch0: pm-utils-0.20.0.20061030-suse.diff +Patch1: pm-utils-fix-running-hooks-output.diff +Patch2: pm-utils-fix-source-configs.diff +Patch3: pm-utils-uswsusp-support.diff Source1: pm-utils-suse.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build Prefix: /usr @@ -40,6 +43,9 @@ %prep %setup -b 1 +%patch1 -p0 +%patch2 -p0 +%patch3 -p0 %patch0 -p0 %build @@ -68,6 +74,8 @@ %doc README COPYING ChangeLog AUTHORS %changelog -n pm-utils +* Mon Oct 30 2006 - seife@suse.de +- update to current CVS, some of our fixes incorporated upstream * Fri Oct 27 2006 - hmacht@suse.de - readd lost S2DISK_BIN and S2DISK_CONF variables * Tue Oct 24 2006 - hmacht@suse.de ++++++ pm-utils-0.20.0.20061024-suse.diff -> pm-utils-0.20.0.20061030-suse.diff ++++++ --- pm-utils/pm-utils-0.20.0.20061024-suse.diff 2006-10-27 18:51:37.000000000 +0200 +++ /mounts/work_src_done/STABLE/pm-utils/pm-utils-0.20.0.20061030-suse.diff 2006-10-30 21:52:31.000000000 +0100 @@ -1,52 +1,14 @@ --- pm/functions +++ pm/functions -@@ -5,7 +5,10 @@ +@@ -5,7 +5,6 @@ # default values go here HIBERNATE_RESUME_POST_VIDEO=no SUSPEND_MODULES="" -RESUME_MODULES="" -+INHIBIT=/var/run/pm-utils.inhibit -+S2DISK_BIN=/usr/sbin/s2disk -+S2DISK_CONF=/var/lib/s2disk.conf -+ - LOGFILE=/var/log/pm-suspend.log - - [ -f /etc/pm/config ] && . /etc/pm/config -@@ -19,21 +22,22 @@ - # export them all here - add_global HIBERNATE_RESUME_POST_VIDEO - add_global SUSPEND_MODULES --add_global RESUME_MODULES -+add_global INHIBIT - add_global LOGFILE -+add_global S2DISK_BIN -+add_global S2DISK_CONF - - source_configs() - { -- for cfg in $(ls -1 /etc/pm/config.d/* 2>/dev/null) ; do -- [[ "$cfg" =~ ".*~$" ]] && continue -- STR=". $cfg" -- for v in $GLOBAL_CONFIG_VARIABLES ; do -- STR="$STR ; echo x_$v=\"\$(eval echo \$$v)\"" -- done -- eval $(bash -c "$STR") -- for v in $GLOBAL_CONFIG_VARIABLES ; do -- eval $v="$(eval echo $(eval echo \$$v) \$x_$v)" -- done -+ for cfg in $(ls -1 /etc/pm/config.d/*[^~] 2>/dev/null) ; do -+ while read LINE; do -+ for v in $GLOBAL_CONFIG_VARIABLES ; do -+ case "$LINE" in -+ $v=*) continue 2 ;; -+ esac -+ done -+ eval $LINE -+ done < $cfg - done - } - -@@ -57,7 +61,7 @@ + PM_LOGFILE=${PM_LOGFILE:=/var/log/pm-suspend.log} + INHIBIT=/var/run/pm-utils.inhibit + S2DISK_BIN=/usr/sbin/s2disk +@@ -62,7 +61,7 @@ remove_suspend_lock() { @@ -55,7 +17,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 & -@@ -68,7 +72,7 @@ +@@ -73,7 +72,7 @@ [ -z "$1" ] && return 0 [ -f /var/run/pm-suspend ] && . /var/run/pm-suspend @@ -64,87 +26,6 @@ echo "$(date): running $1 hooks." -@@ -80,14 +84,14 @@ - let filen-- - file="${filea[$filen]}" - if [ -x $file ]; then -- echo "$i" -+ echo "===== current hook: $file =====" - $file $1 - fi - done - else - for file in $files ; do - if [ -x $file ]; then -- echo "$i" -+ echo "===== current hook: $file =====" - $file $1 - fi - done -@@ -113,24 +117,59 @@ - return $RETVAL - } - -+do_suspend() -+{ -+ RETVAL=0 -+ if [ -x /usr/sbin/s2ram ]; then -+ /usr/sbin/s2ram $S2RAM_OPTS -+ else -+ echo -n "mem" > /sys/power/state -+ fi -+} -+ - pm_main() - { - if [ -n "$LOGFILE" ]; then - [ -f "$LOGFILE" ] && rm -f "$LOGFILE" - touch "$LOGFILE" - fi -+ [ -n "$LOGFILE" ] && exec > $LOGFILE 2>&1 -+ - take_suspend_lock || exit 1 -+ rm -f $INHIBIT -+ - run_hooks "$1" - sync ; sync ; sync - -+ [ -e /etc/pm/config.d/$1 ] && . /etc/pm/config.d/$1 -+ - case "$1" in - suspend) -- pm-pmu --suspend || echo -n "mem" > /sys/power/state -- run_hooks resume reverse -+ if [ ! -e $INHIBIT ]; then -+ pm-pmu --suspend || do_suspend -+ run_hooks resume reverse -+ fi -+ - ;; - hibernate) -- echo -n "platform" > /sys/power/disk -- echo -n "disk" > /sys/power/state -+ if [ -z "$HIBERNATE" ]; then -+ if [ -x $S2DISK_BIN -a -c /dev/snapshot ]; then -+ HIBERNATE="userspace" -+ else -+ HIBERNATE="kernel" -+ fi -+ fi -+ if [ ! -e $INHIBIT ]; then -+ case $HIBERNATE in -+ userspace) -+ $S2DISK_BIN -f $S2DISK_CONF -+ ;; -+ kernel) -+ echo -n "platform" > /sys/power/disk -+ echo -n "disk" > /sys/power/state -+ ;; -+ esac -+ fi - run_hooks thaw reverse - ;; - esac --- pm/hooks/50modules +++ pm/hooks/50modules @@ -6,6 +6,7 @@ @@ -170,7 +51,7 @@ savestate ${x}_governor $(cat $x/cpufreq/scaling_governor) - sh -c "echo userspace > $x/cpufreq/scaling_governor" >/dev/null 2>&1 -+ sh -c "echo performance > $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.20061024.tar.gz -> pm-utils-0.20.0.20061030.tar.gz ++++++ ++++ 8948 lines of diff (skipped) ++++++ pm-utils-fix-running-hooks-output.diff ++++++ Index: pm/functions =================================================================== RCS file: /cvs/pm-utils/pm-utils/pm/functions,v retrieving revision 1.26 diff -u -p -r1.26 functions --- pm/functions 30 Oct 2006 15:40:42 -0000 1.26 +++ pm/functions 30 Oct 2006 20:05:33 -0000 @@ -80,14 +80,14 @@ run_hooks() let filen-- file="${filea[$filen]}" if [ -x $file ]; then - echo "$i" + echo "===== current hook: $file =====" $file $1 fi done else for file in $files ; do if [ -x $file ]; then - echo "$i" + echo "===== current hook: $file =====" $file $1 fi done ++++++ pm-utils-fix-source-configs.diff ++++++ Index: pm/functions =================================================================== RCS file: /cvs/pm-utils/pm-utils/pm/functions,v retrieving revision 1.26 diff -u -p -r1.26 functions --- pm/functions 30 Oct 2006 15:40:42 -0000 1.26 +++ pm/functions 30 Oct 2006 20:06:50 -0000 @@ -24,16 +24,15 @@ add_global PM_LOGFILE source_configs() { - for cfg in $(ls -1 /etc/pm/config.d/* 2>/dev/null) ; do - [[ "$cfg" =~ ".*~$" ]] && continue - STR=". $cfg" - for v in $GLOBAL_CONFIG_VARIABLES ; do - STR="$STR ; echo x_$v=\"\$(eval echo \$$v)\"" - done - eval $(bash -c "$STR") - for v in $GLOBAL_CONFIG_VARIABLES ; do - eval $v="$(eval echo $(eval echo \$$v) \$x_$v)" - done + cfgs="/etc/pm/config.d/*[^~]" + for cfg in $cfgs ; do + [ -x $cfg ] || continue + while read LINE ; do + case "$GLOBAL_CONFIG_VARIABLES " in + *" ${LINE%=*} "*) continue ;; + *) eval $LINE ;; + esac + done < $cfg done } ++++++ pm-utils-uswsusp-support.diff ++++++ Index: pm/functions =================================================================== RCS file: /cvs/pm-utils/pm-utils/pm/functions,v retrieving revision 1.26 diff -u -p -r1.26 functions --- pm/functions 30 Oct 2006 15:40:42 -0000 1.26 +++ pm/functions 30 Oct 2006 21:20:36 -0000 @@ -4,9 +4,13 @@ export PATH=/sbin:/usr/sbin:/bin:/usr/bi # default values go here HIBERNATE_RESUME_POST_VIDEO=no +HIBERNATE_METHOD="" SUSPEND_MODULES="" RESUME_MODULES="" PM_LOGFILE=${PM_LOGFILE:=/var/log/pm-suspend.log} +INHIBIT=/var/run/pm-utils.inhibit +S2DISK_BIN=/usr/sbin/s2disk +S2DISK_CONF=/var/lib/s2disk.conf [ -f /etc/pm/config ] && . /etc/pm/config @@ -18,9 +22,13 @@ add_global() { # export them all here add_global HIBERNATE_RESUME_POST_VIDEO +add_global HIBERNATE_METHOD add_global SUSPEND_MODULES add_global RESUME_MODULES add_global PM_LOGFILE +add_global INHIBIT +add_global S2DISK_BIN +add_global S2DISK_CONF source_configs() { @@ -113,6 +121,35 @@ get_power_status() return $RETVAL } +do_suspend() +{ + if [ -x /usr/sbin/s2ram ]; then + /usr/sbin/s2ram $S2RAM_OPTS + else + echo -n "mem" > /sys/power/state + fi +} + +do_hibernate() +{ + 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 +} + pm_main() { if [ -n "$PM_LOGFILE" ]; then @@ -120,17 +157,23 @@ pm_main() exec > "$PM_LOGFILE" 2>&1 fi take_suspend_lock || exit 1 + + rm -f $INHIBIT + run_hooks "$1" sync ; sync ; sync case "$1" in suspend) - pm-pmu --suspend || echo -n "mem" > /sys/power/state + if [ ! -e $INHIBIT ]; then + pm-pmu --suspend || do_suspend + fi run_hooks resume reverse ;; hibernate) - echo -n "platform" > /sys/power/disk - echo -n "disk" > /sys/power/state + if [ ! -e $INHIBIT ]; then + do_hibernate + fi run_hooks thaw reverse ;; esac ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org