基于MTK平台,split build2.0方式的mt6789平台上举行调试。驱动和体系层代码分别在S/T版本下。
新增分区zlintek。
1、分区表中添加分区参数(配置分区文件格式、大小、对应img名称等)
配置表格式后缀为.csv,通过在 vendor 目录下搜索,找到目标平台文件夹下的配置表
mt6789_s/vendor/mediatek/proprietary/tools/ptgen/MT6789/partition_table_emmc_ab.csv
参考userdata.img举行添加即可,partition分区名为zlintek,size这里选择了3G,Download_File为zlintek.img
zlintek添加在userdata之后,会导致机器的data分区大小只有4G,所以要将zlintek往前移,放在userdata之前:
扩展相识:
2、修改 fstab 文件添加分区块装备的挂载和体系启动时挂载点的创建
mt6789_s/device/mediatek/mt6789/init.mt6789.rc
- --- a/mediatek/mt6789/init.mt6789.rc
- +++ b/mediatek/mt6789/init.mt6789.rc
- @@ -43,6 +43,11 @@ on init
-
- mkdir /mnt/cd-rom 0000 system system
-
- +# Create zlintek mount pointer
- + mkdir /zlintek 0777 system system
- + mkdir /mnt/vendor/zlintek 0777 system system
- +
- # change lk_env permission
- chown root system /proc/lk_env
- chmod 0660 /proc/lk_env
复制代码 mt6789_s/vendor/mediatek/proprietary/hardware/fstab/mt6789/fstab.in
- --- a/mediatek/proprietary/hardware/fstab/mt6789/fstab.in
- +++ b/mediatek/proprietary/hardware/fstab/mt6789/fstab.in
- @@ -180,6 +180,9 @@ DEVPATH(protect1) /mnt/vendor/protect_f ext4 FS_FLAG_COMMIT FSMGR_FLAG_F
- DEVPATH(protect2) /mnt/vendor/protect_s ext4 FS_FLAG_COMMIT FSMGR_FLAG_FMT
- DEVPATH(nvdata) /mnt/vendor/nvdata ext4 FS_FLAG_COMMIT FSMGR_FLAG_FMT
- DEVPATH(nvcfg) /mnt/vendor/nvcfg ext4 FS_FLAG_COMMIT FSMGR_FLAG_FMT
- +DEVPATH(zlintek) /mnt/vendor/zlintek ext4 FS_FLAG_NO_DISCARD FSMGR_FLAG_FMT
-
- #ifdef __PERSIST_PARTITION_SUPPORT
- DEVPATH(persist) /mnt/vendor/persist ext4 FS_FLAG_COMMIT FSMGR_FLAG_FMT
复制代码 fstab.in选择了挂载/mnt/vendor/zlintek而非/zlintek,是因为/zlintek目录在a13机器上调试时一直无法创建出来,退而求其次,参考nvcfg在/mnt/vendor目录下创建了zlintek目录。
在此处对/zlintek目录的生存和后续对该目录的权限操纵是为了编译pass,如果读者在新增分区时能在根目录下创建xxx目录,那么fstab.in这里的挂载目录也可改为/xxx。
3、添加分区块装备权限规则
mt6789_s/device/mediatek/mt6789/ueventd.mt6789.rc
- --- a/mediatek/mt6789/ueventd.mt6789.rc
- +++ b/mediatek/mt6789/ueventd.mt6789.rc
- @@ -26,6 +26,9 @@
- /dev/block/by-name/md1img_b 0640 root system
- /dev/block/by-name/md1dsp 0660 root system
- /dev/block/by-name/boot_para 0640 root system
- +/dev/block/by-name/zlintek 0640 root system
-
- # OTP
- /dev/otp 0660 system system
复制代码 4、添加挂载分区的selinux权限
mt6789_s/device/mediatek/sepolicy/basic/non_plat/device.te
- --- a/mediatek/sepolicy/basic/non_plat/device.te
- +++ b/mediatek/sepolicy/basic/non_plat/device.te
- @@ -305,6 +305,10 @@ type m_step_c_misc_device, dev_type;
- type m_fusion_misc_device, dev_type;
- type m_bio_misc_device, dev_type;
-
- +type zlintek_block_device, dev_type;
- +
- # Date : 2016/07/11
- # Operation : Migration
- # Purpose : Add permission for gpu access
复制代码 mt6789_s/device/mediatek/sepolicy/basic/non_plat/file.te
- --- a/mediatek/sepolicy/basic/non_plat/file.te
- +++ b/mediatek/sepolicy/basic/non_plat/file.te
- @@ -452,6 +452,10 @@ type mediaserver_data_file, file_type, data_file_typ
复制代码 免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |