Learn init.rc

## service start mechanism

system / core / init / init.c file main function parse_config_file (init.rc) init.rc to read and parse the file contents. The service information is placed into the system / core / init / init_parser.cpp of service_list in
system / core / init / init.c file main function to continue restart_servie_if_needed (...) -> service_start ( ...) -> Execve (...) the establishment of service process ;
 

Need to understand that these init.rc just grammar file, not a program, the actual entrance is a system mentioned above / core / init / init.c
because init.c files are large, my second part of the article It will brief analysis by the main function init starts the process;

init.rc two, which are located:
./system/core/rootdir/init.rc
./bootable/recovery/etc/init.rc
roughly guessed from the catalog, two different scenarios using init.rc, brush one is used, that is, into recorvery mode, a normal start is used; here we focus on the above analysis is also associated init.c that;
 

 

 

Published 26 original articles · won praise 34 · views 90000 +

Guess you like

Origin blog.csdn.net/qq_36662437/article/details/98503246