嵌入式 制作文件系统的JFFS2镜像
2013-12-02 14:44
711 查看
一、环境
Ubuntu 8.04
U-Boot 1.3.3(支持tftp)
二、过程
1、制作jffs2镜像需要使用mkfs.jffs2工具,首先 安装mkfs.jffs2工具
sudo apt-get installmtd-tools
2、退到已做好的rootfs目录的上一级
~/rootfs$ cd ..
#mkfs.jffs2 -r rootfs -orootfs.jffs2 -e 0x4000 --pad=0x500000 -s 0x200 -n
即可生成rootfs.jffs2
注:
各参数的意义:
(1)-r : 指定要做成image的目录名。
(2)-o : 指定输出image的文件名。
(3)-e : 每一块要擦除的block size,默认是64KB.要注意,不同的flash,其block size会不一样,这里用的是三星的K9F1208U0B。
(4)--pad (-p):用16进制來表示所要输出文件的大小,也就是rootfs.jffs2的size。很重要的是, 为了不浪费flash空间,这个值最好符合flash driver所规划的分区的大小。
(5)如果挂载后会出现类似:CLEANMARKER node found at0x0042c000 has totlen 0xc != normal 0x0 的警告,则加上-n 就会消失。
(6) 还有的选项,自己看帮助!-h
3、启动u-boot,将rootfs.jffs2下载到ram并烧写到nand flash的某个分区上。
nand flash 的分区为:
Creating 6 MTD partitions on "NAND 64MiB 3,3V8-bit":
0x00000000-0x00030000 : "bootloader"
0x00030000-0x00200000 : "kernel"
0x00200000-0x00400000 : "ramdisk"
0x00400000-0x00800000 : "cramfs"
0x00800000-0x01000000 : "jffs2"
0x01000000-0x04000000 : "data"
我们可以将rootfs.cramfs烧写到0x800000上,对应的结点为/dev/mtdblock/4。
tftp 32000000 rootfs.jffs2
nand erase 800000 1000000
nand write.jffs2 32000000 800000500000
4、要从cramfs启动,可将u-boot的启动参数改为:
root="/dev/mtdblock/4" rootfstype="jffs2" rwconsole="ttySAC0",115200 init="/linuxrc" noinitrdmem="64M"
即可。
注意:使用jffs2文件系统时,对内核进行配置时需要选上对jffs2的支持。
注:经验表明,如果jffs2分区太大,可能会出现以下问题:
jffs2: Erase block size too small (16KiB). Using virtual blockssize (32KiB) instead
Empty flash at 0x00003ffc ends at 0x00004000
Empty flash at 0x0000bffc ends at 0x0000c000
Empty flash at 0x00013ffc ends at 0x00014000
Empty flash at 0x0001bffc ends at 0x0001c000
Empty flash at 0x00023ffc ends at 0x00024000
Empty flash at 0x0002bf40 ends at 0x0002c000
Empty flash at 0x0003bffc ends at 0x0003c000
Empty flash at 0x00043fb0 ends at 0x00044000
Empty flash at 0x0004bf98 ends at 0x0004c000
Empty flash at 0x00053ffc ends at 0x00054000
Empty flash at 0x0005bfc8 ends at 0x0005c000
Empty flash at 0x00063fd0 ends at 0x00064000
Empty flash at 0x0006bf50 ends at 0x0006c000
Empty flash at 0x00073ffc ends at 0x00074000
Empty flash at 0x0007bf74 ends at 0x0007c000
如果需要在其它文件系统中挂载该jffs2文件系统,可以这样做
#cd /tmp
#mkdir jffs2
#mount -t jffs2 /dev/mtdblock/4 jffs2
Ubuntu 8.04
U-Boot 1.3.3(支持tftp)
二、过程
1、制作jffs2镜像需要使用mkfs.jffs2工具,首先 安装mkfs.jffs2工具
sudo apt-get installmtd-tools
2、退到已做好的rootfs目录的上一级
~/rootfs$ cd ..
#mkfs.jffs2 -r rootfs -orootfs.jffs2 -e 0x4000 --pad=0x500000 -s 0x200 -n
即可生成rootfs.jffs2
注:
各参数的意义:
(1)-r : 指定要做成image的目录名。
(2)-o : 指定输出image的文件名。
(3)-e : 每一块要擦除的block size,默认是64KB.要注意,不同的flash,其block size会不一样,这里用的是三星的K9F1208U0B。
(4)--pad (-p):用16进制來表示所要输出文件的大小,也就是rootfs.jffs2的size。很重要的是, 为了不浪费flash空间,这个值最好符合flash driver所规划的分区的大小。
(5)如果挂载后会出现类似:CLEANMARKER node found at0x0042c000 has totlen 0xc != normal 0x0 的警告,则加上-n 就会消失。
(6) 还有的选项,自己看帮助!-h
3、启动u-boot,将rootfs.jffs2下载到ram并烧写到nand flash的某个分区上。
nand flash 的分区为:
Creating 6 MTD partitions on "NAND 64MiB 3,3V8-bit":
0x00000000-0x00030000 : "bootloader"
0x00030000-0x00200000 : "kernel"
0x00200000-0x00400000 : "ramdisk"
0x00400000-0x00800000 : "cramfs"
0x00800000-0x01000000 : "jffs2"
0x01000000-0x04000000 : "data"
我们可以将rootfs.cramfs烧写到0x800000上,对应的结点为/dev/mtdblock/4。
tftp 32000000 rootfs.jffs2
nand erase 800000 1000000
nand write.jffs2 32000000 800000500000
4、要从cramfs启动,可将u-boot的启动参数改为:
root="/dev/mtdblock/4" rootfstype="jffs2" rwconsole="ttySAC0",115200 init="/linuxrc" noinitrdmem="64M"
即可。
注意:使用jffs2文件系统时,对内核进行配置时需要选上对jffs2的支持。
注:经验表明,如果jffs2分区太大,可能会出现以下问题:
jffs2: Erase block size too small (16KiB). Using virtual blockssize (32KiB) instead
Empty flash at 0x00003ffc ends at 0x00004000
Empty flash at 0x0000bffc ends at 0x0000c000
Empty flash at 0x00013ffc ends at 0x00014000
Empty flash at 0x0001bffc ends at 0x0001c000
Empty flash at 0x00023ffc ends at 0x00024000
Empty flash at 0x0002bf40 ends at 0x0002c000
Empty flash at 0x0003bffc ends at 0x0003c000
Empty flash at 0x00043fb0 ends at 0x00044000
Empty flash at 0x0004bf98 ends at 0x0004c000
Empty flash at 0x00053ffc ends at 0x00054000
Empty flash at 0x0005bfc8 ends at 0x0005c000
Empty flash at 0x00063fd0 ends at 0x00064000
Empty flash at 0x0006bf50 ends at 0x0006c000
Empty flash at 0x00073ffc ends at 0x00074000
Empty flash at 0x0007bf74 ends at 0x0007c000
如果需要在其它文件系统中挂载该jffs2文件系统,可以这样做
#cd /tmp
#mkdir jffs2
#mount -t jffs2 /dev/mtdblock/4 jffs2
相关文章推荐
- hi3531 SDK已编译文件系统制作jffs2文件系统镜像并解决问题 .
- 嵌入式文件系统镜像制作及烧写
- hi3531 SDK已编译文件系统制作jffs2文件系统镜像并解决问题
- 制作文件系统的JFFS2镜像
- hi3531 SDK已编译文件系统制作jffs2文件系统镜像并解决这个问题 .
- hi3531 SDK已编译文件系统制作jffs2文件系统镜像并解决问题 . 分类: arm-linux-Ubuntu HI3531 2014-06-18 08:45 951人阅读 评论(0) 收藏
- 嵌入式文件系统镜像制作及烧写
- hi3531 SDK已编译文件系统制作jffs2文件系统镜像并解决问题 .
- 嵌入式文件系统镜像制作及烧写
- 嵌入式文件系统镜像制作及烧写
- hi3531 SDK已编译文件系统制作jffs2文件系统镜像并解决问题 .
- hi3531 SDK已编译文件系统制作jffs2文件系统镜像并解决问题 .
- 嵌入式文件系统 jffs2, yaffs, cramfs, romfs, ramdisk, ramfs/tmpfs
- 嵌入式内核制作、根文件系统及内核启动流程
- linux文件系统移植和制作(jffs2文件系统)时的错误 /usr/bin/ld: cannot find -lc 改正
- 嵌入式系统文件系统比较 jffs2, yaffs, cramfs, romfs, ramdisk, ramfs/tmpfs (转)
- 嵌入式: jffs2,yaffs2,logfs,ubifs文件系统性能分析
- jffs2文件系统的制作
- 从零开始制作jffs2文件系统
- 用mkfs.jffs2 命令制作jffs2镜像文件 (转)