Red Hat 9.0. Compile busybox

Source: Internet
Author: User

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.ust 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/Etc/profileAs 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"./New_busybox ".

Than you choose futions which you want.
For example, I wowould like my embedded mainboard have futions"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. assumerrors 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/sbinTo (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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.