[Debian-eeepc-commits] [SCM] Maintenance of eeepc-acpi-scripts debian package branch, master, updated. a003008367dc02c38b813c1a074889a4c7602705
Darren Salt
linux at youmustbejoking.demon.co.uk
Mon Feb 2 17:49:55 UTC 2009
The following commit has been merged in the master branch:
commit 8567b16896f1a22025ecb7ffe21b1b7640ec998f
Author: Darren Salt <linux at youmustbejoking.demon.co.uk>
Date: Wed Dec 3 15:05:18 2008 +0000
Use rfkill (where available) for toggling wireless & bluetooth.
diff --git a/debian/changelog b/debian/changelog
index 349cc68..4757fef 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ eeepc-acpi-scripts (1.0.12) UNRELEASED; urgency=low
with DISPLAY set in its environment.
This has a useful side effect: status changes can be displayed even when
the controlling process is a login manager.
+ * Try to use rfkill when toggling wireless & bluetooth.
-- Darren Salt <linux at youmustbejoking.demon.co.uk> Mon, 02 Feb 2009 16:55:55 +0000
diff --git a/etc/acpi/actions/wireless.sh b/etc/acpi/actions/wireless.sh
index 6e421f7..00a79af 100755
--- a/etc/acpi/actions/wireless.sh
+++ b/etc/acpi/actions/wireless.sh
@@ -2,7 +2,9 @@
. /usr/share/eeepc-acpi-scripts/functions.sh
-wlan_control=/sys/devices/platform/eeepc/wlan
+detect_rfkill eeepc-wlan
+wlan_control="$RFKILL"
+[ -e $wlan_control ] || wlan_control=/sys/devices/platform/eeepc/wlan # pre-2.6.28
[ -e $wlan_control ] || wlan_control=/proc/acpi/asus/wlan # pre-2.6.26
case $1 in
diff --git a/etc/acpi/lib/bluetooth.sh b/etc/acpi/lib/bluetooth.sh
index 6774906..5c5aead 100755
--- a/etc/acpi/lib/bluetooth.sh
+++ b/etc/acpi/lib/bluetooth.sh
@@ -2,7 +2,9 @@
#
# to be sourced
-BT_CTL=/sys/devices/platform/eeepc/bluetooth
+rfkill_detect eeepc-bluetooth
+BT_CTL="$RFKILL"
+[ -e $BT_CTL ] || BT_CTL=/sys/devices/platform/eeepc/bluetooth # pre-2.6.28
[ -e $BT_CTL ] || BT_CTL=/proc/acpi/asus/bluetooth # pre-2.6.26
# check if bluetooth is switched on and return success (exit code 0 if it is
# return failure (exit code 1) if it is not
diff --git a/functions.sh b/functions.sh
index 655be91..dad8f34 100644
--- a/functions.sh
+++ b/functions.sh
@@ -14,6 +14,20 @@ detect_wlan()
echo "Detected WLAN module $WLAN_MOD on $WLAN_IF" >&2
}
+# detect which rfkill has name=$1
+detect_rfkill()
+{
+ local _rfkill
+ for _rfkill in /sys/class/rfkill/*; do
+ if [ "$(cat "$_rfkill/name")" = "$1" ]; then
+ echo "Detected $1 as rfkill $_rfkill" >&2
+ RFKILL="$_rfkill/state"
+ return
+ fi
+ done
+ RFKILL=''
+}
+
detect_x_display()
{
local _user
--
Maintenance of eeepc-acpi-scripts debian package
More information about the Debian-eeepc-commits
mailing list