Introduction to the init. rc file in Android, androidinit. rc
The init. rc Script is parsed by the first user-level process init in linux in Android.
The init. rc file is not a common configuration file, but a file written by a script called "Android Init Language" (AIL.
The file is read-only in the ROM. Even if you have the root permission, you can modify the file. Because the files we see in the root directory are only images of memory files. That is to say, after android is started, it loads the init. rc file to the memory. The content of the init. rc file is actually only the content of the init. rc file in the memory. Once you restart android, the content of the init. rc file will be restored to the initial load. The only way to thoroughly modify the content of the init. rc file is to modify the kernel image (boot. img) in the Android ROM ).
The init. rc Script includes many file system initialization and loading processes. The main work of init. rc is:
1) set some environment variables
2) create directories such as system, sdcard, data, and cache (see case 1)
3) mount some file systems to some directories, for example, mount tmpfs/sqlite_stmt_journals
4) set user groups and permissions for some files
5) set some thread parameters
6) set the TCP cache size
Keyword of the init script (such as mkdir, chmod, service, etc.) can be referred to
System/core/init/keyword. h file.
For how to use init. rc, refer to the instruction file system/core/init/readme.txt.
To modify the startup process, you only need to modify the content in init. c (system/core/init) or init. rc.
The positions of init. c and init. rc in the source code are as follows:
1init. c:/system/core/init
2init. rc:/system/core/rootdir