2009/10/12 Darren Salt <[email protected]>:

> Your patch adds "|| exit 0" to that, which will cause early exit if the

I just realized that and was thinking about a solution:

> module is built in, which is Not Good. Loading the module in the absence of
> /sys/devices/platform/eeepc should be enough to avoid this.

What I was concerned about is that it can take some time after
/sys/devices/platform/eeepc for the whole module to be ready
(especially the rfkill stuff is slow), so there could be a race
condition.
But the only thing (eeepc_laptop related) the script actually does is
setting the SHEngine, and that appears as soon as the the sysfs
directory is created.
What about this version?
Cheers,

Luca
--- a/debian/eeepc-acpi-scripts.init	2009-08-10 10:04:32.000000000 +0200
+++ b/debian/eeepc-acpi-scripts.init	2009-10-11 19:06:57.779159444 +0200
@@ -11,9 +11,6 @@
 # exit if package not installed
 test -f /usr/share/eeepc-acpi-scripts/functions.sh || exit 0
 
-# exit if eeepc-laptop isn't loaded (should be loaded by udev)
-test -d /sys/bus/platform/devices/eeepc || exit 0
-
 PATH="/sbin:/bin"
 
 . /lib/lsb/init-functions
@@ -36,6 +33,12 @@
 case "$1" in
   start|restart|reload|force-reload)
 
+    # the module could be loading in background, if the sysfs isn't ready
+    # we try to waiting for it.
+    if [ ! -d /sys/bus/platform/devices/eeepc ]; then
+        modprobe --use-blacklist --ignore-install eeepc_laptop || exit 0
+    fi
+
     # First, get the kernel version.
 
     KERNEL="`uname -r`"
@@ -98,10 +101,10 @@
 	    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))}" || :
+	    set_shengine "${PWR_CLOCK_BATTERY:-$(($SHENGINE_LIMIT - 1))}" &
 	else
 	    log_action_cont_msg '(AC)'
-	    set_shengine "${PWR_CLOCK_AC:-0}" || :
+	    set_shengine "${PWR_CLOCK_AC:-0}" &
 	fi
 	log_action_end_msg $?
     fi
_______________________________________________
Debian-eeepc-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/debian-eeepc-devel

Reply via email to