hal/tools hal-system-power-hibernate,1.2,1.3

Richard Hughes hughsient at freedesktop.org
Mon Sep 12 08:27:45 PDT 2005


Update of /cvs/hal/hal/tools
In directory gabe:/tmp/cvs-serv25476

Modified Files:
	hal-system-power-hibernate 
Log Message:
Add suspend2 functionality for mandrake, gentoo, slackware and debian.

Index: hal-system-power-hibernate
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-power-hibernate,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hal-system-power-hibernate	19 Aug 2005 12:33:48 -0000	1.2
+++ hal-system-power-hibernate	12 Sep 2005 15:27:43 -0000	1.3
@@ -12,7 +12,6 @@
     exit 1
 }
 
-
 if [ -f /etc/altlinux-release ] ; then
     if [ -x /usr/bin/powersave ] ; then
         /usr/bin/powersave --suspend-to-disk
@@ -28,20 +27,44 @@
     /usr/bin/powersave --suspend-to-disk
     RET=$?
 elif [ -f /etc/mandrake-release ] ; then
-    # TODO: add support
-    unsupported
+    # Try to use hibernate2 (if user has installed tools)
+    if [ -x /usr/sbin/hibernate ] ; then
+        /usr/sbin/hibernate --force
+        RET=$?
+    else
+        # TODO: add distro specific support
+        unsupported
 elif [ -f /etc/gentoo-release ] ; then
-    # TODO: add support
-    unsupported
+    # Try to use hibernate2 (if user has installed tools)
+    if [ -x /usr/sbin/hibernate ] ; then
+        /usr/sbin/hibernate --force
+        RET=$?
+    else
+        # TODO: add distro specific support
+        unsupported
 elif [ -f /etc/slackware-version ] ; then
-    # TODO: add support
-    unsupported
+    # Try to use hibernate2 (if user has installed tools)
+    if [ -x /usr/sbin/hibernate ] ; then
+        /usr/sbin/hibernate --force
+        RET=$?
+    else
+        # TODO: add distro specific support
 elif [ -f /etc/debian_version ] ; then
-    # TODO: add support
-    unsupported
+    # Try to use hibernate2 (if user has installed tools)
+    if [ -x /usr/sbin/hibernate ] ; then
+        /usr/sbin/hibernate --force
+        RET=$?
+    else
+        # TODO: add distro specific support
+        unsupported
 else
-    # TODO: support other distros
-    unknown_distro
+    # Try to use hibernate2 (if user has installed tools)
+    if [ -x /usr/sbin/hibernate ] ; then
+        /usr/sbin/hibernate --force
+        RET=$?
+    else
+        # TODO: add distro specific support
+        unknown_distro
 fi 
 
 exit $RET




More information about the hal-commit mailing list