Overview and use of busybox

Source: Internet
Author: User

 

Overview and use of busybox

1. Overview of busybox

Busybox is a software that integrates more than one hundred common Linux commands and tools. It even integrates an HTTP server and a Telnet server, all these functions only have a size of about 1 MB. the Linux commands we usually use are like vertical electronic components, while busybox is like an integrated circuit, which compresses the integration of common tools and commands into an executable file, functions remain unchanged, but the size is many times smaller. In Embedded Linux applications, busybox has a wide range of applications. In addition, busybox appears in most installation programs of Linux releases, when Linux is installed, CTRL + ALT + F2 can get a console, and all commands in this console are links to busybox.

Busybox's small body makes Linux a floppy disk and makes it easy.

Ii. busybox usage

You can use busybox

# Busybox ls

Its function is equivalent to running the LS command.

The most common method is to create a link pointing to busybox. Different link names are used to complete different functions.

# Ln-s busybox ls

# Ln-s busybox RM

# Ln-s busybox mkdir

Then run the three links respectively:

#./Ls

#./RM

#./Mkdir

The functions of the ls rm and mkdir commands can be completed separately, although they all point to the same executable program busybox

However, as long as the link names are different, the functions are different and busybox is so amazing.

Many Linux websites provide download of busybox source code. The current version is the official version of busybox1.0.

3. Configure busybox

Busybox configuration programs and Linux kernel menu configuration methods are exactly the same. It is easy for anyone familiar with Linux Kernel configuration using make menuconfig.

# Cpbusybox-1.00.tar.gz/babylinux

# Cd/babylinux

# Tar xvfz busybox-1.00.tar.gz

# Cd busybox-1.00

# Make menuconfig

The following are functional options that need to be compiled into busybox. Other options can be customized as needed, but do not be greedy.

General configuration options

Show verbose applet usage messages

Runtime SUID/SGID configuration via/etc/busybox. conf

Build options

Build busybox as a static binary (no shared libs)

This option must be selected so that busybox can be compiled into a static link executable file, and the runtime is independent of other function libraries. otherwise, other library files must be required to run and cannot work properly on a single Linux kernel.

Installation Options

Don't use/usr

This option must also be selected. Otherwise, after make install, busybox will be installed in the/usr of the original system, which will overwrite the original command of the system. after this option is selected, make install will generate a directory named _ install under the busybox Directory, which contains busybox and its link.

Other options are some basic Linux Command Options. You can compile the commands you need. Generally, you can use the default command.

After configuration, exit and save.

4. Compile and install busybox

# Make

# Make install

After compilation, generate the subdirectory _ install in the busybox directory. The content is as follows:

Drwxr-XR-x 2 root Root 4096 November 24 15:28 Bin

Lrwxrwxrwx 1 Root 11 November 24 15:28 linuxrc-> bin/busybox

Drwxr-XR-x 2 root Root 4096 November 24 15:28 sbin

The executable file busybox is in the bin directory, and others point to its symbolic link.

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.