加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

U-Boot中ubi和ubifs命令的使用

发布时间:2020-12-15 07:08:12 所属栏目:百科 来源:网络整理
导读:(1)查看MTD分区表 [cpp] view plain copy print ? U-Boot$?mtdparts?? mtdparts?variable?not?set,?see? 'help?mtdparts' ?? no?partitions?defined?? ?? defaults:?? mtdids?:?nand0=nandflash0?? mtdparts:?mtdparts=nandflash0:1536k(bootloder),512k(p

(1)查看MTD分区表
[cpp] view plain copy print ?
  1. U-Boot$?mtdparts??
  2. mtdparts?variable?not?set,?see?'help?mtdparts'??
  3. no?partitions?defined??
  4. ??
  5. defaults:??
  6. mtdids?:?nand0=nandflash0??
  7. mtdparts:?mtdparts=nandflash0:1536k(bootloder),512k(params),4m(kernel),16m(safefs),-(rootfs)??

?

(2)载入默认分区表

?U-Boot$ mtdparts default

(3)激活分区

U-Boot$ ubi part safefs

[cpp] view plain copy print ?
  1. Creating?1?MTD?partitions?on?"nand0":??
  2. 0x000000600000-0x000001600000?:?"mtd=3"??
  3. device_name0:mtd=3??
  4. UBI:?attaching?mtd1?to?ubi0??
  5. UBI:?physical?eraseblock?size:?131072?bytes?(128?KiB)??
  6. UBI:?logical?eraseblock?size:?129024?bytes??
  7. UBI:?smallest?flash?I/O?unit:?2048??
  8. UBI:?sub-page?size:?512??
  9. UBI:?VID?header?offset:?512?(aligned?512)??
  10. UBI:?data?offset:?2048??
  11. scanning?error?0??
  12. UBI:?attached?mtd1?to?ubi0??
  13. UBI:?MTD?device?name:?"mtd=3"??
  14. UBI:?MTD?device?size:?16?MiB??
  15. UBI:?number?of?good?PEBs:?127??
  16. UBI:?number?of?bad?PEBs:?1??
  17. UBI:?max.?allowed?volumes:?128??
  18. UBI:?wear-leveling?threshold:?4096??
  19. UBI:?number?of?internal?volumes:?1??
  20. UBI:?number?of?user?volumes:?1??
  21. UBI:?available?PEBs:?0??
  22. UBI:?total?number?of?reserved?PEBs:?127??
  23. UBI:?number?of?PEBs?reserved?for?bad?PEB?handling:?2??
  24. UBI:?max/mean?erase?counter:?4/1??
??

?

查看当前激活的分区:
U-Boot$ ubi part

[cpp] view plain copy print ?
  1. Device?0:?nand0,?partition?safefs??

(4)挂载分区

U-Boot$ ubifsmount safefs

[cpp] view plain copy print ?
  1. UBIFS:?recovery?needed??
  2. UBIFS:?recovery?deferred??
  3. UBIFS:?mounted?UBI?device?0,?volume?0,?name?"safefs"??
  4. UBIFS:?mounted?read-only??
  5. UBIFS:?file?system?size:?14192640?bytes?(13860?KiB,?13?MiB,?110?LEBs)??
  6. UBIFS:?journal?size:?9033728?bytes?(8822?KiB,?8?MiB,?71?LEBs)??
  7. UBIFS:?media?format:?w4/r0?(latest?is?w4/r0)??
  8. UBIFS:?default?compressor:?LZO??
  9. UBIFS:?reserved?for?root:?0?bytes?(0?KiB)??

(5)查看分区的内容

U-Boot$ ubifsls

[cpp] view plain copy print ?
  1. <DIR>?3840?Tue?Apr?20?07:42:09?2010?bin??
  2. <DIR>?480?Fri?Aug?28?02:32:54?2009?dev??
  3. <DIR>?2416?Thu?Jan?01?00:18:47?1970?etc??
  4. <DIR>?5464?Tue?Apr?20?07:54:28?2010?lib??
  5. <DIR>?480?Tue?Apr?20?07:42:01?2010?mnt??
  6. <DIR>?160?Fri?Aug?28?01:37:57?2009?opt??
  7. <DIR>?224?Tue?Apr?20?09:19:29?2010?tmp??
  8. <DIR>?160?Fri?Aug?28?01:37:57?2009?sys??
  9. <DIR>?736?Thu?Feb?26?07:25:19?2009?var??
  10. <DIR>?608?Fri?Aug?28?02:32:54?2009?usr??
  11. <DIR>?296?Fri?Aug?28?01:37:57?2009?boot??
  12. <DIR>?224?Tue?Apr?20?07:42:01?2010?home??
  13. <DIR>?160?Fri?Aug?28?01:37:57?2009?proc??
  14. <DIR>?2528?Tue?Sep?14?08:50:07?2010?sbin??
  15. <DIR>?160?Fri?Aug?28?01:37:57?2009?root??
  16. <LNK>?11?Tue?Sep?14?08:24:07?2010?linuxrc??
  17. ??????????????706?Wed?Sep?15?08:47:30?2010?burn.usb??
  18. ???????????????52?Wed?Jun?30?06:30:21?2010?readme??
  19. ??????????????697?Wed?Sep?15?08:47:43?2010?burn.cf??
  20. ??????????????664?Wed?Sep?15?08:47:17?2010?burn.sd??

(6)查看某个文件

?

U-Boot$ ubifsload 80008000 readme

[cpp] view plain copy print ?
  1. Loading?file?'readme'?to?addr?0x80008000?with?size?52?(0x00000034)...??
  2. Done??

?

U-Boot$ md 80008000

[cpp] view plain copy print ?
  1. 80008000:?65666173?66207366?6120726f?4c206c6c?safefs?for?all?L??
  2. 80008010:?32334350?42203035?6472616f?200a2e73?PC3250?Boards..??
  3. 80008020:?20202020?32202020?2d303130?302d3730?2010-07-0??
  4. 80008030:?0a0a0a31?00000000?00000000?00000000?1...............??

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读