Creation of the root file system

Source: Internet
Author: User

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

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.