 |
- open device file->/dev/mtdblock1 and get file length 2048k
- map device file into virtual memory, the size is 2048k
- open new jffs2 root file(only file), read its content very time with getpagesize(64k),
- write new jffs2 content into map memory address, add one byte sizeof(char) step by step:
*pvirtualaddr++ = *pnewjffs2++;
- munmap, write back into file and close all resource.
sometimes, it works well and finishes re-write content, but sometimes it will write bad jffs2 inode leading not to mount root file system, why ? and other method does this ?
Thank you .
advan
|
|
 |