busybox中的ps命令是针对于嵌入式的,其中一些选项并不完整。因此需要将源码下载下来,进行交叉编译
含有configure,我在此使用的是这个源码包,官方的包在公司编译服务器上执行autogen.sh出错
编译脚本-不带ncurses:
#!/bin/shCROSS_COMPILE=arm-hisiv100nptl-linux-ARCH=armTARGET_DIR=$(cd `dirname $0`; pwd)/outputbuild_procps() { cd procps-ng-3.3.10-master echo "ac_cv_func_realloc_0_nonnull=yes" > arm-linux.cache echo "ac_cv_func_malloc_0_nonnull=yes" >> arm-linux.cache ./configure --host=$ARCH-linux --prefix=$TARGET_DIR \ --enable-static \ --disable-shared \ --without-ncurses \ --cache-file=arm-linux.cache \ CC=$CROSS_COMPILE\gcc \ STRIP=$CROSS_COMPILE\strip \ RANLIB=$CROSS_COMPILE\ranlib \ OBJDUMP=$CROSS_COMPILE\objdump \ NM=$CROSS_COMPILE\nm \ LD=$CROSS_COMPILE\ld \ AR=$CROSS_COMPILE\ar \ AS=$CROSS_COMPILE\as ; make ; make install || exit 1 #make || exit 1 cd -}build_procps
编译脚本-带ncurses:
#!/bin/sh CROSS_COMPILE=arm-hisiv100nptl-linux-ARCH=armTARGET_DIR=$(cd `dirname $0`; pwd)/outputbuild_ncurses() { cd ncurses-5.9 ./configure --host=$ARCH-linux --prefix=$TARGET_DIR \ --enable-static \ --disable-shared \ CC=$CROSS_COMPILE\gcc \ STRIP=$CROSS_COMPILE\strip \ RANLIB=$CROSS_COMPILE\ranlib \ OBJDUMP=$CROSS_COMPILE\objdump \ NM=$CROSS_COMPILE\nm \ LD=$CROSS_COMPILE\ld \ AR=$CROSS_COMPILE\ar \ AS=$CROSS_COMPILE\as ; make ; make install || exit 1 #make || exit 1 cd -}build_procps() { cd procps-ng-3.3.10-master echo "ac_cv_func_realloc_0_nonnull=yes" > arm-linux.cache echo "ac_cv_func_malloc_0_nonnull=yes" >> arm-linux.cache CFLAGS="-I$TARGET_DIR/include -I$TARGET_DIR/include/ncurses" NCURSES_CFLAGS="-I$TARGET_DIR/include -I$TARGET_DIR/include/ncurses" NCURSES_LIBS="-L$TARGET_DIR/lib -lncurses" ./configure --host=$ARCH-linux --prefix=$TARGET_DIR \ --enable-static \ --disable-shared \ --with-ncurses \ --cache-file=arm-linux.cache \ CC=$CROSS_COMPILE\gcc \ STRIP=$CROSS_COMPILE\strip \ RANLIB=$CROSS_COMPILE\ranlib \ OBJDUMP=$CROSS_COMPILE\objdump \ NM=$CROSS_COMPILE\nm \ LD=$CROSS_COMPILE\ld \ AR=$CROSS_COMPILE\ar \ AS=$CROSS_COMPILE\as ; make ; make install || exit 1 #make || exit 1 cd -}
相关问题:
export TERMINFO=/mnt/nfs/procps/terminfo
这样处理后,可以显示,但显示不完全
参考博文:
ps -eLf c
(较详细)