关于Android系统中system.img和data.img中文件系统的权限设置

    In system.img and data.img, we can find directory and files have their own UID/GID, and also access permission.
but in Android build environment, they have not been given the configuration.

    In fact, these modification are done by mkyaffs2image tool. In yaffs source code, we can get the real process.

1. Pre-condition.
while we use mkyaffs2image tool to generate yaffs2 file system, there are two pre-condition.
a. we need use '-f' flags as mkyaffs2image boot option.
In /external/yaffs2/yaffs2/utils/mkyaffs2image.c.
if we use '-f' option, it will set fixstats flag and do some special process according to this flag.



b. for the folder which will be transfered to yaffs file system, the folder name should be "system" or "data".



2. normal configuration for permission and uid/gid.
for all directory and files, mkyaffs2image tool give them ROOT:ROOT uid and gid. and also re-use access permission according to directory and file's original permission in build environment.

3. special configuration for Android.
if fixstats is set, mkyaffs2image tool will do special configuration for Android.
the process is as below:

In /external/yaffs2/yaffs2/utils/mkyaffs2image.c.
main() -> process_directory() -> fix_stat() -> fs_config() ->

fs_config() function is defined in sysem/core/include/private/android_filesystem_config.h. This function will do special configuration according to android_dirs and android_files data stuctures.

4. about android_dirs and android_files data stuctures.
the defination is in system/core/include/private/android_filesystem_config.h file.

 

 

http://blogold.chinaunix.net/u3/103613/showart_2218437.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值