参考

http://blog.csdn.net/chongzi865458/article/details/6799258

ubiattach version 1.0 - a tool to attach MTD device to UBI.
Usage: ubiattach  <UBI control device node file name> 
[-m <MTD device number>] [-d <UBI device number>]
[--mtdn=<MTD device number>] [--devn <UBI device number>]

Example 1: ubiattach /dev/ubi_ctrl -m 0 - attach MTD device 0 (mtd0) to UBI
Example 2: ubiattach /dev/ubi_ctrl -m 0 -d 3 - attach MTD device 0 (mtd0) to UBI and  create UBI device number 3 (ubi3)

-d, --devn=<UBI device number>  the number to assign to the newly created UBI       device(the number is assigned automatically if this is not specified)
-m, --mtdn=<MTD device number>  MTD device number to attach
-O, --vid-hdr-offset            VID header offset (do not specify this unless you really know what you do and the optimal defaults will be used)
-h, --help                      print help message
-V, --version                   print program version

ubimkvol version 1.0 - a tool to create UBI volumes.
Usage: ubimkvol <UBI device node file name> [-h] [-a <alignment>] [-n <volume ID>] [-N <name>] [-s <bytes>] [-S <LEBs>] [-t <static|dynamic>] [-V] [-m] [--alignment=<alignment>][--vol_id=<volume ID>] [--name=<name>] [--size=<bytes>] [--lebs=<LEBs>] [--type=<static|dynamic>] [--help] [--version] [--maxavsize]

Example: ubimkvol/dev/ubi0 -s 20MiB -N config_data - create a 20 Megabytes volume named "config_data" on UBI device /dev/ubi0.

-a, --alignment=<alignment>   volume alignment (default is 1)
-n, --vol_id=<volume ID>      UBI volume ID, if not specified, the volume ID
will be assigned automatically
-N, --name=<name>             volume name
-s, --size=<bytes>            volume size volume size in bytes, kilobytes (KiB)
or megabytes (MiB)
-S, --lebs=<LEBs count>       alternative way to give volume size in logical
eraseblocks
-m, --maxavsize               set volume size to maximum available size
-t, --type=<static|dynamic>   volume type (dynamic, static), default is dynamic
-h, -?, --help                print help message
-V, --version                 print program version

The following is a compatibility option which is deprecated, do not use it
-d, --devn=<devn>             UBI device number - may be used instead of the UBI
device node name in which case the utility assumes
that the device node is "/dev/ubi<devn>"

ubidetach version 1.0 - a tool to remove UBI devices (detach MTD devices from UBI)
Usage: ubidetach<UBI control device node file name> [-d <UBI device number>] [-m <MTD device number>] [--devn <UBI device number>] [--mtdn=<MTD device number>]
Example 1: ubidetach /dev/ubi_ctrl -d 2 - delete UBI device 2 (ubi2)
Example 2: ubidetach /dev/ubi_ctrl -m 0 - detach MTD device 0 (mtd0)

-d, --devn=<UBI device number>  UBI device number to delete
-m, --mtdn=<MTD device number>  or altrnatively, MTD device number to detach -
this will delete corresponding UBI device
-h, --help                      print help message
-V, --version                   print program version

ubiformat version 1.0 - a tool to format MTD devices and flash UBI images
Usage: ubiformat <MTD device node file name> [-h] [-V] [-y] [-q] [-v]
[-x <num>] [-E <value>] [-s <bytes>] [-O <offs>] [-n]
[--help] [--version] [--yes] [--verbose] [--quiet]
[--ec=<value>] [--vid-hdr-offset=<offs>]
[--ubi-ver=<num>] [--no-volume-table]
Example 1: ubiformat /dev/mtd0 -y - format MTD device number 0 and do not ask questions.
Example 2: ubiformat /dev/mtd0 -q -e 0 - format MTD device number 0, be quiet and force erase counter value 0.

