(以下内容转发自K093期谭校长的邮件)
# "system" partition: begin=0x700000 size=0x6000000 (96MB) # size of PEB:0x20000 (128KB) # size of LEB:0x1F000 (124KB 126976) # -m <page size>: 2KiB # -e <size of LEB>: 124KB # -c <max number of LEB>: Number-of-PEB=0x6000000/0x20000=0x300, 10 blocks are reserved for bad block handling, so # Number-of-LEB=0x300 - 0xA=0x2f6(or 75 # vol_size= Number-of-LEB * size-of-LEB=0x2f6 * 0x1F000 = 0x5BCA000 (or 9624780 # LEB = 创建system_ubinize.cfg文件的内容如下: [rootfs-volume] mode=ubi image=system_ubifs_tmp.img vol_id=0 vol_size=96247808 vol_type=dynamic vol_name=system mkfs.ubifs -x lzo -m $page_size_in_bytes -e $logical_erase_block_size -c $patition_logical_blocks -o rootfs_ubifs_tmp.img -d $path_to_rootfs ubinize -o $img_name -m $page_size_in_bytes -p $block_size -s $page_size_in_bytes $config_file mkfs.ubifs -x lzo -m 2KiB -e 126976 -c 758 -o system_ubifs_tmp.img -d system/ ubinize -o system_ubi.img -m 2KiB -p 128KiB -s 2KiB system_ubinize.cfg rm system_ubifs_tmp.img tftp 0x1000000 system_ubi.img nand erase 0x700000 0x6000000 nand write 0x1000000 0x700000 0x<size of system_ubi.img> 假设Kernel启动时分区信息如下: [ 0.801175] Creating 2 MTD partitions on "Samsung 2Gibx8": [ 0.806665] 0x000000000000-0x000000100000 : "Bootloader" // 0 [ 0.813029] 0x000000100000-0x000010000000 : "MassStorage0" // 1 [ 0.820488] Detect a flash id d3ec, cs 1 [ 0.884278] Max capacity of BBM is 80 blocks!! [ 0.888719] relocation table at page:127 [ 0.892661] The reloc table is empty now [ 0.896585] Creating 6 MTD partitions on "Samsung 8Gibx8": [ 0.902093] 0x000000000000-0x000000080000 : "resereved" // 2 [ 0.908085] 0x000000080000-0x000000400000 : "Kernel" // 3 [ 0.913827] 0x000000400000-0x000000800000 : "Kernel_recovery" // 4 [ 0.920298] 0x000000800000-0x000008800000 : "System" // 5 [ 0.926146] 0x000008800000-0x00001c000000 : "Userdata" // 6 [ 0.932310] 0x00001c000000-0x000040000000 : "MassStorage1" // 7 [ 0.000000] Kernel command line: ubi.mtd=5 ubi.mtd=6 root=ubi0_0 rootfstype=ubifs console=ttyS1,115200 mem=256M uart_dma pxastorage=1G init=/init android System分区为ubi0_0 Userdata分区为ubi1_0 |