Introduction to the init. rc file in Android, androidinit. rc

Source: Internet
Author: User

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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.