Create a jffs2 root file system

Source: Internet
Author: User

 

1. Create The mkfs. jffs2 Tool 

First, you have to prepare two software packages.

Steps:
(1)decompress zlib-1.2.3.tar.tar,

$ Tar xf zlib-1.2.3.tar.tar (library required during mkfs. jffs2 creation );
(2)extract mtd-snapshot-20050519.tar.tar

$ Tar xf mtd-snapshot-20050519.tar.tar
$ Ls

MTD mtd-snapshot-20050519.tar.tar zlib-1.2.3 zlib-1.2.3.tar.tar
(3) enter the unzipped directory zlib-1.2.3 to execute:
$ CD zlib-1.2.3/
$./Configure -- shared -- prefix =/usr/(put in the system directory );
(4) directly make and compile.
$ Make
(5) install the compiled library file:
$ Make install
(6) Compile and install the mkfs. jffs2 Tool

$ Cd mtd/util

$ Make

$ Make install (install the command to the System)

$ Which mkfs. jffs2

/Usr/sbin/mkfs. jffs2

2. Create a jffs2 File System

Then you can use the mkfs. jfss2 tool you have created to create a jfffs file system!

$Mkfs. jffs2-n-s 512-e 16kib-D filesys-O filesys. jffs2

Or $ mkfs. jffs2-r filesys-O filesys. jffs2-E 0X4000 -- pad = 0x800000-N (no matter how big the file system is, the -- pad = 0x800000 parameter is 8 MB)

Note:

In the preceding command, "-n" indicates not to add a clear sign to each erased block. "-S 512" indicates that the page size is 512 bytes, "-e 16kib" indicates that the size of an erased block is 16 KB, "-d" indicates the root file system directory, and "-o" indicates the output file (target file ). "-- Pad" indicates the size of the output file in hexadecimal format, that is, the size of filesys. jffs2.

Iii. jffs2 File System burning and writing

# TFTP 30008000 filesys. jffs2.

# NAND erase 200000 800000 (the partition where the root file system is located, displayed when the kernel is started)

# NAND write 30008000 200000 800000 (the address offset size of the NAND write download address)

Then set the uboot startup parameters.

# Setenv bootcmd TFTP 30800000 zimage \; go 30800000

# Setenv bootargs root =/dev/mtdblock2 init =/linuxrc rootfstype = jffs2 RW console = ttysac0, 115200

Mkfs. jffs2 usageOption meaning ( Man a mkfs. jffs2)

Mkfs. jffs2: Usage: mkfs. jffs2 [Options] Make A jffs2 file system image from an existing Directory treeoptions:

-P, -- pad [= size] indicates the size of the file to be output in hexadecimal format, that is, the size of root. jffs2. It is very important that, in order not to waste flash space, this value should best meet the block size specified by the Flash Driver. If it is not enough, use 0xff to fill in the full.

-R,-D, -- root = dir specifies the original folder of the image to be made. (default: current folder)

-S, -- pagesize = size node page size (default: 4kib)

-E, -- eraseblock = size: set the size of the erased block to (default: 64kib)

-C, -- cleanmarker = size of cleanmarker (default 12)

-M, -- compr-mode = mode select compression mode (default: priortiry)

-X, -- disable-compressor = compressor_name disable a compressor

-X, -- enable-compressor = compressor_name enable a compressor

-Y, -- compressor-priority = Priority: compressor_name set the priority of a compressor

-L, -- list-compressors show the list of the avaiable Compressors

-T, -- Test-compression call decompress and compare with the original (for test)

-N, -- no-cleanmarkers indicates that the clear mark is not added (NAND Flash has its own checklist to store relevant information .) If the class is like cleanmarker node found at 0x0042c000 has totlen 0xc! = Normal 0x0 warning, plus-N will disappear.

-O, -- output = file specifies the file name of the output image file. (default: stdout)

-L, -- little-Endian specifies to use the small-end format-B, -- big-Endian specifies to use the large-end format

-D, -- devtable = file use the named file as a device table File

-F, -- faketime change all file times to '0' for regression testing

-Q, -- squash permissions and owners making all files be owned by root

-U, -- squash-UIDs: Set the owner of all files as the root user.

-P, -- squash-perms squash permissions on all files

-- With-xattr stuff all xattr entries into image

-- With-SELinux stuff only SELinux labels into jffs2 Image

-- With-POSIX-ACL stuff only posix acl entries into jffs2 Image

-H, -- help display the text

-V, -- verbose operation

-V, -- version display version

-I, -- incremental = File Parse file and generate appendage output for it

 

 

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.