-s, --sub-page-size=<bytes>  minimum input/output unit used for UBI
headers, e.g. sub-page size in case of NAND
flash (equivalent to the minimum input/output
unit size by default)
-O, --vid-hdr-offset=<offs>  offset if the VID header from start of the
physical eraseblock (default is the next
minimum I/O unit or sub-page after the EC
header)
-n, --no-volume-table        only erase all eraseblock and preserve erase
counters, do not write empty volume table
-f, --flash-image=<file>     flash image file
-e, --erase-counter=<value>  use <value> as the erase counter value for all
eraseblocks
-y, --yes                    assume the answer is "yes" for all question
this program would otherwise ask
-q, --quiet                  suppress progress percentage information
-v, --verbose                be verbose
-x, --ubi-ver=<num>          UBI version number to put to EC headers
(default is 1)
-h, -?, --help               print help message
-V, --version                print program version

使用实例
将一个MTD分区挂载为UBIFS格式

● flash_eraseall /dev/mtd5 //擦除mtd5 
● ubiattach /dev/ubi_ctrl -m 5 -d 0 //UBI和mtd5关联 ->ubi0
● ubimkvol /dev/ubi0 -n 0 -N rootfs0 -s 256MiB //创建分区ubi0_0设定volume 大小

● mount -t ubifs ubi0_0 /mnt/ubi或mount -t ubifs ubi0:rootfs0 /mnt/ubi //挂载

烧写UBIFS文件系统映像

U-Boot烧写ubifs:(mmc)

#mmcinit
#fatload mmc 0:1 81000000 ubi.img
#nand unlock
#nand ecc sw
#nand erase 680000 7980000
#nand write.i 81000000 680000 $(filesize)

NFS文件系统上烧写

法一,使用 ubiformat工具

./ubiformat -q /dev/mtd5 -f ubi.img

法二,不必烧写映像,将ROOTFS打包,解压到UBIFS

ubiattach /dev/ubi_ctrl -m 5 -d 0

ubimkvol /dev/ubi0 -n 0 -N rootfs -s 128MiB

mount -t ubifs ubi0_0 /mnt/ubi0

tar -jxv -C /mnt/ubi0 rootfs.tar.bz2

umount /mnt/ubi0

UBI文件系统启动

设置UBIFS文件系统作为根文件系统启动的参数

#setenv bootargs console=ttyAM0,115200n8 ubi.mtd=5 root=ubi0:rootfs rootfstype=ubifs init=linuxrc 
# setenv bootcmd nand read.i 80300000 280000 200000\;bootm 80300000

