分类: 嵌入式
2014-01-09 12:27:59
将 rcS 文件中的最后 3 行:替换为:
/bin/qtopia &
echo "
" > /dev/tty1
echo "Starting Qtopia, please waiting..." > /dev/tty1
$QTDIR/bin/hello -qws &将可执行程序 hello 放在/usr/local/Trolltech/QtEmbedded-4.5.3-arm/bin目录下,开机将不启动QTOPIA,而启动自己的程序 hello。
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CONFFILE=/usr/local/tslib/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/tslib/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export LD_LIBRARY_PATH=/usr/local/tslib/lib:$LD_LIBRARY_PATH
export PATH=/bin:/sbin:/usr/bin/:/usr/sbin:/usr/local/bin
export QTDIR=/usr/local/Trolltech/QtEmbedded-4.7.3-arm
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QWS_DISPLAY=:1
export QWS_KEYBOARD=TTY:/dev/tty1
/usr/local/Trolltech/QtEmbedded-4.7.3-arm/bin/smarthome -qws &
注意:上面的环境变量要根据你的开发板对应设置好,不然运行时会出现运行不成功的情况。
echo " " > /dev/tty1
echo "Starting myQt apps, please waiting..." > /dev/tty1
(其实倒数第 3 行是启动代码了,最后两行只是在屏幕上显示一句话,不是重点目标。)
参考:http://huasoft.blog.163.com/blog/static/2450241120114242156445/