Nand Flash空间新增一个共享分区方法
[part_num]
num
;------------------------------>nanda, known as bootfs before, includes boot.axf u-boot.bin etc...
[partition0]
;------------------------------>nandb, enviroment for u-boot
[partition1]
;------------------------------>nandc, kernel and ramdisk
[partition2]
;------------------------------>nandd, android real rootfs
[partition3]
;------------------------------>nande, user data
[partition4]
;------------------------------>nandf, misc
[partition5]
;------------------------------>nandg, for recovery
[partition6]
;------------------------------>nandh, android app cache
[partition7]
那么怎么在Nand Flash空间新增一个共享分区呢?
1. 修改lichee\tools\pack\chips\sun4i\configs\crane\3g\sys_config.fex
<1>. part_num 字段(加1),num = 9
[part_num]
num
;------------------------------>nandi, for test (caihua.zhao)
[partition8]
[down_num]
down_num
<4>. 增加download描述[downloadXX]
;------------------------------>for test (caihua.zhao)
[download5]
part_name
pkt_name
encrypt
这样的话,我们就在UDISK分区前增加了一个test分区。
如果增加test分区之前,UDISK大小是2.5GB(我平台是4GB的Nand Flash),那么,
增加test分区后,UDISK大小 = 2.5GB - 512MB = 2GB
2.
增加上一步download描述里pkt_name(TEST_000000000)的定义
;-->下载的分区文件
{filename = "bootloader.fex",
{filename = "env.fex",
{filename = "boot.fex",
{filename = "system.fex",
{filename = "recovery.fex",
;caihua.zhao add here for test partion
{filename = "diskfs.fex",
{filename = "diskfs.fex",
3. 修改lichee\tools\pack\chips\sun4i\configs\crane\3g\sys_config1.fex
[msc_feature]
vendor_name
product_name
release
luns
调整之前luns = 2 , 也就是说,当设备连接PC,点击“打开USB存储设备”,系统挂载的分区需要当成USB MASS STORAGE(ums)时,最多能share两个分区。
因为A10(crane-3g)软件本身就至支持2个分区share,分别是/mnt/sdcard和/mnt/extsd。
所以,如果想将刚划分的那个test分区也能share到PC,这个luns就要加大。
4.
<1>. 创建挂载目录 /mnt/test
#caihua.zhao add here for test nand partition
mkdir /mnt/test 0000 system system
<2>. 格式化分区
#caihua.zhao add here for test nand partition
format_userdata /dev/block/nandi huazi
其中 huazi 为分区卷名
注意:
之前的format_userdata /dev/block/nandi crane-3g
分区序号要改成nandj,也即format_userdata /dev/block/nandj crane-3g
5.
增加自动挂载
#caihua.zhao add here for partition
dev_mount
注意:
之前的dev_mount sdcard
分区序号要改成nandj,也即
dev_mount
6.
storage_list.xml
<StorageList xmlns:android="http://schemas.android.com/apk/res/android">
<!--
-->
</StorageList>
以上步骤完成后,重新编译打包固件,刷机后,在uboot启动时,会发现partition信息中多了一个test分区,而且大小为0x20000000 Byte = 512M Byte
--------fastboot partitions--------
-total partitions:10-
-name-
bootloader
env
boot
system
data
misc
recovery
cache
test
UDISK
-----------------------------------
起机后,进入adb控制命令行,输入命令: busybox df –h
可以看到,有一个512M的分区挂载到了/mnt/test ,当然,这就是刚划分的那个test分区
选择通知栏中的“USB 已连接 选择将文件复制到计算机或从计算机复制到存储设备”,在弹出界面里选择“打开USB存储设备”,这样的话,在storagelist.xml里,分区属性设置为
android:allowMassStorage="true"的几个分区(sdcard/test/extsd)都会share到PC。