Android init.rc File Brief Introduction _android

Source: Internet
Author: User

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!

Related Article

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.