http://snakego.blog.163.com/blog/static/19849382200771244759656/
It's a nice day for me to write this note which will show you the compilation process of BusyBox1.20.And what I must point out that are my linux kernel version is 2.4.18 and host computer system is Red Hat 9.0.
Now you must download some tools before doing this.the list as follow:
1.BusyBox1.20; you can download it from http://www.busybox.net/ and there you can find the FAQ.
2.crosstool-3.3.2(arm-linux 3.3.2); you can find it in http://handhelds.org/download/projects/toolchain/
please download the crosstool-3.4.1 too.It may be helpful.
3.For your embedded system you must have your embedded mainboard and root file system. And i have a SBC3410 and a yaffs file system.you can download file systems in other web sites.
For decompressing files you may have to use the commads:
tar xvzf XXXX.tgz -C /address
and
tar xzvj XXXX.tar.bz2 -C /address
How to setup crosstools ?
tar xvzf arm-linux-gcc-3.3.2.tgz -C /
Add one line to /etc/profile as follow:
# Path manipulation
if [ `id -u` = 0 ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
pathmunge /usr/local/arm/3.3.2/bin
fi
Reboot to take effect.
Now just do it!
1.
# cd busybox1.2.0/
# make menuconfig
there is some suggestion for you to setup you new busybox:
Build Options->
[*]Build BusyBox as a static binary(no share libs)
Than your busybox can be executed without share libs
[*]Do you want to BusyBox with a cross compiler
here you can fill this :arm-linux-
Installation Options->
[*]Don't use /user
Apples links ->
./new_busybox/
Choice this will not replace your host computer's BusyBox after you "make install", and it will build new BusyBox to "./new_busybox".
Than you choose futions which you want.
for example, I would like my embedded mainboard have futions of "mount nfs support", "telnet server" and "modules utilities"
mount nfs support
[*]mount
[*]Support mounting NFS file system.
telnet server
[*]telnetd
modules utilities
[*]insmod
...
[*]rmmod
[*]lmmod
...
[*]nodprobe
...
exit setting and save your configuration.
# make clean
# make
#make install
if there is no error when compiling your BusyBox, it will make two folders and one linker in ./new_buybox.
now copy them to you root file system and replace the older,and then you make your new root file system and download it to your embedded mainboard.
If your don't want to change your embedded file system, replace them straightway;
Some FAQ happen to me:
1.many errors came out when i was compiling Busybox-1.2.0,1.1.3 and 1.3.0 with the crosstool-2.95.3
2.when i use crosstool-3.4.1 to compile Busybox-1.2.0,1.1.3 and 1.3.0 there are some errors if you choice any option in modules utilities.
3.crosstool-3.3.2 can complete success to build a new BusyBox1.2.0, but the telnet server doesn't work.
How did I deal with those problems?
1.Never use crosstool-2.95.3,it may just can compile BusyBox1.0.X.
2.Using crosstool-3.4.1 to compile Busybox-1.2.0 with no "modules utilities" selection.supposing the new busybox in ./new-bosybox-3.4.1
3.Compile Busybox-1.2.0 with all futions i want by crosstool-3.3.2.It works best,and it supports 2.4 kernel well.supposing the new busybox in ./new-bosybox-3.3.2
4.Copy "insmod", "lsmod" and "rmmod" form ./new-bosybox-3.3.2/sbin to (replace the linkers in) ./new-bosybox-3.3.2/sbin. and you can see that what you just have copy are not linkers, they are programs!
Doing this you must not use graphical interfaces, or it will copy linkers to replace linkers.