OSDN Git Service

8c4b0d53a4192d301c435eb54e1b0295d37a798c
[android-x86/bootable-newinstaller.git] / initrd / scripts / 3-tslib
1 setup_tslib()
2 {
3         # setup for pointercal
4         if [ -n "$BOARD_USES_TSLIB" ]; then
5                 TSLIBPATH=data/system/tslib
6                 if [ ! -e $TSLIBPATH/pointercal ]; then
7                         mkdir -p $TSLIBPATH
8                         if [ -z "$CALIBRATE" -a -n "`ls system/etc/pointercal*`" ]; then
9                                 board=`cat /sys/class/dmi/id/product_name`
10                                 [ -e system/etc/pointercal.$board ] && pointercal=system/etc/pointercal.$board
11                                 [ -e system/etc/pointercal ] && pointercal=system/etc/pointercal
12                         fi
13                         if [ -n "$pointercal" ]; then
14                                 cp $pointercal $TSLIBPATH/pointercal
15                         elif [ -e system/etc/ts.env ]; then
16                                 ln -s android/data /
17                                 mkdir /dev/graphics /dev/input
18                                 ln -s /dev/fb* /dev/graphics
19                                 ln -s /dev/event* /dev/input
20                                 ts_calibrate > /tmp/cal.log
21                         fi
22                         chmod 666 $TSLIBPATH/pointercal
23                         chown -R 1000.1000 data
24                 fi
25         fi
26 }