1, transplant Mtd-utils:
A) download utd-utils for ftp://ftp.infradead.org/pub/mtd-utils/
b) Cross-compiling mtd-utils
I modify makefile cross=arm-linux-
II Make
III See if we have the big tools we need under the mtd-utils-1.0.0 directory.
(Flashcp,nandwrite ... , etc.). There are tools generated, OK, cross-compilation successful.
IV Copy the resulting large tool to the filesystem board's root filesystem, either in/bin or/sbin.
2, SD card burning
A) on a Linux-installed PC, a blank SD card is divided into 2 zones via Fdisk (if the SD card itself is already included, please remove all of the "D" commands from Fdisk) to get the following partition table:
Command (M for He LP): P
Di sk/dev/sdb:1030 MB, 1030225920 byte s
He ads, se c tor s/t rack, 1014 cyl Inde R S
Uni t s = cyl Inde R S of 1984 * 1015808 Byt e s
Di SK ident I f IE r:0x6f20736b
Devic eboot Sta R t End Blocks Id Sys tem
/DEV/SDB1 * 1 19809 Linux
/DEV/SDB2 1014 986048 Linux
Note the commands produced by the 1th partition are:
Command (M for He LP): N
Command a C t ion
E ext Ended
P Primary Partit Ion (14)
P
Partition Numbe R (1-4): 2
Firs T Cyinde R (11014, Defaul t 21):
Using Defaul T Value 21
Last cyl inder, +cyl Inde rs or +s ize{k,m,g} (11014,defaul t 1014): 20M
The commands made by the 2nd partition are:
Command (M for He LP): N
Command Action
E ext Ended
P Primary partition (14)
P
Partition Numbe R (14): 2
Firs T cyl Inde r (211014) Defaul t 21):
Us ing defaul t value 21
La St Cyl Inder, +cyl Inde R S or +s iz e{k,m,g} (211014,de Faul t 1014):
Us ing defaul t value 1014
Command (M for He LP):
We also want to mark the 1th partition with the "a" command:
Command (M for He LP): A
Pa rtition Numbe R (14): 1
Finally, the built partition table is written to the SD card via the "W" command.
b) format the SD card partition 1 and partition 2:
Mkfs. VFA t/dev/sdb1 mkfs. EXT3/DEV/SDB2 FSCK.EXT3/DEV/SDB2
c) write the SD card UBOOT and zimage by Movinand_fusing_tool.exe:
The method of updating the SD card root file system is simple, after mount/dev/sdb2 on the PC machine, directly through
The CP FA <your rootfs> </your rootfs> Way to replace the root filesystem. Is the directory of your root filesystem and is your/DEV/SDB2 mount directory. In particular, the SD device node is not necessarily/dev/sdb, it should be based on the user's computer hard disk conditions, may be/DEV/SDC,/DEV/SDD and so on.
<new_rootfs_di r> </new_rootfs_di r>
<your rootfs> </your rootfs>
3. Nand Burn
A) Update NAND version Uboot
First copy the Uboot to the SD card root file system on the computer, then run # f LASHCP ubootmovi.bin/dev/mtd0;
b) Update the Linux kernel in the NAND partition
Create a Fix-image script with the following content:
RM Arch/arm/boot/zimage-fix;
DD if=arch/arm/boot/zimage of=arch/arm/boot/zimage-fix bs=2048 count=4096 conv=sync;
chmod 755 Arch/arm/boot/zimage-fix;
Compiling the kernel
Note perform the last step./fix-image script, copy the compiled zimage-fix to the SD card root file system; Run: # flashcp zimage-f ix/dev/mtd1;
c) Update the file system in the NAND partition
Copy the new root file system on the PC into a directory on the SD card, and we will refer to that directory.
To boot the system with an SD card or NFS root file system, run the following command to erase the DEV/MTD2 partition: # FLASH_ERASEALL/DEV/MTD2; then mount the NAND partition to/mnt: # Mount/dev/mtdblock2 T yaffs2/mnt copy the new file system to the/MNT:
# CP FA <new_rootfs_di r>/mnt;</new_rootfs_di r>
Download Uboot, Linux kernel and file system with SD card