1_5.4.3_Root file system_Building the root file system busybox_P

Publisher:剑戟辉煌Latest update time:2021-08-21 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Before building the root file system, compile busybox first.


Check the readme to see if there is any information on how to compile it. There is some introduction about busybox, such as what is busybox.

insert image description here

How to use busybox.

insert image description here

I didn't see any explanation on how to compile. Looking at the install file, I can see that the method of compiling busybox is similar to compiling the Linux kernel, which is to configure first and then compile with make. It should be noted that if you execute make install directly, it will be installed on the PC by default. We need to specify the installation address additionally.


That is, execute the make CONFIG_PREFIX=/path/from/root install after # and install it to the location we specified.

insert image description here

Execute make menuconfig in the busybox directory and perform the configuration first.

insert image description here

We want to compile for embedded systems, so let's configure the cross-compilation compiler first. There is no cross-compilation setting in the busybox configuration item, so let's take a look at the Makefile.


Generally speaking, cross-compiled variables all start with CROSS. Search for CROSS and you will find a CROSS_COMPILE variable.

insert image description here

No option to configure CROSS_COMPILE was found, so we configure it directly here, or we can execute make CROSS_COMPILE=arm-linux-. Both methods are the same, configuring CROSS_COMPILE to arm-linux-.

insert image description here

Then there is a tab completion function, which is not available in busybox by default. We need to set it up so that it will be more convenient to operate busybox in the future. The path to this function is as follows:


Busybox Settings

Busybox Library Tuning

Tab completion

insert image description here
insert image description here
insert image description here

Then, we use two sources of C library, one is glibc and the other is uclibc. When using glibc, there will be a warning message if it is statically linked.

insert image description here

In make menuconfig, set this item to empty, indicating that it is not selected.

insert image description here

After the configuration is complete, you can compile it. Note that you need to use the make option in the install file and change the address to the place you want to download.

insert image description here

Create a 046 folder to store the files after busybox is installed.

insert image description here

Execute the following command in the busybox directory.


make CONFIG_PREFIX=/home/book/Desktop/test/046_first_fs/ install

insert image description here

Check the 046 folder and you will find that there is already a bin directory.

insert image description here

As you can see, they are all links to busybox.

insert image description here

Looking at linuxrc, I see that it is also a link to busybox.

insert image description here

Reference address:1_5.4.3_Root file system_Building the root file system busybox_P

Previous article:1_5.4.2_Root file system_Analysis of init process for building root file system_P
Next article:1_5.4.4_Root file system_Building the root file system_Building the root file system_P

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号