UBIFS分区制作及UBIFS烧写和启动的更多相关文章

  1. linux 对MTD分区nand flash的烧写和读取

    使用mtd-utils工具实现对flash的升级分区的烧写yaffs2 yaffs2的格式是根据所使用的nandflash来制作的,不同的nandflash,得到的yaffs2是不一样的,具体可以参考 ...

  2. tiny210V2 Uboot kernel filesystem 烧写和启动

    1.sd启动 将u-boot镜像写入SD卡 将SD卡通过读卡器接上电脑(或直接插入笔记本卡槽),通过"cat /proc/partitions"找出SD卡对应的设备,我的设备节点是 ...

  3. 1.移植3.4内核-分析内核启动过程,重新分区,烧写jffs2文件系统

    1.在上章-移植uboot里.我们来分析下uboot是如何进入到内核的 首先,uboot启动内核是通过bootcmd命令行实现的,在我们之前移植的bootcmd命令行如下所示: bootcmd=nan ...

  4. Davinci DM6446开发攻略-UBOOT-2009.03移植2 nand flash的烧写

      很长一段时间没有更新博客了,是因为要推出新开发方案和做好客户服务工作,忙得不易乐乎.有关DAVINCI U-BOOT的移植,以前写过一篇u-boot-1.3.4(2008年的),其实和这个u-bo ...

  5. DM6446开发攻略:UBOOT-2009.03移植及nand flash烧写

    有关DAVINCI U-BOOT的移植,以前写过一篇u-boot-1.3.4(2008年的),其实和这个u-boot-2009.03差别不大,只不过这个u-boot-2009.03是从TI的网站上下载 ...

  6. sd卡脱机烧写系统的方法(测试成功)

    一.sd卡烧写系统的基本思路: (1)把uboot.bin烧写到sd卡 (2)把image整个文件夹复制到sd卡 (3)开发板从sd卡启动,就开始自动烧写到nandflash中了. 二.烧写uboot ...

  7. uboot烧写命令--yaffs、jiffs和ubifs

    如果要烧写的镜像的格式是yaffs2或者yaffs格式的,那么在往Nand Flash中烧写该镜像是必须采用nand write.yaffs,而不能采用nand write: nand write.y ...

  8. 嵌入式:使用dd命令制作烧写文件

    1. 使用dd命令制作烧写文件 环境: bootargs=mem=64M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=jffs2 mtd ...

  9. 2.移植3.4内核-支持烧写yaffs2,裁剪内核并制作补丁

    在上章-制作文件系统,并使内核成功启动jffs2文件系统了 本章主要内容如下: 1)使内核支持yaffs2文件系统 2)裁剪内核 3)制作内核补丁 1.首先获取yaffs2源码(参考git命令使用详解 ...

随机推荐

  1. HDU 4027 Can you answer these queries(线段树 + 观察 )

    这题主要考察观察能力. 2^63最多只需要开7次根号就会变成1,当数字变成1之后就不需要再对其进行操作. 对于含有大于1数字的区间,向下更新. 对于数字全为1的区间,直接返回. #include &l ...

  2. Struts2基本程序演示

    Struts2启动配置 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns=" ...

  3. easyui中的依赖关系

    参考自:http://www.easyui.info/archives/765.html 在使用easyui的过程中发现各个组件直接存在依赖关系,也就是上层的复杂组件依赖于一个或者多个简单组件,复杂组 ...

  4. [CF522D]Closest Equals

    题目大意:给一个区间,多次询问,每次问区间$[l,r]$里最近的两个相同的数的距离是多少. 题解:用一个数组$pre_i$表示第$i$个数前面最近的一个相同的数在哪,询问变成了询问$[l,r]$中$i ...

  5. BZOJ 3223 Tyvj 1729 文艺平衡树 | Splay 维护序列关系

    题解: 每次reverse(l,r) 把l-1转到根,r+1变成他的右儿子,给r+1的左儿子打个标记就是一次反转操作了 每次find和dfs输出的时候下放标记,把左儿子和右儿子换一下 记得建树的时候建 ...

  6. chrome性能指标(TTFB,TTSR,TTDC,TTFL)

    1.TTFB (Time To First Byte) 是最初的网络请求被发起到从服务器接收到第一个字节这段时间,它包含了 TCP连接时间,发送HTTP请求时间和获得响应消息第一个字节的时间. 注意: ...

  7. mysql外网链接

    1:设置mysql的配置文件     /etc/mysql/my.cnf     找到 bind-address  =127.0.0.1  将其注释掉://作用是使得不再只允许本地访问:  重启mys ...

  8. xmlSerializer属性的使用

    学习了XmlAttribute,XmlElement属性的定义和使用. Order类定义 using System; using System.Collections.Generic; using S ...

  9. bzoj 1579: [Usaco2009 Feb]Revamping Trails 道路升级——分层图+dijkstra

    Description 每天,农夫John需要经过一些道路去检查牛棚N里面的牛. 农场上有M(1<=M<=50,000)条双向泥土道路,编号为1..M. 道路i连接牛棚P1_i和P2_i ...

  10. ping & traceroute 原理

    说明: 忘记从哪里看到的原文了. 不过我应该进行了大刀阔斧的删选. ping 用类型码为0的ICMP发请 求,受到请求的主机则用类型码为8的ICMP回应. ping程序来计算间隔时间,并计算有多少个包 ...