After we have all the background knowledge about recovery and the components related to recovery, let's have a look at the main workflow of recovery. We will use the following diagram to explore the workflow of recovery:
- When recovery is started, it will set the log file to /tmp/recovery.log first.
- After that, it checks the --adbd option. If this option is specified, it will run a daemon for the sideloading using adb. You can refer to the source code at $AOSP/bootable/recovery/adb_install.cpp about how to launch recovery as adb daemon.
- It retrieves and processes the arguments from cache partition and BCB by calling the get_args function.
- Based on the commands retrieved from get_args, it may call the install_package ...