各参数的意义:(1)-r : 指定要做成image的源資料夾.
(2)-o : 指定輸出image檔案的文件名.
(3)-e : 每一塊要抹除的block size,預設是64KB.要注意,不同的flash, 其block size會不一樣.我的是三星的K9F1208U0B.
(4)--pad (-p): 用16進制來表示所要輸出檔案的大小,也就是root.jffs2的size。很重要的是, 為了不浪費flash空間, 這個值最好符合flash driver所規劃的區塊大小.以我的板子來說,就是5MB.
(5)如果挂载后会出现类似:CLEANMARKER node found at 0x0042c000 has totlen 0xc != normal 0x0 的警告,则加上 -n 就会消失。
(6) 还有的选项,自己看帮助!-h
不过,貌似网上记得有人说过,这样最好还是加上:
What is cleanmarker and what it is used for ?
Cleanmarker is a special JFFS2 node which is written to the beginning of
a block just after the block has been erased. On NOR flashes it is a
special small JFFS2 node at the beginning of the block. On NAND flashes
it is placed to the spare area of the first page.
The main reason why cleanmarkers are used is the need to be sure that
the block erase operation was correctly completed. All 0xFF bytes in the
block are not necessarily mean the block is ready to be utilized. For
example, if an unclean reboot happened just at the end of the block
erase cycle, the block might have unstable bits, which are read as "1"
one time and might be read as "0" next time.
When preparing a flash partition for JFFS2, it is recommended to put
cleanmarkers to the erased blocks. This might be done my means of "-j"
option of the "flash_eraseall" MTD utility. Otherwise, JFFS2 will re-
erase the blocks which contain all 0xFF and have no cleanmarker. This is
an unneeded wasting of time.
> Hi,
> I'm playing with jffs2 on NAND chips (Samsung 128Mbyte), MTD CVS is week
> old and kernel is 2.6.5.
>
> I'm making image with
> ./mkfs.jffs2 -b --eraseblock=131072 --pagesize=2048 -p -r /test_root -v -o
> test_root.img
>
> and then copy it with cp (nandwrite seems to have problems wiht endianess). > Everything work fine except on mounting filesystem I have messages:
>
> CLEANMARKER node found at 0x00000000 has totlen 0xc != normal 0x0
> CLEANMARKER node found at 0x00020000 has totlen 0xc != normal 0x0
> CLEANMARKER node found at 0x00040000 has totlen 0xc != normal 0x0
On NAND we store the cleanmarker (markes a clean erased block) in the out of
band area. So the cleanmarker node should be omitted when creating the fs
image. Add -n to the options