ubi文件系統製作,還是"-c"選項的問題

以下是分析記錄:

------------------------------------------------------------------------------

以上命令的參數可從 ubifs 掛載信息中提取:
UBI: attaching mtd5 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB) // -p:物理擦除塊大小
UBI: logical eraseblock size:    129024 bytes           // -e:邏輯擦除塊大小(LEB size)
UBI: smallest flash I/O unit:    2048                   // -m:頁面大小
UBI: sub-page size:              512                    // -s:最小的硬件輸入輸出頁面大小
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: attached mtd5 to ubi0
UBI: MTD device name:            "File System-1"
UBI: MTD device size:            162 MiB
UBI: number of good PEBs:        1295                   // -c:最大的邏輯擦除塊數量,一般小於等於 block count -1
UBI: number of bad PEBs:         1                      // -c:162*1024*1024/129024 = 1316, 162*1024*1024/(128*1024) = 1296(出錯!!!)
                                                        // 對我們這種情況,文件系統最多可以訪問卷上的 129024*812=100M 空間(可行!!!) 
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             0
UBI: total number of reserved PEBs: 1295
UBI: number of PEBs reserved for bad PEB handling: 12
UBI: max/mean erase counter: 2/0
UBI: image sequence number: 936292432
UBI: background thread "ubi_bgt0d" started, PID 471
------------------------------------------------------------------------------
UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size:   163602432 bytes (159768 KiB, 156 MiB, 1268 LEBs)
UBIFS: journal size:       9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root:  0 bytes (0 KiB)
VFS: Mounted root (ubifs filesystem) on device 0:12.
Freeing init memory: 164K
Failed to execute /init.  Attempting defaults...
INIT: version 2.86 booting
Starting udevtar: removing leading '/' from member names
------------------------------------------------------------------------------
cd /devkit8500d/work
/devkit8500d/tools/bin/mkfs.ubifs -r rootfs -m 2048 -e 129024 -c 1996 -o ubifs.img
# 通過 mkfs.ubifs 命令製作的出的 UBIFS 文件系統鏡像可在u-boot下使用ubi write命令燒寫到NAND FLASH上
# 使用 ubinize 命令生產實際可用空間的 ubi 格式鏡像,這樣纔可以通過 ubiformat 命令在板子上寫入該文件系統鏡像:
# ubinize,帶有UBI文件系統鏡像卷標
/devkit8500d/tools/bin/ubinize -o ubi.img -m 2048 -p 128KiB -s 512 /devkit8500d/tools/bin/ubinize.cfg
#/devkit8500d/tools/bin/ubinize -o ubi.img -m 2048 -p 128KiB -s 512 -O 2048 /devkit8500d/tools/bin/ubinize.cfg
cp /devkit8500d/work/ubi.img /mnt/hgfs/Ubuntu10.04/dyz/omap3devkit8500/image/
------------------------------------------------------------------------------
/devkit8500d/tools/bin/mkfs.ubifs -m 2048 -c 1296 -e 129024 -r /devkit8500d/work/rootfs -o ubifs.img
/devkit8500d/tools/bin/ubinize -o ubi.img -m 2048 -p 128KiB -s 512 /devkit8500d/tools/bin/ubinize.cfg
出現錯誤:
...
UBIFS error (pid 1): ubifs_get_sb: cannot open "ubi0:rootfs", error -19
VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00             512 mtdblock0 (driver?)
...
------------------------------------------------------------------------------
修改 ubinize.cfg 文件
[ubifs]
mode=ubi
image=ubifs.img
vol_id=0
vol_size=162MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize
結果:
失敗!!!
------------------------------------------------------------------------------
參考成功時候的信息
omap_vout omap_vout: : registered and initialized video device 1
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size:   163602432 bytes (159768 KiB, 156 MiB, 1268 LEBs) // 1268 LEBs 很重要!!!
UBIFS: journal size:       9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root:  0 bytes (0 KiB)
VFS: Mounted root (ubifs filesystem) on device 0:12.
Freeing init memory: 164K
Failed to execute /init.  Attempting defaults...
INIT: version 2.86 booting
Starting udevtar: removing leading '/' from member names
重新運行:
/devkit8500d/tools/bin/mkfs.ubifs -m 2048 -c 1268 -e 129024 -r /devkit8500d/work/rootfs -o ubifs.img
/devkit8500d/tools/bin/ubinize -o ubi.img -m 2048 -p 128KiB -s 512 /devkit8500d/tools/bin/ubinize.cfg
結果:
失敗!!!
------------------------------------------------------------------------------
/devkit8500d/tools/bin/mkfs.ubifs -m 2048 -c 812 -e 129024 -r /devkit8500d/work/rootfs -o ubifs.img
/devkit8500d/tools/bin/ubinize -o ubi.img -m 2048 -p 128KiB -s 512 /devkit8500d/tools/bin/ubinize.cfg
成功,還是 -c 的問題
------------------------------------------------------------------------------
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章