SOURCES: hal-tools.patch (NEW) - drop distro specific stuff and ch...

freetz freetz at pld-linux.org
Sun Mar 12 19:52:49 CET 2006


Author: freetz                       Date: Sun Mar 12 18:52:49 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- drop distro specific stuff and check for installed things

---- Files affected:
SOURCES:
   hal-tools.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/hal-tools.patch
diff -u /dev/null SOURCES/hal-tools.patch:1.1
--- /dev/null	Sun Mar 12 19:52:49 2006
+++ SOURCES/hal-tools.patch	Sun Mar 12 19:52:44 2006
@@ -0,0 +1,175 @@
+diff -aurN hal-0.5.7.orig/tools/hal-system-power-hibernate hal-0.5.7/tools/hal-system-power-hibernate
+--- hal-0.5.7.orig/tools/hal-system-power-hibernate	2006-01-16 13:47:40.000000000 +0100
++++ hal-0.5.7/tools/hal-system-power-hibernate	2006-03-12 19:34:20.647414496 +0100
+@@ -10,46 +10,19 @@
+ 	exit 1
+ }
+ 
+-#SuSE and ALTLinux only support powersave
+-if [ -f /etc/altlinux-release ] || [ -f "/etc/SuSE-release" ] ; then
+-	if [ -x /usr/bin/powersave ] ; then
+-	        $POWERSAVED_SUSPEND2DISK
+-		RET=$?
+-	else
+-		unsupported
+-	fi
+-
+-#RedHat/Fedora only support pm-utils
+-elif [ -f /etc/redhat-release ] || [ -f /etc/fedora-release ] ; then
+-	if [ -x /usr/sbin/pm-hibernate ] ; then
+-		/usr/sbin/pm-hibernate
+-		RET=$?
+-	else
+-		unsupported
+-	fi
+-
+-#Other distros just need to have *any* tools installed
++if [ -x "/usr/bin/powersave" ] ; then
++	$POWERSAVED_SUSPEND2DISK
++	RET=$?
++elif [ -x "/usr/sbin/hibernate" ] ; then
++	# Suspend2 tools installed
++	/usr/sbin/hibernate --force
++	RET=$?
++elif [ -w "/sys/power/state" ] ; then
++	# Use the raw kernel sysfs interface
++	echo "disk" > /sys/power/state
++	RET=$?
+ else
+-	if [ -x "/usr/bin/powersave" ] ; then
+-	        $POWERSAVED_SUSPEND2DISK
+-		RET=$?
+-	elif [ -x "/usr/sbin/pmi" ] ; then
+-		/usr/sbin/pmi action hibernate force
+-		RET=$?
+-	elif [ -x "/usr/sbin/pm-hibernate" ] ; then
+-		/usr/sbin/pm-hibernate
+-		RET=$?
+-	elif [ -x "/usr/sbin/hibernate" ] ; then
+-		# Suspend2 tools installed
+-		/usr/sbin/hibernate --force
+-		RET=$?
+-	elif [ -w "/sys/power/state" ] ; then
+-		# Use the raw kernel sysfs interface
+-		echo "disk" > /sys/power/state
+-		RET=$?
+-	else
+-		unsupported
+-		fi
+-	fi
++	unsupported
++fi
+ 
+ exit $RET
+diff -aurN hal-0.5.7.orig/tools/hal-system-power-set-power-save hal-0.5.7/tools/hal-system-power-set-power-save
+--- hal-0.5.7.orig/tools/hal-system-power-set-power-save	2005-11-29 18:47:54.000000000 +0100
++++ hal-0.5.7/tools/hal-system-power-set-power-save	2006-03-12 19:31:46.200893936 +0100
+@@ -7,38 +7,16 @@
+ 	exit 1
+ }
+ 
+-#SuSE and ALTLinux only support powersave
+-if [ -f /etc/altlinux-release ] || [ -f /etc/SuSE-release ] ; then
+-	if [ -x "/usr/bin/powersave" ] ; then
+-		if [ $value = "true" ]; then
+-			/usr/bin/powersave -e Powersave
+-			RET=$?
+-		elif [ $value = "false" ]; then
+-			/usr/bin/powersave -e Performance
+-			RET=$?
+-		fi
+-	else
+-		unsupported
++if [ -x "/usr/bin/powersave" ] ; then
++	if [ $value = "true" ]; then
++		/usr/bin/powersave -e Powersave
++		RET=$?
++	elif [ $value = "false" ]; then
++		/usr/bin/powersave -e Performance
++		RET=$?
+ 	fi
+-
+-#RedHat/Fedora only support pm-utils
+-elif [ -f /etc/redhat-release ] || [ -f /etc/fedora-release ] ; then
+-	if [ -x "/usr/sbin/pm-powersave" ] ; then
+-		if [ $value = "true" ]; then
+-			/usr/sbin/pm-powersave on
+-			RET=$?
+-		elif [ $value = "false" ]; then
+-			/usr/sbin/pm-powersave off
+-			RET=$?
+-		fi
+-	else
+-		unsupported
+-	fi
+-
+ else
+-	# cannot set proc stuff here, so error out
+ 	unsupported
+-	fi 
++fi
+ 
+ exit $RET
+-
+diff -aurN hal-0.5.7.orig/tools/hal-system-power-suspend hal-0.5.7/tools/hal-system-power-suspend
+--- hal-0.5.7.orig/tools/hal-system-power-suspend	2006-02-19 00:00:55.000000000 +0100
++++ hal-0.5.7/tools/hal-system-power-suspend	2006-03-12 19:33:01.498446968 +0100
+@@ -28,48 +28,16 @@
+ 	exit 0
+ fi
+ 
+-#SuSE and ALTLinux only support powersave
+-if [ -f "/etc/altlinux-release" ] || [ -f "/etc/SuSE-release" ] ; then
+-	if [ -x /usr/bin/powersave ] ; then
+-	        $POWERSAVED_SUSPEND2RAM
+-		RET=$?
+-	else
+-		# TODO: add support
+-		unsupported
+-	fi
+-
+-#RedHat/Fedora only support pm-utils
+-elif [ -f "/etc/redhat-release" ] || [ -f "/etc/fedora-release" ] ; then
+-	# TODO: fix pm-suspend to take a --wakeup-alarm argument
+-	if [ $seconds_to_sleep != "0" ] ; then
+-		alarm_not_supported
+-	fi
+-	# TODO: fixup pm-suspend to define erroc code (see alarm above) and throw
+-	#	   the appropriate exception
+-	if [ -x "/usr/sbin/pm-suspend" ] ; then
+-		/usr/sbin/pm-suspend
+-		RET=$?
+-	else
+-		# TODO: add support
+-		unsupported
+-	fi
+-
+-#Other distros just need to have *any* tools installed
++if [ -x "/usr/bin/powersave" ] ; then
++	$POWERSAVED_SUSPEND2RAM
++	RET=$?
++elif [ -w "/sys/power/state" ] ; then
++	# Use the raw kernel sysfs interface
++	echo "mem" > /sys/power/state
++	RET=$?
+ else
+-	if [ -x "/usr/bin/powersave" ] ; then
+-	    $POWERSAVED_SUSPEND2RAM
+-	    RET=$?
+-	elif [ -x "/usr/sbin/pmi" ] ; then
+-	    /usr/sbin/pmi action suspend force
+-	    RET=$?
+-	elif [ -w "/sys/power/state" ] ; then
+-	    # Use the raw kernel sysfs interface
+-	    echo "mem" > /sys/power/state
+-	    RET=$?
+-	else
+-	    # TODO: add other scripts support
+-	    unsupported
+-	    fi
+-	fi
++	# TODO: add other scripts support
++	unsupported
++fi
+ 
+ exit $RET
================================================================


More information about the pld-cvs-commit mailing list