embedded-linuxautologinbusybox

embedded linux with busybox auto-login


I need to make a QT app to run on the startup of an embedded linux system that I made. I have access to the system via serial port ttySAC0. I tried adding the app to inittab , it runs but tslib is not working, probably because it can't find the environment variables it needs to work because I'm setting those environment variables in the /etc/.profile file which runs after user login. I need to auto login a user so the environment variables are set so tslib would work, or a way to set those environment variables without logging in. The system is made with buildroot and busybox.


Solution

  • I've figured it out, I made this shell script:

    #!/bin/sh
    #
    #Sets necessary environment variables and runs the desktop
    #
    
    export TSLIB_TSDEVICE=/dev/touchscreen-1wire
    export TSLIB_TSEVENTTYPE=INPUT
    export TSLIB_FBDEVICE=/dev/fb0
    export TSLIB_PLUGINDIR=/usr/lib/ts/
    export TSLIB_CONSOLEDEVICE=none
    export TSLIB_CONFFILE=/etc/ts.conf
    export TSLIB_CALIBFILE=/etc/pointercal
    export LD_LIBRARY_PATH=/usr/lib
    export QTDIR=/usr/lib/qt
    export QWS_MOUSE_PROTO=tslib:/dev/touchscreen-1wire
    
    /path/to/application -qws
    

    Then made it executable with:

    $chmod +x startup.sh
    

    then added this line to inittab:

    tty1::once:/path/to/startup.sh
    

    Now when I boot up, the application is running fine with tslib and I still got acces via serial line whenever I need.