[RK3288][Android6.0] Debugging Notes---Increase OS boot time

Platform: RK3288
OS: Android 6.0
Kernel: 3.10.92

Background:
Since the system has modules that need to be synchronized with external hardware, the boot time needs to be extended.


Debugging ideas :
Since the system only displays the boot animation, there is no boot logo. Therefore, the initial idea was to extend the boot animation time, and then delay the startup time of the launcher or zygote. Debugging found that it is not feasible, because the processes after the init process are executed concurrently, and the functions of many processes are interdependent, as shown in the following figure (the picture comes from the reference link blog):

write picture description here

Therefore, the delay is set before the init process. Since the boot animation is not running at this time, the display of the boot logo should also be turned on to avoid the black screen for too long.


Solution:
The init changes are as follows:

kris@eco:~/rk3288/system/core$ g df 6a8f21df1001917edafb978a427ae98c64a91490 4d69b8b74af30a2e0329eeb124d48a228c9b1800
diff --git a/init/init.cpp b/init/init.cpp
index e748a4f..3594279 100755
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -215,6 +215,7 @@ void service_start(struct service *svc, const char *dynamic_args)
     // Running processes require no additional work --- if they're in the
     // process of exiting, we've ensured that they will immediately restart
     // on exit, unless they are ONESHOT.
+
     if (svc->flags & SVC_RUNNING) {
         return;
     }
@@ -1287,6 +1288,7 @@ static void rk_parse_cpu(void)


 int main(int argc, char** argv) {
+
     if (!strcmp(basename(argv[0]), "ueventd")) {
         return ueventd_main(argc, argv);
     }
@@ -1332,6 +1334,12 @@ int main(int argc, char** argv) {
     // to the outside world.
     open_devnull_stdio();
     klog_init();
+    if (!is_first_stage){
+        ERROR("\n");
+        ERROR("delay 10s wait for HiWiFi boot begin\n");
+        sleep(10);
+        ERROR("delay 10s wait for HiWiFi boot end\n");
+    }
     //klog_set_level(KLOG_NOTICE_LEVEL);

The changes to the boot logo will not be given here, as mentioned in the previous article.


Reference:
Android Core Analysis No. 8 - Detailed explanation of the Android startup process

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325987795&siteId=291194637