移植tslib

准备工作

tslib-1.21.tar.bz2

配置&编译&安装

1. 解压

tar jxvf tslib-1.21.tar.bz2

2. 配置

设置tslib-1.21.tar.bz2的归属权,设置为自己的用户名,不然后面可能会出问题

什么?怎么查看用户名?使用 whoami 命令

sudo chown : tslib-1.21 -R

ubuntu安装将要使用的工具

sudo apt install autoconf automake libtool

开始配置

cd tslib-1.21
./autogen.sh
./configure \
--host=arm-linux-gnueabihf \
--prefix=/arm_tslib

3. 编译&安装

make
make install

4. 目标环境配置

# file path: /etc/profile
## TSLIB_TSDEVICE 触摸设备文件/dev/input/eventx
export TSLIB_TSDEVICE=/dev/input/event2
## TSLIB_CALIBFILE 校准文件,会自动创建
export TSLIB_CALIBFILE=/etc/pointercal
## TSLIB_CONFFILE 触摸配置文件
export TSLIB_CONFFILE=/etc/ts.conf
## TSLIB_PLUGINDIR 插件目录
export TSLIB_PLUGINDIR=/usr/lib/ts
## 控制台设置
export TSLIB_CONSOLEDEVICE=none
## 屏幕设备文件
export TSLIB_FBDEVICE=/dev/fb0

5. 拷贝文件至开发板

//cd xxx
cp -arf bin/*          ~/nfs/rootfs/usr/bin
cp -arf sbin/*         ~/nfs/rootfs/usr/sbin
cp -arf lib/*          ~/nfs/rootfs/usr/lib
cp -arf share/*        ~/nfs/rootfs/usr/share
cp -arf etc/*          ~/nfs/rootfs/etc/

X. 常见错误

Couldn’t load module input

没有找到插件的文件,一般在安装在/lib/ts下(我这里安装在了/usr/lib/ts),
查看echo $TSLIB_PLUGINDIR 能不能对应上

ts_setup: No such file or directory

原因1:检查是否是驱动没安装上
原因2:环境变量没设置好,重新设置一下就可以。参考上面 4. 目标环境配置

configure 一些说明

--prefix= #安装路径
--host= #运行环境, 交叉编译链前缀

你可能感兴趣的:(填坑日记,tslib,linux,驱动)