luther@gliethttp:/vobs # mkfs.jffs2 -s 0x1000 -e 0x40000 -p 0x500000 -r /vobs/hald -o /vobs/tftp-dir/gliethttp.jffs2
页大小0x1000 4k
块大小0x40000 256k
jffs2分区总空间0x500000即5M
当然生成的test.img.jffs2并没有一下子分配5M,还是实际大小0xc0000
# cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00040000 "RedBoot"
mtd1: 00200000 00040000 "zImage"
mtd2: 001c0000 00040000 "initramfs"
mtd3: 000c0000 00040000 "gliethttp.jffs2"
mtd4: 00001000 00040000 "RedBoot config"
mtd5: 00040000 00040000 "FIS directory"
# mount -t jffs2 /dev/mtdblock3 /mnt
mount: mounting /dev/mtdblock3 on /mnt failed: Invalid argument
需要擦出全部block才行.
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0x60000000 0x60000000 0x00040000 0x00000000
RedBoot config 0x61F80000 0x61F80000 0x00001000 0x00000000
FIS directory 0x61FC0000 0x61FC0000 0x00040000 0x00000000
initramfs 0x60240000 0x00800000 0x001C0000 0x00800000
zImage 0x60040000 0x00080000 0x00200000 0x00080000
RedBoot> load -v -r -b 0x80000 gliethttp.jffs2
Raw file loaded 0x00080000-0x0013ffff, assumed entry at 0x00080000
RedBoot> fis create -b 0x80000 -l 0x500000 -s 0xc0000 -f 0x60400000 gliethttp.jffs2
... Erase from 0x60400000-0x60900000: ....................
... Program from 0x00080000-0x00140000 at 0x60400000: ...
... Erase from 0x61fc0000-0x62000000: .
... Program from 0x03fbf000-0x03fff000 at 0x61fc0000: .
RedBoot> reset
进入开发板2.6.30.4内核
# cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00040000 "RedBoot"
mtd1: 00200000 00040000 "zImage"
mtd2: 001c0000 00040000 "initramfs"
mtd3: 00500000 00040000 "gliethttp.jffs2"
mtd4: 00001000 00040000 "RedBoot config"
mtd5: 00040000 00040000 "FIS directory"
# mount -t jffs2 /dev/mtdblock3 /mnt
# ls /mnt/
hald.tar.bz2 readme_hald.c
hald_gliethttp_log.c
# df /mnt
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mtdblock3 5120 1432 3688 28% /mnt
# /nfs/mkfs.jffs2.arm-linux-gcc.4.3.2/mtd_debug info /dev/mtd3
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NORFLASH
mtd.size = 5242880 (5M) // 本分区总大小为5M[luther.gliethttp]
mtd.erasesize = 262144 (256K) // flash块大小为256K
mtd.writesize = 1
mtd.oobsize = 0
regions = 0
OK,正常挂载jffs2文件系统.
--
Regards,
luther & gelithttp
阅读(2480) | 评论(1) | 转发(0) |