首先我使用的busybox是1.1.3版本! 因為這個版本有好多的有用的配置選項! 進入解壓後的目錄,配置Busybox
[[email protected] busybox1.1.3]$make menuconfig 配置選項
然後:
#make TARGET_ARCH=arm CROSS=arm-linux-
#make install
如果你是使用的1.4以上的版本,交叉編譯同編譯核心一樣,需要修改Makefile中的arch=arm CROSS_COMPILE=arm-linux-
然後#make xconfig
#make
#make install ###############################################################
Busybox Settings >
General Configuration >
[*] Support for devfs
Build Options >
[*] Build BusyBox as a static binary (no shared libs)
[*] Do you want to build BusyBox with a Cross Compiler?
(/usr/local/arm/3.4.1/bin/arm-linux-)
Cross Compiler prefix
Init Utilities >
[*] init
[*] Support reading an inittab file
Shells >
Choose your default shell (ash) >
[*] ash
###################################################################################
另外,按照他的這種方法做出來的檔案系統,運作的時候 shell 并不好有,沒有曆史記錄、自動補全、删除字元的功能,下面介紹如何為它添加這些功能:
Shells --->
--- Bourne Shell Options
[ ] Hide message on interactive shell startup
[ ] Standalone shell
[*] command line editing
[*] vi-style line editing commands
(15) history size
[*] history saving
[*] tab completion
[*] username completion
[ ] Fancy shell prompts
################################################################################### Coreutils >
[*] cp
[*] cat
[*] ls
[*] mkdir
[*] echo (basic SuSv3 version taking no options)
[*] env
[*] mv
[*] pwd
[*] rm
[*] touch
Editors >
[*] vi
Linux System Utilities >
[*] mount
[*] umount
[*] Support loopback mounts
[*] Support for the old /etc/mtab file
Networking Utilities >
##########################################################
Linux Module Utilities --->
[*] insmod
[*] rmmod
[*] lsmod
[*] lsmod pretty output for 2.6.x Linux kernels
[*] modprobe
[*] Multiple options parsing
--- Options common to multiple modutils
[*] Support tainted module checking with new kernels
[ ] Support version 2.2.x to 2.4.x Linux kernels //此項一定不要選!!!
[*] Support version 2.6.x Linux kernels ########################################################################
建立根檔案系統結構
#mkdir rootfs
#cd rootfs
#mkdir bin dev etc lib proc sbin tmp usr var
#chmod 1777 tmp
#mkdir usr/bin usr/lib usr/sbin
#mkdir var/lib var/lock var/log var/run var/tmp
#chmod 1777 var/tmp
準備連結庫
#cd ${OBJ_LIB}/lib (${OBJ_LIB}是交叉編譯環境的目錄)
#for file in libc libcrypt libdl libm /
>libpthread libresolv libutil
>do
>cp $file-*.so /home/fortis/rootfs/lib
>cp -d $file.so.[*0-9] /home/fortis/rootfs/lib
>done
#cp -d ld*.so* /home/fortis/rootfs/lib
#######################################################################
如果不知道需要哪些共享庫,可以在你寫好自己的程式後使用#ld hello 指令來看看需要哪些共享庫然後在複制到/lib目錄下面!
#######################################################################