make jffs2 image

在 GM8181 的平台上 將 Apps 是放所有的 application。
在開機後,將它 mount 到 file system。再執行。
更新FW的方法有兩個:

1. 因為它是 file ,所以可以用 copy 方法更新。
2. 因為它是 MTD ,所以可以用 nandwrite 方法整個一起更新。

下面敘述 方法 2 的作法:

mkfs.jffs2 -r /mnt/mtd/ -o apps.jffs2 -e 0x00020000(不加 --pad 看來是沒問題的。)
flash_eraseall /dev/mtd9
nandwrite -p -f -m /dev/mtd9 /apps1.jffs2

Reference:
-----------------------------------------------------------------------------------------------------------------
/ # cat proc/mtd
dev: size erasesize name
mtd0: 00140000 00020000 "Loader"
mtd1: 00280000 00020000 "Burin Code"
mtd2: 00140000 00020000 "UBoot"
mtd3: 00500000 00020000 "Kernel"
mtd4: 00500000 00020000 "File System"
mtd5: 00280000 00020000 "Backup Burin Code"
mtd6: 00140000 00020000 "Backup UBoot"
mtd7: 00500000 00020000 "Backup Kernel"
mtd8: 00500000 00020000 "Backup File System"
mtd9: 06340000 00020000 "APPs"

-----------------------------------------------------------------------------------------------------------------
mkfs.jffs2: Usage: mkfs.jffs2 [OPTIONS]
Make a JFFS2 file system image from an existing directory tree
Options:
-p, --pad[=SIZE] Pad output to SIZE bytes with 0xFF. If SIZE is
not specified, the output is padded to the end of
the final erase block
-r, -d, --root=DIR Build file system from directory DIR (default: cwd)
-s, --pagesize=SIZE Use page size (max data node size) SIZE (default: 4KiB)
-e, --eraseblock=SIZE Use erase block size SIZE (default: 64KiB)
-c, --eraseblock-header=SIZE Size of eraseblock header (default 28)
-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-eraseblock-headers Don't add a eraseblock header to every eraseblock
-o, --output=FILE Output to FILE (default: stdout)
-l, --little-endian Create a little-endian filesystem
-b, --big-endian Create a big-endian filesystem
-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 Squash permissions and owners making all files be owned by root
-U, --squash-uids Squash owners making all files be owned by root
-P, --squash-perms Squash permissions on all files
-h, --help Display this help text
-v, --verbose Verbose operation
-V, --version Display version information
-i, --incremental=FILE Parse FILE and generate appendage output for it

留言

這個網誌中的熱門文章

NMEA標準格式 -- GPS

網路 Transformer 的用途

cut,sed,awk 字串處理