Questions about Android init.rc

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Questions about Android init.rc

809 次查看
eddiehuang
Contributor II

Recently, I started to look into the code parsing init.rc, which is in $(android_source_root)/system/core/init/ folder. I wrote a statement for creating a folder in init.rc on the "on post-of-data" action, "mkdir /data/test_dir 0770 system system" for instance. After booting, the directory is actually created.

My problem is, when I traced the code, I realized the commands in init.rc file are actually recognized by init.c and they are parsed in parse_config function. There is an array for mapping all the commands with their functions and I noticed mkdir command is actually implemented by do_mkdir function. The tricky thing is, I wrote some codes to log the folder path do_mkdir gonna to create and found "/data/test_dir" is not logged but this folder is actually created. So which function really creates folders that we write in init.rc file? Thanks.

0 项奖励
回复
0 回复数