Android init.rc File Brief Introduction
The init.rc script is parsed by the first user-level process init of Linux in Android.
The init.rc file is not a normal configuration file, but rather a file written by a script called the Android Initialization language (Android Init Language, here for short ail).
The file is read-only in ROM and can be modified without the root permission. Because the file we see in the root directory is just a mirror image of the memory file. That is, when Android is started, the init.rc file is loaded into memory. Modifying the contents of the Init.rc file is actually just modifying the contents of the Init.rc file in memory. Once the contents of the Android,init.rc file are restarted, the original load is restored. The only way to completely modify the contents of the Init.rc file is to modify the kernel image (BOOT.IMG) in the Android ROM.
The init.rc script includes many procedures for file system initialization and loading. Init.rc's work is mainly:
1 Set some environment variables
2 Create System, SDcard, data, cache directory (see case 1)
3 Put some file system mount to some directory, such as, Mount Tmpfs tmpfs/sqlite_stmt_journals
4 Set up some files of user groups, permissions
5) set some thread parameters
6) Set the TCP cache size
The init script keyword (such as mkdir,chmod,service, etc.) can refer to the System/core/init/keyword.h file for the init process.
Init.rc use, you can refer to the documentation System/core/init/readme.txt
If you want to modify the startup process, you only need to modify the contents of init.c (System/core/init) or init.rc.
The location of init.c and init.rc in the source code is as follows:
1 init.c:/system/core/init
2 init.rc:/system/core/rootdir
Thank you for reading, I hope to help you, thank you for your support for this site!