1. Create the root file system structure # mkdir rootfs (which I created directly in the root directory) # cd rootfs # mkdir bin Dev etc lib proc sbin tmp usr var # chmod 1777 TMP # mkdir usr/bin usr/lib usr/sbin # mkdir var/lib var/lock var/log var/run var/tmp # chmod 1777 var/tmp 2 prepare the Link Library # cd $ {obj_lib}/lib ($ {obj_lib} is the directory of the Cross-compilation environment) # For file in libc libcrypt libdl libm \> libpthread libresolv libutil> do> CP $ file -*. so/home/Fortis/rootfs/lib (because the link is established in the root directory, this is CP $ file -*. so/rootfs/LIB)> CP-d $ file. so. [* 0-9]/home/Fortis/rootfs/lib (same as above)> done # cp-d ld *. so */home/Fortis/rootfs/lib 3 Use busybox to create System Applications Program 3.1 download busybox (http://www.busybox.net/) and unzip it. 3.2 enter the decompressed directory, configure busybox $ make menuconfig busybox Settings> general configuration> [*] Support for devfs build Options> [*] Build busybox as a static binary (no shared libs) /* compile busybox as a static connection, which reduces the trouble of finding a dynamic library during startup */[*] Do you want to build busybox with a cross compiler? (/Usr/local/ARM/3.3.2/bin/armlinux) cross Compiler prefix/* specifies the path of the Cross-compilation tool */init utilities> [*] init [*] Support reading an inittab file/* supports init to read the/etc/inittab configuration file, be sure to select */Shells> choose your default shell (Ash)>/* (x) ash to select ash, in this way, the bin/sh file will be generated *. Let's look at the first line of the linuxrc Script :*#! /Bin/sh is interpreted and executed by bin/sh */[*] Ash coreutils> [*] CP [*] cat [*] ls [*] mkdir [*] echo (Basic susv3 version taking no options) [*] env [*] MV [*] PWD [*] RM [*] Touch editors> [*] vi Linux system utilities> [*] Mount [*] umount [*] Support loopback mounts [*] Support for the old/etc/mtab file networking utilities> [*] inetd/** support for inetd super server */3.3 compilation and installation of busybox (if busybox compile a compilation tool) $ make T Arget_arch = arm cross = armlinux \ prefix =/home/ARM/dev_home/rootfs/my_rootfs/all install prefix specifies the installation path: the path of our root file system. 4. You can directly copy the required device files on the host, or create several files on the host. # Cd rootfs/dev # mknod-m 600 console C 5 15 create the linuxrc file as follows: $ Vim rootfs/linuxrc #! /Bin/shecho "Hello Linux, gggggg" exec/sbin/init and then modify the permission: chmod 775 linuxrc 6: Create the initrd image file # mkdir initrd # dd If =/dev/Zero of = initrd. img bs = 1 k count = 8192 #/sbin/mke2fs-F-v-M0 initrd. IMG # Mount-o loop initrd. IMG initrd # cp-AV rootfs/* initrd # umount # gzip-9 initrd. IMG from: http://blog.csdn.net/lyw2698/article/details/1921033
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.