I. Definition and version of busybox
We want to use a software to create a micro-Linux. Here we talk about busybox. First, we need to know what busybox is? Busybox is a software that contains many common Linux commands and tools, such as ls, cp, echo, grep, and mount.
We need to build a program. After compilation, many library files are required for this program to run. We need to port this command to the system, copy the library files it depends on so that it can run normally. We need to port bash in the small Linux we made earlier. We should first use ldd to view the library on which it depends, because we use dynamic connection to compile the program. In fact, we can also directly compile the library it depends on into this program, which may increase the size of our program, but we can directly use it wherever we move it, because the dependent databases are directly included. When we compile busybox, we compile it into a static method when directly compiling busybox to simplify the porting process as much as possible, directly add the library it depends on to busybox. Check the version of busybox. The latest stable version of busybox is BusyBox 1.20.2 (stable). The latest version of the development version is BusyBox 1.21.0 (unstable ). Here we use a stable version.
First, we need to attach an IDE hard disk to the original virtual machine, and divide it into two zones:/dev/hda1 and/dev/hda2. Create the directory/mnt/boot AND/mnt/sysroot, and mount/dev/hda1 and/dev/hda2 to/mnt/boot AND/mnt/sysroot respectively. (In this process, the detailed version is provided when a simple Linux is created. In the same place, the/dev/hda1 and/dev/hda2 are suspended in the/etc/fstab file, run mount to check whether the instance is suspended)
Here we can download the stable version of BusyBox 1.20.2 (stable) on our server ). Next we will start to demonstrate this process.
Ii. Loading microlinux
1. Prepare the development environment. [Note: A development environment is required]
To install the development environment, you need to use the yum library. I have mentioned the installation of the yum library. Here we will describe how to install the development environment. We will first use yum grouplist to check whether the development environment is installed, if you have installed busybox, download busybox in step 2. If you have not installed busybox, install "Development Tools" and "Development Libraries ", use yum groupinstall "Development Tools" and "Development Libraries" to install the tool. [Note: it takes some time to install it. Please wait.] After the installation is complete, we will start to download busybox step 2.
2. start downloading busybox
Here we can download the stable version of BusyBox 1.20.2 (stable) on our server ). The download command is the get busybox-1.20.2.tar.bz2
After downloading, decompress busybox and enter busybox before compiling. The compiling method is the same as that of the kernel. Run make menuconfig first. [Note: when executing make menuconfig, do not shrink the screen too small. An error will be reported. I will not demonstrate it here. If you are interested, try it ], we also mentioned in advance that it can imitate many names, so we need to make some choices. It is too troublesome to select one by one, so it gives us a directory.