QNX常用小技巧

QNX常用小技巧 

1.跳过登陆

跳过图形:
在/etc/rc.d/rc.local中增加/usr/photon/bin/Photon -l '/usr/photon/bin/phlogin -O -Uuser:password'
跳过命令行:
修改/etc/config/ttys文件,con1 "/bin/login -f root" qansi-m on

 

2.使用Pindows

/etc/inetd.conf文件里去掉此句注释:phrelay stream tcp nowait root /usr/bin/phrelay phrelay -x

杀死并重新运行inetd:1.#slay inetd              2.#inetd

 

3.去掉shelf [Photon Shelf Manager -- 边框

用命令#shelf -e

或 A more permanent approach is to set the PHSHELF_DISABLE environment variable to 1. You can do this in your .profile file, with export PHSHELF_DISABLE=1

 

4.登入时进命令行模式

/etc/rc.d/rc.sysinit runs tinit. [If the -p option is specified, tinit starts Photon.]By default, the system starts Photon, but if you create a file called /etc/system/config/nophoton, then rc.sysinit tells tinit to use text mode.

 

5.自动运行程序

If you want to run a Photon application whenever Photon starts, put it in your $HOME/.ph/phapps file. Put each command on a separate line. For example, to start the Photon editor when you start Photon, include this line: ped &
[注:phapps需加可执行权限,例如 #chmod +x /root/.ph/phapps]

 

6.登陆记录

The login utility also updates system accounting information in var/log/utmp, /var/log/wtmp,and /var/log/lastlog. if they already exist. The login utility doesn't create /var/log/utmp, /var/log/wtmp, and /var/log/lastlog if they don't already exist. These files can quickly become very big, which isn't good on an embedded system with limited resources.

 

7.TCP/IP 网络设置

设置IP,在图形界面可用phlip

在命令行可用:先要确定Network I/O在运行:io-net -dne2000 -ptcpip

指定IP ifconfig en0 10.0.0.100

指定路由:route add default 10.0.0.1

用DHCP自动获取IP dhcp.client -i en0 -m -u -t 1


Start the second instance of the TCP/IP stack by invoking io-net as follows:

io-net -i1 -del900 pci=0x1 -ptcpip prefix=/sock2

The -i option in the second instance of TCP/IP tells io-net to register itself as /dev/io-net1. The prefix option to npm-tcpip.so causes the second stack to be registered as /sock2/dev/socket instead of the default, /dev/socket. TCP/IP applications that wish to use the second stack must specify the environment variable SOCK. For example:SOCK=/sock2 netstat -in
Are io-net and the drivers running? pidin -P io-net mem
Is the TCP/IP protocol stack or Ethernet driver installed? ls /dev/io-net
How do I map hostnames to IP addresses /etc/hosts
How do I get the network status? netstat -in
List the interfaces, including the MAC and IP addresses that they've been configured with. netstat -rn 
Display the network routing tables that determine how the stack can reach another host. netstat -an
List information about TCP/IP connections to or from your system. For the tiny TCP/IP stack, you have to use the following command as it doesn't support netstat:  cat /proc/ipstats
How do I display information about an interface controller? /usr/sbin/nicinfo /dev/io-net/en0


你可能感兴趣的:(QNX)