Android Boot Script init.rc (2)

Source: Internet
Author: User

Using the startup script init.rc in Android, you can perform simple operations in the initialization of the system.

Init.rc Startup script path: system/core/rootdir/init.rc

Content:

    • Commands: Command
    • Actions: Actions
    • Triggers: Trigger Condition
    • Services: Service
    • Options: Option
    • Properties: Attributes

Commands are some basic operations. Such as:

Mkdir/system
Mkdir/data 0771 System System
Mkdir/persist 0771 System System
Devwait/dev/block/mmcblk0p12
Mount ext3/dev/block/mmcblk0p

The action represents a series of commands, usually called in triggers, such as:


On init//indicates a trigger condition

Sysclktz 0

LogLevel 3

# Setup The Global environment
Export Path/sbin:/system/sbin:/system/bin:/system/xbin
Export Ld_library_path/system/lib
Export Android_bootlogo 1

Services typically means that an executable program is launched, and options are additional content for the service to use with the service.

Service Vold/system/bin/vold//vold is the name of the services,/system/bin/vold is the corresponding executable program.
Socket Vold Stream 0660 root mount//socket is the option used with the service
Ioprio be 2

Service netd/system/bin/netd
Socket netd Stream 0660 root system

The options used with the service are socket,user,group,oneshot.

OneShot indicates that the service is started only once, and if there is no oneshot option, the executable will persist-restarting if the executable program is killed.

Properties are some of the values used in the system and can be set up and read and written.

SetProp ro. Hidden_app_mem 5120//setprop for setting properties
SetProp ro. Content_provider_mem 5632
SetProp ro. Empty_app_mem 6144

...

On Property:ro.kernel.qemu=1//on property is used to determine properties
Start ADBD

The properties here are consistent across the entire Android system.

The init script keyword can refer to the System/core/init/keyword.h file in the init process. Such as:

KEYWORD (chroot, command, 1, do_chroot)//chroot is the command, Do_chroot () is a function called, which is set in the System/core/init/builtins.c file in the init process Yi.

Init.rc use method, see the description file System/core/init/readme.txt

Android Boot Script init.rc (2)

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.