Creation of the root file system
Embedded systems contain multiple file systems but the first (root file system) is required.
First, create a directory
# mkdir Rootfs
# CD Rootfs
# mkdir Bin Dev etc lib proc sbin sys usr MNT tmp var
# mkdir Usr/bin usr/lib usr/sbin lib/modules
Second, create the device file
# CD Rootfs/dev
# MKNOD-M 666 Console C 5 1
# mknod-m 666 NULL C 1 3
which
Console is the name of the device
C refers to a character device
5 refers to the tag defined by the device in MAJOR.C
1 refers to the first device
Iii. Adding a preparation document
Here is the configuration file provided by the state , copy it to Linux and unzip it, and copy the whole content to the new Rootfs file system directory.
# tar Xvzf etc.tar.gz
# mv Xvzf etc/* .../rootfs/etc/-rf
Iv. adding kernel Modules
4.1 Enter the kernel file directory
#cd .../linux
4.2 Compiling kernel Modules
#make Modules Arch=arm cross_compile=arm-linux-
4.3 Install the kernel module under the new file system
Perform:
#make Modules_install Arch=arm Install_mod_path=/home/rootfs
The installation was successful as follows:
V. Compile and install BusyBox
BusyBox is a software that integrates more than 100 of the most commonly used Linux commands and tools. BusyBox includes simple tools such as LS, cat, and Echo, among others, including larger, more complex tools, such as grep, find, Mount, and Telnet. Some people refer to BusyBox as the Swiss Army knife in the Linux tool. Simply speaking, BusyBox is like a big toolbox, which integrates many of the tools and commands that have been built into Linux, as well as the self-contained shell of the Android system.
5.1 Configuring BusyBox
The busybox here is provided by the state-embedded video.
#make Menuconfig Arch=arm
Enter BusyBox Setting--
1. Enter Bulid options-->
Check build BusyBox as a static binary statically linked
Cross Compiler prefix (arm-linux-)
2. Enter Installation options-->
Select Don,t use/usr to avoid busybox Bai Anzhou to the/usr directory of the host system, destroying the host system
Busybox installation Prefix (/XXX/ROOTFS) This option indicates the installation location of the compiled Busybox
5.2 Compiling and installing BusyBox
Execution: Make
Execute: Make install for installation
Creation of the root file system