[Debian-eeepc-commits] [SCM] Maintenance of eeepc-acpi-scripts debian package branch, rfkill, updated. 1.1.5-17-g089d81a

Darren Salt linux at youmustbejoking.demon.co.uk
Mon Jan 4 14:27:08 UTC 2010


The following commit has been merged in the rfkill branch:
commit 089d81a3cac2c9cce54c6f405cf5b388748e536b
Merge: 6688c2651a685dcf409f7cd8267e3ea410adada6 32d546fa20b8cdee566236f0489e98688e47b655
Author: Darren Salt <linux at youmustbejoking.demon.co.uk>
Date:   Mon Jan 4 02:52:30 2010 +0000

    Merge branch 'rfkill'
    
    Conflicts:
    	debian/changelog
    	debian/control
    	etc/acpi/actions/wireless.sh
    	functions.sh

diff --combined debian/changelog
index 6754d85,4acc7ef..8fd0873
--- a/debian/changelog
+++ b/debian/changelog
@@@ -1,93 -1,4 +1,97 @@@
 -eeepc-acpi-scripts (1.1.2) UNRELEASED; urgency=low
 +eeepc-acpi-scripts (1.1.7) UNRELEASED; urgency=low
 +
 +  [ Damyan Ivanov ]
 +  * add a hook in /etc/pm/sleep.d that switches off wlan on suspend on models
 +    using RT2860
 +
