OSDN Git Service

3-tslib: run ts_calibrate to generate pointercal
authorChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 15 Mar 2010 09:37:12 +0000 (17:37 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 15 Mar 2010 09:37:12 +0000 (17:37 +0800)
If BOARD_USES_TSLIB is true and a system-wide pointercal doesn't exist,
run ts_calibrate to generate /data/system/tslib/pointercal.

Besides, add more Eee PC models.

initrd/init
initrd/scripts/0-auto-detect
initrd/scripts/3-tslib [new file with mode: 0644]

index 4a84af8..22f8dae 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/busybox sh
 #
 # By Chih-Wei Huang <cwhuang@linux.org.tw>
-# Last updated 2009/07/18
+# Last updated 2010/03/15
 #
 # License: GNU Public License
 # We explicitely grant the right to use the scripts
@@ -83,7 +83,7 @@ if [ -n "$DEBUG" -o -n "$BUSYBOX" ]; then
        mv /bin /lib .
        system/bin/ln -s android/lib /lib
        system/bin/ln -s android/bin /bin
-       sed -i 's|\(PATH *\)\(/sbin\)|\1/bin:\2|;s|\(/system\)\(/bin/sh\)|\2|' init.rc
+       sed -i 's|\(PATH *\)\(/sbin\)|\1/bin:\2|' init.rc
        mv /sbin/* sbin
        rmdir /sbin
        ln -s android/sbin /
@@ -107,6 +107,7 @@ do_install
 load_modules
 mount_data
 mount_sdcard
+setup_tslib
 
 if [ -n "$DEBUG" ]; then
        echo -e "\nUse Alt-F1/F2/F3 to switch between virtual consoles"
index 73f6ed6..113743c 100644 (file)
@@ -1,6 +1,6 @@
 #
 # By Chih-Wei Huang <cwhuang@linux.org.tw>
-# Last updated 2009/08/14
+# Last updated 2010/03/15
 #
 # License: GNU Public License
 # We explicitely grant the right to use the scripts
@@ -55,17 +55,38 @@ asus_info()
                        LANDEV=atl1e
                        WIFDEV=rt2860sta
                        ;;
+               1005HA*)
+                       LANDEV=atl1c
+                       WIFDEV=ath9k
+                       ;;
                ET1602*)
-                       FB0DEV=
-                       UVESA_MODE=${UVESA_MODE:-1366x768}
+                       # i915 is buggy on 2.6.29
+                       if uname -r | grep -q 2.6.29; then
+                               FB0DEV=
+                               UVESA_MODE=${UVESA_MODE:-1366x768}
+                       fi
                        LANDEV=r8169
                        WIFDEV=rt2860sta
+                       BOARD_USES_TSLIB=true
+                       ;;
+               ET2002*)
+                       FB0DEV=
+                       UVESA_MODE=${UVESA_MODE:-1600x900}
+                       LANDEV=r8169
+                       WIFDEV=ath9k
+                       BOARD_USES_TSLIB=true
                        ;;
                T91)
                        FB0DEV=
                        UVESA_MODE=${UVESA_MODE:-1024x600}
                        LANDEV=atl1e
                        WIFDEV=ath9k
+                       BOARD_USES_TSLIB=true
+                       ;;
+               T101)
+                       LANDEV=atl1e
+                       WIFDEV=ath9k
+                       BOARD_USES_TSLIB=true
                        ;;
                A6VM*)
                        EXTMOD=asus-laptop
diff --git a/initrd/scripts/3-tslib b/initrd/scripts/3-tslib
new file mode 100644 (file)
index 0000000..331a623
--- /dev/null
@@ -0,0 +1,27 @@
+setup_tslib()
+{
+       # setup for pointercal
+       if [ -n "$BOARD_USES_TSLIB" ]; then
+               TSLIBPATH=data/system/tslib
+               if [ ! -e $TSLIBPATH/pointercal ]; then
+                       mkdir -p $TSLIBPATH
+                       if [ -z "$CALIBRATE" -a -n "`ls system/etc/pointercal*`" ]; then
+                               board=`cat /sys/class/dmi/id/product_name`
+                               [ -e system/etc/pointercal.$board ] && pointercal=system/etc/pointercal.$board
+                               [ -e system/etc/pointercal ] && pointercal=system/etc/pointercal
+                       fi
+                       if [ -n "$pointercal" ]; then
+                               cp $pointercal $TSLIBPATH/pointercal
+                       elif [ -e system/etc/ts.env ]; then
+                               ln -s android/data /
+                               mdev -s
+                               mkdir /dev/graphics /dev/input
+                               ln -s /dev/fb* /dev/graphics
+                               ln -s /dev/event* /dev/input
+                               ts_calibrate > /tmp/cal.log
+                       fi
+                       chmod 666 $TSLIBPATH/pointercal
+                       chown -R 1000.1000 data
+               fi
+       fi
+}