hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Mon Nov 12 10:49:05 PST 2007


 tools/linux/hal-system-killswitch-get-power-linux |   15 +++++++++++----
 tools/linux/hal-system-killswitch-set-power-linux |   19 +++++++++++++------
 2 files changed, 24 insertions(+), 10 deletions(-)

New commits:
commit 64e4ac8ff8570f315c6a99cdf6d221ba845dcf5a
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Mon Nov 12 19:48:59 2007 +0100

    fix hal to work with libsmbios v0.13.12
    
    Fixed HAL to work again with libsmbios v0.13.12 where the binaries
    get moved from /usr/bin/ to /usr/sbin/. Needed to change some paths
    in hal-system-killswitch-{g,s}et-power-linux to work with the new
    and older versions correctly.

diff --git a/tools/linux/hal-system-killswitch-get-power-linux b/tools/linux/hal-system-killswitch-get-power-linux
index f19d1f4..c24253f 100755
--- a/tools/linux/hal-system-killswitch-get-power-linux
+++ b/tools/linux/hal-system-killswitch-get-power-linux
@@ -8,6 +8,13 @@
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 
+if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" ]; then
+    DELL_WCTL=/usr/bin/dellWirelessCtl
+    if [ -x /usr/sbin/dellWirelessCtl ]; then
+        DELL_WCTL=/usr/sbin/dellWirelessCtl
+    fi
+fi
+
 if [ "$HAL_PROP_KILLSWITCH_TYPE" = "bluetooth" ]; then
     if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "sonypic" ]; then
 	value="`hal-system-sonypic getbluetooth`"
@@ -17,9 +24,9 @@ if [ "$HAL_PROP_KILLSWITCH_TYPE" = "bluetooth" ]; then
 	    exit 1
 	fi
 	exit ${value}
-    elif [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" -a -x /usr/bin/dellWirelessCtl ]; then
+    elif [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" -a -x $DELL_WCTL ]; then
 	# TODO: write our own binary that links with libsmbios?
-	/usr/bin/dellWirelessCtl --st_bt
+	$DELL_WCTL --st_bt
 	value=$?
 	if [ "$value" = "0" ]; then
 	    exit 1
@@ -35,9 +42,9 @@ if [ "$HAL_PROP_KILLSWITCH_TYPE" = "bluetooth" ]; then
 	exit 1
     fi
 elif [ "$HAL_PROP_KILLSWITCH_TYPE" = "wlan" ]; then
-    if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" -a -x /usr/bin/dellWirelessCtl ]; then
+    if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" -a -x $DELL_WCTL ]; then
 	# TODO: write our own binary that links with libsmbios?
-	/usr/bin/dellWirelessCtl --st_wlan
+	$DELL_WCTL --st_wlan
 	value=$?
 	if [ "$value" = "0" ]; then
 	    exit 1
diff --git a/tools/linux/hal-system-killswitch-set-power-linux b/tools/linux/hal-system-killswitch-set-power-linux
index 85a4548..2ef9ebe 100755
--- a/tools/linux/hal-system-killswitch-set-power-linux
+++ b/tools/linux/hal-system-killswitch-set-power-linux
@@ -8,6 +8,13 @@
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 
+if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" ]; then
+    DELL_WCTL=/usr/bin/dellWirelessCtl
+    if [ -x /usr/sbin/dellWirelessCtl ]; then
+        DELL_WCTL=/usr/sbin/dellWirelessCtl
+    fi
+fi
+
 if [ "$HAL_PROP_KILLSWITCH_TYPE" = "bluetooth" ]; then
     if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "sonypic" ]; then
 	hal-system-sonypic setbluetooth $value
@@ -16,16 +23,16 @@ if [ "$HAL_PROP_KILLSWITCH_TYPE" = "bluetooth" ]; then
 	    exit 1
 	fi
 	exit 0
-    elif [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" -a -x /usr/bin/dellWirelessCtl ]; then
+    elif [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" -a -x $DELL_WCTL ]; then
 
 	# As a side effect we disable the physical kill switch
 
 	# TODO: write our own binary that links with libsmbios?
 	if [ "$value" = "true" ]; then
-	    /usr/bin/dellWirelessCtl --sw_bt 0 --bt 1
+	    $DELL_WCTL --sw_bt 0 --bt 1
 	    ret=$?
 	else
-	    /usr/bin/dellWirelessCtl --sw_bt 0 --bt 0
+	    $DELL_WCTL --sw_bt 0 --bt 0
 	    ret=$?
 	fi
 	if [ "$ret" != "0" ]; then
@@ -38,16 +45,16 @@ if [ "$HAL_PROP_KILLSWITCH_TYPE" = "bluetooth" ]; then
 	exit 1
     fi
 elif [ "$HAL_PROP_KILLSWITCH_TYPE" = "wlan" ]; then
-    if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" -a -x /usr/bin/dellWirelessCtl ]; then
+    if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" -a -x $DELL_WCTL ]; then
 
 	# As a side effect we disable the physical kill switch
 
 	# TODO: write our own binary that links with libsmbios?
 	if [ "$value" = "true" ]; then
-	    /usr/bin/dellWirelessCtl --sw_wlan 0 --wlan 1
+	    $DELL_WCTL --sw_wlan 0 --wlan 1
 	    ret=$?
 	else
-	    /usr/bin/dellWirelessCtl --sw_wlan 0 --wlan 0
+	    $DELL_WCTL --sw_wlan 0 --wlan 0
 	    ret=$?
 	fi
 	if [ "$ret" != "0" ]; then


More information about the hal-commit mailing list