++  [ Darren Salt ]
++  * Abstract out rfkill setting & getting, ready for eventual use of
++    /dev/rfkill.
++
 + -- Darren Salt <linux at youmustbejoking.demon.co.uk>  Fri, 01 Jan 2010 21:16:09 +0000
 +
 +eeepc-acpi-scripts (1.1.6) unstable; urgency=low
 +
 +  * Add support for ACPI button/* and video/* events. (Closes: #562166)
 +    - It is possible that only these will be reported, but it is also
 +      possible that both these and hotkey events will be reported; and there
 +      are keys for which only hotkey events are reported (it is expected
 +      that this will change).
 +    - This is incomplete: no known button or video events for Fn-F3 & Fn-F7.
 +    - There is one button/* event which is reported for two different keys,
 +      fortunately on different models. Disambiguation is done via the
 +      product name (requires DMI support, which is normally enabled).
 +  * Add support for the S.H.E. button on some models, e.g. 1002HA.
 +    - This is incomplete: no known button event.
 +  * Have the audio keys affect the 'Master' mixer control by default. This
 +    has a side effect: the 'Beep' control is effectively muted when 'Master'
 +    is muted.
 +  * Fix bugs which prevent touchpad toggling from working (synclient has
 +    lost -s at some point), and don't report anything if toggling failed.
 +
 + -- Darren Salt <linux at youmustbejoking.demon.co.uk>  Fri, 01 Jan 2010 20:05:10 +0000
 +
 +eeepc-acpi-scripts (1.1.5) unstable; urgency=high
 +
 +  [ Darren Salt ]
 +  * Fix Super Hybrid Engine support breakage in 1.1.4.
 +    A missing "[" caused the AC-adaptor-unplugged code to fail; consequently,
 +    the preferred running-on-battery mode (the default being underclocked)
 +    would not be selected.
 +  * Set urgency=high (for documentation reasons; due to 1.1.4).
 +  * Add myself to Uploaders.
 +
 +  [ Damyan Ivanov ]
 +  * add DMUA flag
 +  * rules: add small test suite for all shell scripts
 +
 + -- Damyan Ivanov <dmn at debian.org>  Fri, 18 Dec 2009 07:38:14 +0200
 +
 +eeepc-acpi-scripts (1.1.4) unstable; urgency=low
 +
 +  * rules: when stripping comments from /etc/default/eeepc-acpi-scripts, also
 +    remove lines consisting solely of '#'
 +  * when changing Super Hybrid Engine modes, ignore models 701 and 702 which
 +    don't officially support S.H.E. (Closes: #559578)
 +    Additionally provide a variable in the default file to override the ignore
 +
 + -- Damyan Ivanov <dmn at debian.org>  Wed, 16 Dec 2009 22:56:18 +0200
 +
 +eeepc-acpi-scripts (1.1.3) unstable; urgency=low
 +
 +  [ Darren Salt ]
 +  * Init script fixups for when /etc/default/eeepc-acpi-scripts is missing;
 +    ensure that we default to "automatic" for our S.H.E. handling. 
 +  * Belatedly bump acpid version requirement. (Closes: #550119)
 +  * Bring the copyright file up to date.
 +  * Allow setting of whether the super hybrid engine control defaults to
 +    manual or auto.
 +  * Strip out comments from /etc/default/eeepc-acpi-scripts and store a
 +    fully-commented copy in /usr/share/doc/eeepc-acpi-scripts/examples/.
 +  * Add configuration support for Fn-F4 on 10" models. No action is defined.
 +  * Make VGA toggling into a bindable function.
 +  * Fix a bug which prevented touchpad toggling from working properly.
 +
 +  [ Damyan Ivanov ]
 +  * rules: call dh_installinit with -u'start 20 S .' to prevent
 +    installing stop init.d symlinks as eeepc-acpi-scripts init.d script
 +    doesn't need to be run during system shutdown
 +  * postinst: remove and re-install rc.d configuration
 +    fixing insserv warning about discrepancy between LSB init.d headers and
 +    the real situation. Thanks to Paul Menzel for reporting and Raphael
 +    Geissert for the fix.
 +  * hotkey.sh/wireless.sh/functions.sh: wake up wicd on switching WiFi on
 +  * Standards-Version: 3.8.3 (no changes necessary)
 +
 +  [ Andreas Schreiner ]
 +  * Fix WLAN toggle using fn-F2 on EeePC 900A. This EeePC model needs to
 +    load the pciehp kernel module with the pciehp_force=1 option up to kernel
 +    version 2.6.32. /etc/init.d/eeepc-acpi-script now checks if it is running
 +    on a 900A and loads the module accordingly.
 +
 + -- Damyan Ivanov <dmn at debian.org>  Thu, 03 Dec 2009 20:53:05 +0200
 +
 +eeepc-acpi-scripts (1.1.2) unstable; urgency=low
  
    [ Darren Salt ]
    * Add support for the 'super hybrid engine', which is accessible in kernel
@@@ -95,26 -6,14 +99,26 @@@
      downclocking when on battery (default is fastest/slowest).
    * Add an option for preferring to use the 'Master' control for volume
      control & muting. Off by default; normally takes effect while booting.
 -  * Abstract out rfkill setting & getting, ready for eventual use of
 -    /dev/rfkill.
 +  * Don't run the init script on installation or upgrade; just while
 +    booting. This avoids altering current settings.
 +  * Make touchpad toggling into a bindable function.
 +  * Blacklist i2c_i801 (not needed, causes a long boot delay).
  
    [ Thiemo Nagel ]
 +  * Add support for GSM (3G) toggling, automatically chosing between rfkill
 +    and USB methods.
    * spelling fix in the default file
    * fix actions/wireless.sh usage message
  
 - -- Darren Salt <linux at youmustbejoking.demon.co.uk>  Thu, 09 Jul 2009 22:56:19 +0100
 +  [ Damyan Ivanov ]
 +  * functions.sh: run screensaver-command as the logged in user
 +
 +  [ Alan Jenkins ]
 +  * Remove old hacks for wireless toggle key
 +    There is no need to load/unload modules and ifconfig up/down the wireless
 +    interface. PCI hotplug takes care of it.
 +
 + -- Damyan Ivanov <dmn at debian.org>  Fri, 14 Aug 2009 14:52:18 +0300
  
  eeepc-acpi-scripts (1.1.1) unstable; urgency=low
  
diff --combined debian/control
index 8da612e,5ee59bc..314e693
--- a/debian/control
+++ b/debian/control
@@@ -4,18 -4,16 +4,18 @@@ Priority: extr
  Maintainer: Debian Eee PC Team <debian-eeepc-devel at lists.alioth.debian.org>
  Uploaders: Ben Armstrong <synrg at sanctuary.nslug.ns.ca>,
   Nico Golde <nion at debian.org>, Damyan Ivanov <dmn at debian.org>,
 + Darren Salt <linux at youmustbejoking.demon.co.uk>,
   Raphael Geissert <geissert at debian.org>
  Build-Depends: debhelper (>= 6)
 -Standards-Version: 3.8.2
 +Standards-Version: 3.8.3
  Vcs-Git: git://git.debian.org/git/debian-eeepc/eeepc-acpi-scripts.git
  Vcs-Browser: http://git.debian.org/?p=debian-eeepc/eeepc-acpi-scripts.git
 +DM-Upload-Allowed: yes
  
  Package: eeepc-acpi-scripts
  Architecture: all
  Conflicts: acpi-support
- Depends: acpid (>= 1.0.8-6), acpi-support-base, pm-utils
 -Depends: acpid (>= 1.0.4), acpi-support-base, pm-utils, rfkill
++Depends: acpid (>= 1.0.8-6), acpi-support-base, pm-utils, rfkill
  Recommends: alsa-utils
  Suggests: aosd-cat, ttf-dejavu | ttf-bitstream-vera | ttf-freefont
   | gsfonts-x11 | ttf-mscorefonts-installer | ttf-liberation,
diff --combined etc/acpi/actions/wireless.sh
index 848c116,168f9dc..782ba86
--- a/etc/acpi/actions/wireless.sh
+++ b/etc/acpi/actions/wireless.sh
@@@ -2,14 -2,16 +2,16 @@@
  
  . /usr/share/eeepc-acpi-scripts/functions.sh
  
- detect_rfkill eeepc-wlan
+ detect_rfkill eeepc-wlan wlan
  wlan_control="$RFKILL"
  
- [ -n "$wlan_control" -a -e $wlan_control ] \
+ if ! have_dev_rfkill; then
+   [ -n "$wlan_control" -a -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
+   [ -e "$wlan_control" ] || wlan_control=/proc/acpi/asus/wlan # pre-2.6.26
+ fi
  
- STATE="$(cat $wlan_control)"
+ STATE="$(get_rfkill "$wlan_control")"
  
  cmd="$1"
  if [ "$cmd" = toggle ]; then
@@@ -22,13 -24,26 +24,13 @@@ case "$cmd" i
  	;;
      on|enable|1)
  	if [ "$STATE" = 0 ]; then
- 	    echo 1 > $wlan_control
+ 	    set_rfkill "$wlan_control" 1
 -            detect_wlan
 -	    if [ "$WLAN_MOD" = 'ath_pci' ] || [ "$WLAN_MOD" = 'ath5k' ]; then
 -		# Atheros needs some handholding
 -		modprobe $WLAN_MOD
 -		# adding a sleep here, due to some bug the driver loading is not atomic here
 -		# and could cause ifconfig to fail (at least madwifi, untested with ath5k)
 -		sleep 1
 -		if ! ifconfig $WLAN_IF up; then exec $0 off; fi
 -	    fi
 +            wakeup_wicd
  	fi
  	;;
      off|disable|0)
  	if [ "$STATE" = 1 ]; then
- 	    echo 0 > $wlan_control
 -            detect_wlan
 -	    if [ "$WLAN_MOD" = 'ath_pci' ] || [ "$WLAN_MOD" = 'ath5k' ]; then
 -		ifdown --force $WLAN_IF
 -		modprobe -r $WLAN_MOD
 -	    fi
+ 	    set_rfkill "$wlan_control" 0
  	fi
  	;;
      *)
diff --combined functions.sh
index 375564d,e0b6a42..0c30a67
--- a/functions.sh
+++ b/functions.sh
@@@ -1,19 -1,80 +1,62 @@@
  # common eeepc-acpi-scripts functions
  
 -# detect the name of the WLAN interface and kernel module
 -detect_wlan()
 -{
 -    if lspci|grep -i 'network controller'|grep -q 'RaLink'; then
 -        WLAN_IF=ra0
 -        WLAN_MOD=rt2860sta
 -    elif lspci|grep -i 'atheros'|grep -q -i 'wireless'; then
 -        if lspci -v|grep -q -i 'ath_pci'; then
 -            WLAN_IF=ath0
 -            WLAN_MOD=ath_pci
 -        else
 -            WLAN_IF=wlan0
 -            WLAN_MOD=ath5k
 -        fi
 -    fi
 -
 -    echo "Detected WLAN module $WLAN_MOD on $WLAN_IF" >&2
 -}
 -
 +# detect which rfkill has name=$1
- detect_rfkill()
+ have_dev_rfkill()
  {
-     local _rfkill
-     for _rfkill in /sys/class/rfkill/*; do
-         if [ -f "$_rfkill/name" ] && [ "$(cat "$_rfkill/name")" = "$1" ]; then
-             echo "Detected $1 as rfkill $_rfkill" >&2
-             RFKILL="$_rfkill/state"
-             return
-         fi
-     done
-     RFKILL=''
+   [ -c /dev/rfkill ]
  }
  
+ if have_dev_rfkill; then
+     # detect which rfkill has name=$1
+     detect_rfkill()
+     {
+ 	RFKILL=''
+ 	if rfkill list | grep -q "$1:"; then
+ 	    RFKILL="${2:-1}"
+ 	fi
+     }
+ 
+     get_rfkill()
+     {
+ 	# simple yes/no, so...
+ 	expr length "$(rfkill list | sed -e '/bluetooth:/! d; N; s/.*://')" - 2
+     }
+ 
+     set_rfkill()
+     {
+ 	if [ "$2" = 0 ]; then
+ 	    rfkill block "$1"
+ 	else
+ 	    rfkill unblock "$1"
+ 	fi
+     }
+ else # we have no /dev/rfkill
+ 
+     # detect which rfkill has name=$1
+     detect_rfkill()
+     {
+ 	local _rfkill
+ 	for _rfkill in /sys/class/rfkill/*; do
+ 	    if [ -f "$_rfkill/name" ] && [ "$(cat "$_rfkill/name")" = "$1" ]; then
+ 		echo "Detected $1 as rfkill $_rfkill" >&2
+ 		RFKILL="$_rfkill/state"
+ 		return
+ 	    fi
+ 	done
+ 	RFKILL=''
+     }
+ 
+     get_rfkill()
+     {
+ 	cat "$1"
+     }
+ 
+     set_rfkill()
+     {
+ 	echo "$2" > "$1"
+     }
+ fi
+ 
  detect_x_display()
  {
      local _user
@@@ -60,7 -121,7 +103,7 @@@ lock_x_screen(
              for ss in xscreensaver gnome-screensaver; do
                  [ -x /usr/bin/$ss-command ] \
                      && pidof /usr/bin/$ss > /dev/null \
 -                    && $ss-command --lock
 +                    && su - "$user" -c "DISPLAY=$(shell_quote "$DISPLAY") XAUTHORITY=$(shell_quote "$XAUTHORITY") $ss-command --lock"
              done
              # try locking KDE
              if [ -x /usr/bin/dcop ]; then
@@@ -70,10 -131,3 +113,10 @@@
          fi
      fi
  }
 +
 +wakeup_wicd() {
 +    WICD_WAKEUP=/usr/share/wicd/autoconnect.py
 +    if [ -x $WICD_WAKEUP ]; then
 +        $WICD_WAKEUP
 +    fi
 +}

-- 
Maintenance of eeepc-acpi-scripts debian package



More information about the Debian-eeepc-commits mailing list