Root file system migration of tslib transplant record

https://blog.csdn.net/flfihpv259/article/details/51496959

A migration steps:

1. Download tslib

Download point I entered or downloaded using the git command:
git address - https://github.com/kergoth/tslib.git

2. Go to the download directory or extract from the tslib

3. Do a few commands:

anzyelay@ubuntu:tslib$ ./autogen.sh  //得到configure
anzyelay@ubuntu:tslib$ ./configure  --host=arm-linux  --prefix=安装目录 CC=交叉编译器绝对路径
anzyelay@ubuntu:tslib$ make
anzyelay@ubuntu:tslib$ sudo make install

anzyelay@ubuntu:安装目录$ ls    //成功后在安装目录有如下文件
bin  etc  include  lib
  
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

No absolute path will be out some problems, must be an absolute path.

4. The use to libraries and executable program into a corresponding root file system directory.

Two ways:

  • Here -> after the "/" refers to the root directory of the file system, not the root directory of your PC's, this tslib for stable post-transplant

  • All other files other than the removal pkgconfig directory tslib / lib / File -> / lib: Libraries
  • Program: Under tslib / bin files for all text -> / bin
  • Configuration: tslib / etc / ts.conf File -> /etc/ts.conf
  • You can also choose the entire directory into a directory in the root directory, but to do the corresponding change in the configuration environment variable, the error correction time for the beginning of transplantation,

  • 5. Change the file system configuration files and adding environment variables

    • ts.conf: Depending on your touch-screen information on the development board canceled a comment, canceled here, a right to a trial following it.

    # Uncomment if you’re using a Sharp Zaurus SL-C700/C750/C760/C860
    module_raw corgi

  • In the / etc / profile add the following configuration according to their own file system:

  • export TSLIB_TSDEVICE = / dev / ts0 # selected here if the ts.conf event0 to be selected from the INPUT module_raw
    Export TSLIB_CONFFILE = / etc / ts.conf
    Export TSLIB_PLUGINDIR = / lib / TS
    Export TSLIB_CALIBFILE = / TEMP / # Here is the calibrating pointercal files saved places, change the
    Export TSLIB_CONSOLEDEVICE = none
    Export TSLIB_FBDEVICE = / dev / fb0

    If the method is the step 2, the configuration is as follows:

    export TS_ROOT = / usr / local / tslib #tslib move to the file system directory
    Export TSLIB_TSDEVICE = / dev / the INPUT / TS0
    Export TSLIB_CONFFILE = $ TS_ROOT / etc / ts.conf
    Export TSLIB_PLUGINDIR = $ TS_ROOT / lib / TS
    Export TSLIB_CALIBFILE = / TEMP / pointercal
    Export TSLIB_CONSOLEDEVICE = none
    Export TSLIB_FBDEVICE = / dev / FB0
    Export the PATH = $ TS_ROOT / bin: $ the PATH
    Export the LD_LIBRARY_PATH = $ TS_ROOT / lib: $ the LD_LIBRARY_PATH

    These configurations mean See tslib / README follows:

    42 43 TSLIB_TSDEVICE TS device file name. 44
    Default (non inputapi): /dev/touchscreen/ucb1x00 45
    Default (inputapi): /dev/input/event0 46 TSLIB_CALIBFILE
    Calibration file. 47 Default:
    ${sysconfdir}/pointercal 48 TSLIB_CONFFILE Config file. 49
    Default: ${sysconfdir}/ts.conf 50 TSLIB_PLUGINDIR Plugin
    directory. 51 Default: ${datadir}/plugins 52
    TSLIB_CONSOLEDEVICE Console device. 53 Default:
    /dev/tty 54 TSLIB_FBDEVICE Framebuffer device. 55
    Default: /dev/fb0

    6. Do ts_calibrate correction

    [root@bst:/]# ts_calibrate
    xres = 480, yres = 272
    Took 26 samples…
    Top left : X = 162 Y = 209
    Took 30 samples…
    Top right : X = 866 Y = 210
    Took 31 samples…
    Bot right : X = 871 Y = 581
    Took 31 samples…
    Bot left : X = 155 Y = 584
    Took 24 samples…
    Center : X = 515 Y = 395
    -35.559814 0.535173 0.001486
    -46.847839 0.000662 0.461112
    Calibration constants: -2330448 35073 97 -3070220 43 30219 65536


    Second problem encountered Summary:

    1. In implementing ./autogen.sh appear:

    ./autogen.sh: 3: autoreconf: not found

    The reason is because there is no installation automake tools, install the following commands:
    sudo apt-get install autoconf automake libtool

    2. Do ./configure when there are mistakes:

    • erro1:

    libtool: install: error: cannot install `linear.la’ to a directory not ending in /usr/local/lib/ts
    make[2]: * [install-pluginexecLTLIBRARIES] Error 1
    make[2]: Leaving directory `/home/anzyelay/Desktop/arm/tslib/plugins’
    make[1]: * [install-am] Error 2
    make[1]: Leaving directory `/home/anzyelay/Desktop/arm/tslib/plugins’
    make: * [install-recursive] Error 1

    Error handling, should make clean after each ./configure then execute make.

  • error2:

  • libtool: install: (cd /home/anzyelay/Desktop/arm/tslib/plugins; /bin/bash /home/anzyelay/Desktop/arm/tslib/libtool –tag CC –mode=relink arm-linux-gcc -DTS_POINTERCAL=\”/home/anzyelay/Desktop/arm/tslib_install/etc/pointercal\” -DTSLIB_INTERNAL -fvisibility=hidden -DGCC_HASCLASSVISIBILITY -O2 -Wall -W -module -avoid-version -o linear.la -rpath /home/anzyelay/Desktop/arm/tslib_install/lib/ts linear.lo ../src/libts.la )
    libtool: relink: arm-linux-gcc -shared -fPIC -DPIC .libs/linear.o -Wl,-rpath -Wl,/home/anzyelay/Desktop/arm/tslib_install/lib -L/home/anzyelay/Desktop/arm/tslib_install/lib -lts -O2 -Wl,-soname -Wl,linear.so -o .libs/linear.so
    /home/anzyelay/Desktop/arm/tslib/libtool: line 8968: arm-linux-gcc: command not found
    libtool: install: error: relink `linear.la’ with the above command before installing it
    make[2]: * [install-pluginexecLTLIBRARIES] Error 1

    To specify the CC as follows, you must use an absolute address, or a third the following error:

    anzyelay@ubuntu:~/Desktop/arm/tslib$ ./configure  --host=arm-linux --prefix=/home/anzyelay/Desktop/arm/myrootfs/usr/local/tslib CC=/usr/local/arm/4.4.3/bin/arm-linux-gcc
    
      
      
    • 1
    • 2

    The foregoing configuration, make all the way OK, but when an error make install as follows:

    ```
    /bin/bash ../libtool   --mode=install /usr/bin/install -c   linear.la dejitter.la variance.la pthres.la ucb1x00.la corgi.la collie.la h3600.la mk712.la arctic2.la tatung.la dmc.la linear_h2200.la input.la galax.la touchkit.la '/home/anzyelay/Desktop/arm/tslib/build/lib/ts'
    libtool: install: warning: relinking `linear.la'
    libtool: install: (cd /home/anzyelay/Desktop/arm/tslib/plugins; /bin/bash /home/anzyelay/Desktop/arm/tslib/libtool  --tag CC --mode=relink arm-linux-gnueabi-gcc -DTS_POINTERCAL=\"/home/anzyelay/Desktop/arm/tslib/build/etc/pointercal\" -DTSLIB_INTERNAL -fvisibility=hidden -DGCC_HASCLASSVISIBILITY -O2 -Wall -W -module -avoid-version -o linear.la -rpath /home/anzyelay/Desktop/arm/tslib/build/lib/ts linear.lo ../src/libts.la )
    libtool: relink: arm-linux-gnueabi-gcc -shared  -fPIC -DPIC  .libs/linear.o   -Wl,-rpath -Wl,/home/anzyelay/Desktop/arm/tslib/build/lib -L/home/anzyelay/Desktop/arm/tslib/build/lib -lts  -O2   -Wl,-soname -Wl,linear.so -o .libs/linear.so
    /home/anzyelay/Desktop/arm/tslib/libtool: line 8968: arm-linux-gnueabi-gcc: command not found
    libtool: install: error: relink `linear.la' with the above command before installing it
    make[2]: *** [install-pluginexecLTLIBRARIES] Error 1
    make[2]: Leaving directory `/home/anzyelay/Desktop/arm/tslib/plugins'
    make[1]: *** [install-am] Error 2
    make[1]: Leaving directory `/home/anzyelay/Desktop/arm/tslib/plugins'
    make: *** [install-recursive] Error 1
    
    ```
    
      
      
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14

    CC = absolute terms modify its address, as follows,
    when an error

    anzyelay@ubuntu:tslib$ ./configure --host=arm-linux --prefix=`pwd`/build CC=arm-linux-gcc
    
      
      
    • 1
    • 2

    Correct

    anzyelay@ubuntu:tslib$ ./configure --host=arm-linux --prefix=`pwd`/build CC=/usr/local/arm/4.9.4/bin/arm-linux-gcc
    
      
      
    • 1
    • 2

    Although I have a good job compiler environment, can find arm-linux-gcc, but that is wrong, it is OK when using absolute addresses.

    4. Perform the following error ts_calibrate

    • ERROR1:
      /bin/ts_calibrate: line 1: syntax error: unexpected end of file
      File under x86 actually found the file, not the arm.

    anzyelay@ubuntu:myrootfs$ file bin/ts_calibrate 
    bin/ts_calibrate: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0xb79294591df01693dcc3ae349c4995c59a527f80, not stripped
      
      
    • 1
    • 2

    PATH variable later found the PC recovery, and should be turned back after sudo su is restored, view the / etc / profile is normal, the next re-run source / etc / profile, see PATH normal. And then recompile the normal installation:

    anzyelay@ubuntu:myrootfs$ file usr/local/tslib/bin/ts_calibrate 
    usr/local/tslib/bin/ts_calibrate: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, not stripped
    
      
      
    • 1
    • 2
    • 3
  • error2:

  • [root@bst:/]# ts_calibrate
    ts_calibrate: error while loading shared libraries: libts-1.0.so.0: wrong ELF class: ELFCLASS64

    This is because the library does not result to see if the tslib / lib / libts-1.0.so.0 moved under / lib, if it is a method of shifting the entire directory tslib will have to specify the library search path as follows:
    export TS_ROOT=/usr/local/tslib
    export LD_LIBRARY_PATH=$TS_ROOT/lib:$LD_LIBRARY_PATH

  • error3:

  • [root@bst:/]# ts_calibrate
    xres = 480, yres = 272
    ts_read: Invalid argument

    Because I selected the ts.conf module is "module_raw corgi", so the change in the configuration file TSLIB_TSDEVICE variables are as follows

    export TSLIB_TSDEVICE=/dev/input/event0 
    修改为
    export TSLIB_TSDEVICE=/dev/input/ts0
      
      
    • 1
    • 2
    • 3

    In-depth inquiry found the following correspondence relationship:
    / dev / the INPUT / event0 <-> module_raw the INPUT
    / dev / the INPUT / TS0 <-> module_raw Corgi
    Both are possible, as long as the corresponding configuration profile ts.conf and write.

  • error 4

  • root@~# ts_calibrate 
    xres = 800, yres = 480
    tslib: Selected device is not a touchscreen (must support ABS and KEY event types)
    Took 3 samples...
    Top left : X = 1993966148 Y = 20672392
    Took 3 samples...
    Top right : X = 1993966148 Y = 20672392
    Took 3 samples...
    Bot right : X = 1993966148 Y = 20672392
    Took 3 samples...
    Bot left : X = 1993966148 Y = 20672392
    Took 3 samples...
    Center : X = 1993966148 Y = 20672392
    0.348604 -0.002357 0.227393
    -0.214578 0.004819 -0.464815
    Calibration constants: 22846 -154 14902 -14062 315 -30462 65536
      
      
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16

    From Selected device is not a touchscreen TSLIB_TSDEVICE sentence to see something goes wrong, the next check:

    export TSLIB_TSDEVICE=/dev/input/event0
      
      
    • 1

    View the next device

    root@/etc# cat /proc/bus/input/devices 
    I: Bus=0019 Vendor=0000 Product=0000 Version=0000
    N: Name="20cc000.snvs-pwrkey"
    P: Phys=snvs-pwrkey/input0
    S: Sysfs=/devices/soc0/soc.0/2000000.aips-bus/20cc000.snvs-pwrkey/input/input0
    U: Uniq=
    H: Handlers=kbd event0 evbug 
    B: PROP=0
    B: EV=3
    B: KEY=100000 0 0 0
    
    I: Bus=0000 Vendor=0000 Product=0000 Version=0000
    N: Name="iMX6UL TouchScreen Controller"
    P: Phys=
    S: Sysfs=/devices/virtual/input/input1
    U: Uniq=
    H: Handlers=mouse0 event1 evbug 
    B: PROP=0
    B: EV=b
    B: KEY=400 0 0 0 0 0 0 0 0 0 0
    B: ABS=3
    
    I: Bus=0003 Vendor=0c45 Product=6340 Version=0000
    N: Name="USB 2.0 Camera"
    P: Phys=usb-ci_hdrc.1-1.1/button
    S: Sysfs=/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/input/input3
    U: Uniq=
    H: Handlers=kbd event2 evbug 
    B: PROP=0
    B: EV=3
    B: KEY=100000 0 0 0 0 0 0
    
      
      
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32

    The touch screen should be event1, modify the restart, again perform ts_calibrate

    Published 42 original articles · won praise 148 · views 410 000 +

    Guess you like

    Origin blog.csdn.net/baidu_37503452/article/details/104793866