Here's a patch that tries to load the i2c-dev module when pbbuttonsd
is started and it's on an alum powerbook. It's slightly hacky, but I'm
not sure there's a better way to do it. There's no real hotplug
support for detecting a i2c bus as far as I can tell. I'm sure I've
missed some machine types, I've just used the one for my
machine. Comments and criticisms welcome. 

-- 
Eric Dorland <[EMAIL PROTECTED]>
ICQ: #61138586, Jabber: [EMAIL PROTECTED]
1024D/16D970C6 097C 4861 9934 27A0 8E1C  2B0A 61E9 8ECF 16D9 70C6

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d- s++: a-- C+++ UL+++ P++ L++ E++ W++ N+ o K- w+ 
O? M++ V-- PS+ PE Y+ PGP++ t++ 5++ X+ R tv++ b+++ DI+ D+ 
G e h! r- y+ 
------END GEEK CODE BLOCK------
--- pbbuttonsd.init.old 2005-07-31 14:46:52.000000000 -0400
+++ pbbuttonsd.init     2005-07-31 15:45:01.000000000 -0400
@@ -15,8 +15,23 @@
 
 set -e
 
+# Kind of a hack to load i2c-dev for Alum Powerbooks with backlit 
+# keyboards
+load_i2c_dev()
+{
+    if [ -e /proc/cpuinfo ] && [ -x /sbin/modprobe ]; then
+        machine=`grep ^machine /proc/cpuinfo | cut -d : -f 2`
+        if [ "$machine" = " PowerBook5,6"]; then
+            echo -n "Loading i2c-dev module: "
+            modprobe -q i2c-dev
+            echo "done."
+        fi
+    fi
+}
+
 case "$1" in
   start)
+       load_i2c_dev    
        echo -n "Starting $DESC: "
        start-stop-daemon --start --make-pidfile --pidfile \
                /var/run/$NAME.pid --exec $DAEMON -- --configfile=$CONF -d

Attachment: signature.asc
Description: Digital signature

Reply via email to