我们知道recovery.img是包含了LINUX内核的,我的疑问是UBOOT加载RECOVERY.img后,LINUX内核是怎么呼叫里面的recovery这个应用程序的呀?如下代码是recovery这个应用的入口函数:
int main(int argc, char **argv)
{
time_t start = time(NULL); // If these fail, there's not really anywhere to complain...
freopen(TEMPORARY_LOG_FILE, "a", stdout); setbuf(stdout, NULL);
freopen(TEMPORARY_LOG_FILE, "a", stderr); setbuf(stderr, NULL);
int main(int argc, char **argv)
{
time_t start = time(NULL); // If these fail, there's not really anywhere to complain...
freopen(TEMPORARY_LOG_FILE, "a", stdout); setbuf(stdout, NULL);
freopen(TEMPORARY_LOG_FILE, "a", stderr); setbuf(stderr, NULL);
strlcpy(boot.command, "boot-recovery", sizeof(boot.command));
strlcpy(boot.recovery, "recovery\n", sizeof(boot.recovery));
strlcat(boot.recovery, "--wipe_cache\n", sizeof(boot.recovery));
set_bootloader_message(&boot);这段代码是作用是什么呀?
这个就是执行了recovery这个可执行程序。从而进入升级过程,