imx6ul u-boot nand write ubi rootfs

0. build rootfs

 

1. mkfs.ubifs:

mkdir rootfs
sudo tar zxvf rootfs.tar.gz -C rootfs
sudo mkfs.ubifs -r rootfs -m 2KiB -e 124KiB -c 1848 -o rootfs.ubifs.img

2. u-boot tftp nand write rootfs.ubifs.img

2.1:

tftp 0x80800000 rootfs.ubifs.img
 

2.2:

nand erase.part rootfs
 

2.3:

ubi part rootfs
 

2.4

ubi create rootfs

2.5
#ubi write 0x80800000 rootfs 0x3b94000
ubi write 0x80800000 rootfs 0x${filesize}

2.6

reset

 

 


MX6UL > tftp 0x80800000 rootfs.ubifs.img
Using FEC1 device
TFTP from server 192.168.1.168; our IP address is 192.168.1.136
Filename 'rootfs.ubifs.img'.
Load address: 0x80800000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###############################
         2 MiB/s
done
Bytes transferred = 62472192 (3b94000 hex)
MX6UL > echo 0x${filesize}
0x3b94000
MX6UL > nand erase.part rootfs

NAND erase.part: device 0 offset 0x1900000, size 0x4900000
Erasing at 0x61e0000 -- 100% complete.
OK
MX6UL > ubi part rootfs
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI: empty MTD device detected
UBI: attached mtd1 (name "mtd=5", size 73 MiB) to ubi0
UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
UBI: good PEBs: 584, bad PEBs: 0, corrupted PEBs: 0
UBI: user volume: 0, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 0
UBI: available PEBs: 540, total reserved PEBs: 44, PEBs reserved for bad PEB handling: 40
MX6UL > ubi write 0x80800000 rootfs 0x${filesize}
Volume rootfs not found!
MX6UL > ubi write 0x80800000 rootfs 0x${filesize}
Volume rootfs not found!
MX6UL > ubi create rootfs
No size specified -> Using max size (68567040)
Creating dynamic volume rootfs of size 68567040
MX6UL > ubi write 0x80800000 rootfs 0x${filesize}
62472192 bytes written to volume rootfs
MX6UL > reset
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章