【目的】
需要用export导出一些环境变量,才能使得QT的demo正常运行。
希望把这些export导致变量的动作,加到启动脚本中。
【解决过程】
以为是在家/etc/inittab下面的,结果不对。
最后搞懂了,类似于PC的Linux中的.bashrc,嵌入式Linux中的rootfs中,是变量定义是放在/etc/profile中的,本身已经有的内容如下:
# ~/.bashrc: executed by bash(1) for non-login interactive shells.
export PATH=
/bin:
/sbin:
/usr/bin:
/usr/sbin:
/usr/bin/X11:
/usr/local/bin
。。。
export PAGER=’/bin/more ‘
export EDITOR=’/bin/vi’
export INPUTRC=/etc/inputrc
export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile
### Some aliases
alias ps2=’ps facux ‘
alias ps1=’ps faxo "%U %t %p %a" ‘
alias af=’ps af’
。。。
所以,加到对应位置后,就可以了:
# ~/.bashrc: executed by bash(1) for non-login interactive shells.
。。。
export EDITOR=’/bin/vi’
export INPUTRC=/etc/inputrc
export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile
### add for QT
export QTDIR=/usr
export LD_LIBRARY_PATH=$QTDIR/lib
export QT_QWS_FONTDIR=$QTDIR/lib/fonts
export QWS_DISPLAY="LinuxFb:/dev/fb0"
### Some aliases
alias ps2=’ps facux ‘
alias ps1=’ps faxo "%U %t %p %a" ‘
。。。