add `ps -l' support for openwrt
Table of Contents
1 description
As default, when we run `ps', we can only see the following sections:
root@a:~# ps PID USER VSZ STAT COMMAND 1 root 1416 S /sbin/procd 2 root 0 SW [kthreadd] 3 root 0 SW [ksoftirqd/0]
It's far from enough.
2 add ps -l
2.1 set by `make menuconfig'
do
make menuconfig
then select `Enable long output option'
Base system ---> busybox ---> Process Utilities ---> [*] ps [*] Enable long output option (-l)
when -l enabled, save the configuration. we can find `CONFIG_BUSYBOX_CONFIG_FEATURE_PS_LONG=y' in .config.
2.2 quick test
For quick test, compile busybox is enough:
- compile busybox
$ make package/busybox/compile V=s
- copy to board
Use ssh or tftp to replace the /bin/busybox in our board by using the new compiled one.
The compiled `busybox' loacated in:
build_dir/target-mips_34kc_uClibc-0.9.33.2/busybox-1.23.2/
- Grant the execute privilege.
root@a:~# chmod +x /bin/busybox
- Then test it on board:
root@a:~# ps S UID PID PPID VSZ RSS TTY STIME TIME CMD S 0 1 0 1416 644 0:0 May26 00:00:07 /sbin/procd S 0 2 0 0 0 0:0 May26 00:00:00 [kthreadd] S 0 3 2 0 0 0:0 May26 00:11:13 [ksoftirqd/0]