Parse the android STARTUP script init. RC & Android Startup Mode

Source: Internet
Author: User

Address: http://blog.csdn.net/zhandoushi1982/article/details/5767634

Related Web posts: Android STARTUP script init. RC ---- 000070

Init. RC descriptive file ---- androidsourcecode/system/CORE/init/readme.txt

 

 

Use the startup script init. RC in Android to perform some simple initialization operations during system initialization. This script is directly installed in the root file system of the target system and parsed by the init executable program.
Init. RC is the startup script executed after init is started. Its Syntax mainly includes the following:
Commands: Command
Actions: Action
Triggers: triggers
Services: Service
Options: Options
Propertise: Properties
(1) commands is some basic operations, such:
Mkdir/sdcard 0000 System
Mkdir/System
Mkdir/Data 0771 System
Mkdir/cached 0770 system cache
Mkdir/config 0500 Root
Mkdir/sqlite_stmt_journals 01777 Root
Mount tmpfs/sqlite_stmt_journals size = 4 m

These commands are parsed In the init executable program, and then relevant functions are called for implementation.
(2) actions (Action) indicates a series of commands, which are usually called in triggers (triggers). The action and trigger condition form is:
On <trigger>
<Command>
<Command>
<Command>
An example is as follows:
On init
Export path/sbin:/system/bin:/system/xbin
Mkdir/System
Init indicates a trigger condition. After this trigger event occurs, the setting of environment variables and creating directories is called an action ".
(3) services usually start an executable program. Options are additional content of the service for use with the service.
Service vold/system/bin/vold
Socket vold stream 0660 root Mount
Service bootsound/system/bin/playmp3
User Media
Group audio
Oneshot
Vold and bootsound are the names of the two services, respectively./system/bin/vold and/system/bin/playmp3 are their corresponding executable programs. Socket, user, group, and oneshot are the options used with the service. The oneshot option indicates that the service is started only once. If the oneshot option is not available, the executable program will always exist. If the executable program is killed, it will be restarted.
(4) properties are some values used in the system and can be set and read.
Setprop Ro. foreground_app_mem 1536
Setprop Ro. visible_app_mem 2048
On Property: Ro. kernel. qemu = 1
Start adbd
Setprop is used to set attributes. on property can be used to determine attributes. The attributes here are consistent throughout the Android system. For the keyword of the init script, refer to the system/CORE/init/keyword. h file of the INIT process. 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.

Http://hi.baidu.com/donghaozheng/blog/item/e2f5045577cb73c8b645aec0.html ()

========================================================== ========================================================== ========================================================== =

Generally, the function of normal mode is to start the phone normally by pressing the power button when the phone is shut down.

Safe mode ). This mode is the same as normal startup, but does not register Google, so you cannot access the market or use your Google account. Press the "menu" key and press the power key to start the phone until the phone starts.

In recovery mode, you can open shell, refresh the image file (flash image), and execute backup. Of course, it all depends on the recovery image version on your mobile phone. It is easy to use, that is, press the Home Key and power key together.

The bootloader mode is used to install a new system image (dreaimg. NBH) on the SD card. You only need to press the power key again. It is worth mentioning that this mode is used to obtain the root permission for the Android phone. The operation is to press the camera key and power key together.

Fastboot mode uses the fastboot command on the computer to refresh the image file. How to use this function: press the return key and press the power key to start the phone until the fastboot text appears on the screen, and then release the return key.

The diagnostic mode is used to test various functions of the mobile phone. It is deliberately enabled by the trackball center key and power key.

 

 

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.