File pm-utils-0.99.4-suse.diff of Package pm-utils

Index: pm-utils-0.99.4.20071229/pm/functions
===================================================================
--- pm-utils-0.99.4.20071229.orig/pm/functions
+++ pm-utils-0.99.4.20071229/pm/functions
@@ -10,13 +10,29 @@ export PATH=/sbin:/usr/sbin:/bin:/usr/bi
 # RESUME_MODULES
 #
 set -a
+### for compatibility with the other pm-utils project ###
+PM_UTILS_LIBDIR="/usr/lib/pm-utils"
+PM_UTILS_ETCDIR="/etc/pm"
+PM_UTILS_RUNDIR="/var/run/pm-utils"
+PATH=/sbin:/usr/sbin:/bin:/usr/bin:"${PM_UTILS_LIBDIR}"/bin
+#LOCKDIR="${PM_UTILS_RUNDIR}/locks"
+#STORAGEDIR="${PM_UTILS_RUNDIR}/${STASHNAME}/storage"
+NA=254
+NX=253
+DX=252
+PM_FUNCTIONS="$PM_UTILS_LIBDIR/functions"
+# Use c sort order
+LC_COLLATE=C
+PM_CMDLINE="$*"
+### end compatibility section ###########################
+
 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_CONF="/etc/suspend.conf"
-TEMPORARY_CPUFREQ_GOVERNOR="userspace"
+S2DISK_CONF="/var/lib/s2disk.conf"
+TEMPORARY_CPUFREQ_GOVERNOR="performance"
 
 [ -f /usr/lib/pm-utils/defaults ] && . /usr/lib/pm-utils/defaults
 set +a
@@ -41,7 +57,9 @@ source_configs
 take_suspend_lock()
 {
 	VT=$(fgconsole)
-	chvt 63
+	# don't switch console here, suspend tools are doing this anyway later
+	# on, and it looks better with splashy support
+	#chvt 63
 	if [ -f /.suspended ]; then
 		read pid < /.suspended
 		if [ -d /proc/$pid ]; then
@@ -56,9 +74,9 @@ take_suspend_lock()
 
 remove_suspend_lock()
 {
-	rm -f /var/run/pm-suspend
-	chvt 1
-	chvt $VT
+#	rm -f /var/run/pm-suspend
+	#chvt 1
+	#chvt $VT
 	openvt -- sh -c "usleep $1 ; rm -f /.suspended >/dev/null 2>&1 0<&1" >/dev/null 2>&1 0<&1 &
 }
 
@@ -81,9 +99,9 @@ run_hooks()
 	[ -z "$1" ] && return 0
 
 	[ -f /var/run/pm-suspend ] && . /var/run/pm-suspend
-	rm -f /var/run/pm-suspend
+#	rm -f /var/run/pm-suspend
 
-	echo "$(date): running '$1'/'$2'/'$3' hooks."
+	echo "$(date '+%F %T.%N %z'): running '$1'/'$2'/'$3' hooks."
 
 	files=$(find_sleepd_files)
 	if [ "$3" = "reverse" ]; then
@@ -92,17 +110,17 @@ run_hooks()
 		while [ "$filen" -gt 0 ]; do
 			let filen--
 			file="${filea[$filen]}"
-			echo "===== $(date): running hook: $file ====="
+			echo "===== $(date '+%F %T.%N') running hook: $file ====="
 			$file $2 $1
 		done
 	else
 		for file in $files ; do
-			echo "===== $(date): running hook: $file ====="
+			echo "===== $(date '+%F %T.%N') running hook: $file ====="
 			$file $2 $1
 		done
 	fi
 
-	echo "$(date): done running $1/$2 hooks."
+	echo "$(date '+%F %T.%N'): done running $1/$2 hooks."
 }
 
 get_power_status()
Index: pm-utils-0.99.4.20071229/pm/hooks/00clear
===================================================================
--- pm-utils-0.99.4.20071229.orig/pm/hooks/00clear
+++ pm-utils-0.99.4.20071229/pm/hooks/00clear
@@ -5,7 +5,7 @@
 RETVAL=0
 case "$1" in
 	hibernate|suspend)
-		TERM=linux openvt -w -s -f -c 63 -- clear >/dev/null 2>&1
+		TERM=linux openvt -w -f -c 63 -- echo -e "\033[H\033[JPreparing $1..." >/dev/null 2>&1
 		RETVAL=$?
 		;;
 	*)
Index: pm-utils-0.99.4.20071229/pm/hooks/50modules
===================================================================
--- pm-utils-0.99.4.20071229.orig/pm/hooks/50modules
+++ pm-utils-0.99.4.20071229/pm/hooks/50modules
@@ -6,6 +6,7 @@ suspend_modules()
 {
 	[ -z "$SUSPEND_MODULES" ] && return 0
 	for x in $SUSPEND_MODULES ; do
+		echo "trying to unload: $x"
 		modunload $x
 	done
 	return 0
@@ -15,6 +16,7 @@ resume_modules()
 {
 	[ -z "$RESUME_MODULES" ] && return 0
 	for x in $RESUME_MODULES ; do
+	 	echo "trying to reload: $x"
 		modprobe $x
 	done
 }
Index: pm-utils-0.99.4.20071229/src/pm-powersave
===================================================================
--- pm-utils-0.99.4.20071229.orig/src/pm-powersave
+++ pm-utils-0.99.4.20071229/src/pm-powersave
@@ -28,6 +28,9 @@
 # match any files
 shopt -s nullglob
 
+PM_POWERSAVE_LOGFILE="/var/log/pm-powersave.log"
+echo -n > $PM_POWERSAVE_LOGFILE
+
 find_powerd_files()
 {
 	flist="/etc/pm/power.d/*[^~] /usr/lib/pm-utils/power.d/*[^~]"
@@ -45,7 +48,7 @@ runpowerhooks()
 {
 	files=$(find_powerd_files)
 	for file in $files ; do
-		$file $1
+		$file $1 >> $PM_POWERSAVE_LOGFILE 2>&1
 	done
 }
 
@@ -57,3 +60,6 @@ else
     echo "Argument needs to be true or false" >&2
     exit 1
 fi
+
+cat $PM_POWERSAVE_LOGFILE
+
Index: pm-utils-0.99.4.20071229/src/pm-action
===================================================================
--- pm-utils-0.99.4.20071229.orig/src/pm-action
+++ pm-utils-0.99.4.20071229/src/pm-action
@@ -128,6 +128,8 @@ case "$ACTION" in
 		;;
 esac
 
+logger -i -t "pm-$METHOD" "Entering $METHOD. In case of problems, please check /var/log/pm-suspend.log"
+
 export PM_CMDLINE="$@"
 
 pm_main "$METHOD" "$ACTION" "$REVERSE"
Index: pm-utils-0.99.4.20071229/pm/defaults
===================================================================
--- pm-utils-0.99.4.20071229.orig/pm/defaults
+++ pm-utils-0.99.4.20071229/pm/defaults
@@ -46,3 +46,13 @@ SATA_PM="medium_power"
 # Specifies the timeout after a sound card enters a low power mode
 # Empty string is meant for not touching any power management features at all
 SOUND_PM="10"
+
+# Wake On LAN handling
+
+# Specifies if we should enable certain wake on LAN settings when running
+# on DC.
+# Possible values are: Flags which can be set through ethtool. Please see
+# the ethtool manpage for more information. Default is 'g', which means
+# "wake on magic packet" only.
+# Empty string is meant for not touching any wol features at all
+WOL="g"
openSUSE Build Service is sponsored by