Building the root filesystem of Linux 20160611

Source: Internet
Author: User
Tags git clone

Let's talk about the construction of the LINUX root file system:

Making a file system

1. cross-compiling busybox

Install: Makeinstall config_prefix=/work/nfs_root/fs_mini_mdev_new

2. Installation Library

Mkdir/work/nfs_root/fs_mini_mdev_new/lib

Mkdir/work/nfs_root/fs_mini_mdev_new/usr/lib-p

cp/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/*so*/work/nfs_root/fs_mini_mdev_new/lib-d

cp/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/usr/lib/*so*/work/nfs_root/fs_mini_mdev_new/usr/lib- D

3. build etc directory

4. build the dev directory

5. Other Empty directories

Mkfs.jffs2-n-S 2048-e 128kib-d fs_mini_mdev_new-o FS_MINI_MDEV_NEW.JFFS2

Burn write:

NFS 30000000 192.168.1.123:/WORK/NFS_ROOT/FS_MINI_MDEV_NEW.JFFS2

NAND Erase.part Rootfs

NAND WRITE.JFFS2 30000000 260000 $filesize

Set Bootargs console=ttysac0,115200 root=/dev/mtdblock3 ROOTFSTYPE=JFFS2

NFS 32000000 192.168.1.123:/work/nfs_root/uimage_new

Bootm 32000000

Sigill Illegal Instruction

6. reconfigure kernel support EABI

Set Bootargs console=ttysac0,115200 root=/dev/mtdblock3 ROOTFSTYPE=JFFS2

NFS 32000000 192.168.1.123:/work/nfs_root/uimage_eabi

Bootm 32000000

Three . porting yaffs File System

1. access to source code

git clone git://www.aleph1.co.uk/yaffs2

2. Patching

CD Yaffs-dir

./patch-ker.sh C M Linux-tree such as ./patch-ker.sh C m/work/system/linux-3.4.2

3. Configuring kernel support yaffs

4. compiling and using uimage

5. make, burn and write yaffs Images

Mkyaffs2image fs_mini_mdev_new FS_MINI_MDEV_NEW.YAFFS2

Uboot

NFS 30000000 192.168.1.123:/WORK/NFS_ROOT/FS_MINI_MDEV_NEW.YAFFS2

NAND Erase.part Rootfs

NAND write.yaffs 30000000 260000 $filesize

6. Start

Set Bootargs console=ttysac0,115200 Root=/dev/mtdblock3

NFS 32000000 192.168.1.123:/work/nfs_root/uimage_yaffs

Bootm 32000000

7. unsuccessful, use alternative method to find the problem

7.1 UBOOT may have a problem: change to 1.1.6 UBOOT

TFTP 30000000 U-boot.bin

NAND Erase.part U-boot

NAND write 30000000 U-boot

Reset

NFS 30000000 192.168.1.123:/WORK/NFS_ROOT/FS_MINI_MDEV_NEW.YAFFS2

NAND Erase Rootfs

NAND write.yaffs 30000000 260000 $ (filesize)

Set Bootargs console=ttysac0,115200 Root=/dev/mtdblock3

NFS 32000000 192.168.1.123:/work/nfs_root/uimage_yaffs

Bootm 32000000

Found 1.1.6 UBOOT No problem, so is our transplant new UBOOT has a BUG:

Drivers\mtd\nand\nand_util.c

if (!need_skip &&!) ( Flags & With_drop_ffs)) {

Switch

if (!need_skip &&!) ( Flags & with_drop_ffs) &&! (Flags & With_yaffs_oob)) {

There may be a problem with 7.2 yaffs image

Made the u-boot_new.bin, uimage_new, Fs_mini_mdev_new.yaffs

To re-burn the entire system:

Burn u-boot_new.bin with the jtag tool

or use uboot to update yourself : TFTP 30000000 u-boot_new.bin; NAND erase.part u-boot; NAND write 30000000 U-boot

Start uboot, use it to burn the kernel,FS

TFTP 30000000 uimage_new; NAND Erase.part kernel; NAND write 30000000 kernel

TFTP 30000000 FS_MINI_MDEV_NEW.YAFFS2; NAND Erase.part Rootfs; NAND write.yaffs 30000000 260000 $filesize

Setting parameters

Set ' NAND read 30000000 Kernel;bootm 30000000 '

Set Bootargs console=ttysac0,115200 Root=/dev/mtdblock3

Set Machid 16a

Save

Using Kernel patches:

Patch-p1 <. /linux-3.4.2_100ask.patch

CP config_ok. config

Make Uimage

Accompanying author study notes:

1.busybox installation, complete the second build init program that is busybox itself

2. build other basic three items:

3. Add PS and other commands:

4. join Udev that automatically creates the device node :

5. making file systems in other formats:

6. making the Network file system:

Building the root filesystem of Linux 20160611

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.