[Debian-eeepc-commits] [SCM] Maintenance of eeepc-acpi-scripts debian package branch, master, updated. 1.1.3-2-g618c8ec

Damyan Ivanov dmn at debian.org
Wed Dec 16 20:55:23 UTC 2009


The following commit has been merged in the master branch:
commit 618c8ec768b87e4389020b6c02c178f589d21142
Author: Damyan Ivanov <dmn at debian.org>
Date:   Wed Dec 16 22:53:03 2009 +0200

    ignore 701 and 702 when changing S.H.E. modes
    
    701 and 702 don't officially support S.H.E. (Closes: 559578)
    
    Additionally provide a variable in the default file to override the ignore

diff --git a/debian/changelog b/debian/changelog
index 16b491f..664ccd5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,9 @@ eeepc-acpi-scripts (1.1.4) UNRELEASED; 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 21:34:59 +0200
 
diff --git a/debian/eeepc-acpi-scripts.default.in b/debian/eeepc-acpi-scripts.default.in
index 76519d8..3836543 100644
--- a/debian/eeepc-acpi-scripts.default.in
+++ b/debian/eeepc-acpi-scripts.default.in
@@ -149,3 +149,6 @@ PWR_CLOCK_BATTERY=
 # file is missing (which, initially, it will be); if you don't, "auto" mode
 # will be chosen for you.
 #DEFAULT_SHENGINE_CONFIG=manual
+# Set the following to '1' to force usage of S.H.E. even on models that don't
+# officialy support it. The default is '0'
+#SHENGINE_FORCE_ENABLE=0
diff --git a/debian/eeepc-acpi-scripts.init b/debian/eeepc-acpi-scripts.init
index c62af37..81cab4c 100644
--- a/debian/eeepc-acpi-scripts.init
+++ b/debian/eeepc-acpi-scripts.init
@@ -105,15 +105,19 @@ case "$1" in
 	    . /etc/default/eeepc-acpi-scripts
 	fi
 	. /etc/acpi/lib/shengine.sh
-	if [ "${SHENGINE_SETTING:-auto}" != auto ]; then
-	    log_action_cont_msg '(manual)'
-	elif [ "$(cat /sys/class/power_supply/AC0/online 2>/dev/null)" = 0 ]; then
-	    log_action_cont_msg '(battery)'
-	    set_shengine "${PWR_CLOCK_BATTERY:-$(($SHENGINE_LIMIT - 1))}" || :
-	else
-	    log_action_cont_msg '(AC)'
-	    set_shengine "${PWR_CLOCK_AC:-0}" || :
-	fi
+        if shengine_supported; then
+            if [ "${SHENGINE_SETTING:-auto}" != auto ]; then
+                log_action_cont_msg '(manual)'
+            elif [ "$(cat /sys/class/power_supply/AC0/online 2>/dev/null)" = 0 ]; then
+                log_action_cont_msg '(battery)'
+                set_shengine "${PWR_CLOCK_BATTERY:-$(($SHENGINE_LIMIT - 1))}" || :
+            else
+                log_action_cont_msg '(AC)'
+                set_shengine "${PWR_CLOCK_AC:-0}" || :
+            fi
+        else
+            log_action_cont_msg '(model not supported)'
+        fi
 	log_action_end_msg $?
     fi
     ;;
diff --git a/etc/acpi/actions/ac_adapter.sh b/etc/acpi/actions/ac_adapter.sh
index df1448a..350ab5f 100755
--- a/etc/acpi/actions/ac_adapter.sh
+++ b/etc/acpi/actions/ac_adapter.sh
@@ -22,7 +22,7 @@ case "$code" in
     # AC adapter present
     0000008[01]\ 00000001)
 	. /etc/acpi/lib/shengine.sh
-	if [ "${SHENGINE_SETTING:-auto}" = auto ]; then
+	if shengine_supported && [ "${SHENGINE_SETTING:-auto}" = auto ]; then
 	    PWR_CLOCK_AC="${PWR_CLOCK_AC:-0}"
 	    if [ $(get_shengine -) -gt "$PWR_CLOCK_AC" ]; then
 		handle_shengine "$PWR_CLOCK_AC" -
@@ -33,7 +33,7 @@ case "$code" in
     # AC adapter not present
     0000008[01]\ 00000000)
 	. /etc/acpi/lib/shengine.sh
-	if [ "${SHENGINE_SETTING:-auto}" = auto ]; then
+	if shengine_supported &&  "${SHENGINE_SETTING:-auto}" = auto ]; then
 	    PWR_CLOCK_BATTERY="${PWR_CLOCK_BATTERY:-$(($SHENGINE_LIMIT - 1))}"
 	    if [ $(get_shengine -) -lt "$PWR_CLOCK_BATTERY" ]; then
 		handle_shengine "$PWR_CLOCK_BATTERY" -
diff --git a/etc/acpi/lib/shengine.sh b/etc/acpi/lib/shengine.sh
index 54bb436..3763dec 100644
--- a/etc/acpi/lib/shengine.sh
+++ b/etc/acpi/lib/shengine.sh
@@ -76,3 +76,15 @@ handle_shengine() {
 	notify error 'S. H. Engine unavailable'
     fi
 }
+
+shengine_supported()
+{
+    local model
+    model=`cat /sys/class/dmi/id/product_name`
+
+    [ "${SHENGINE_FORCE_ENABLE:-0}" = "1" ] && return 0
+
+    # models 701 and 702 are not supported
+    # see http://bugs.debian.org/559578
+    ! [ "$model" = '701' -o "$model" = '702' ]
+}

-- 
Maintenance of eeepc-acpi-scripts debian package



More information about the Debian-eeepc-commits mailing list