平台信息:
内核:4.9.112
系统:android one
平台:qcom sdm439
作者:庄泽彬(欢迎转载,请注明作者)
一、android设备在开机的时候打印了如下的log,由于系统使用了AB分区,把cache分区和recovery分区干掉了,因此在init.rc文件中等待cache分区的挂载肯定会失败,这样会导致系统开机的时间变慢5秒,因此这部分需要优化,提高系统的开机速度:
[ 25.411599] init: wait for '/dev/block/bootdevice/by-name/cache' timed out and took 5007ms
[ 25.411892] init: Command 'wait /dev/block/bootdevice/by-name/cache' action=charger (/system/etc/init/init.xxx.rc:) took 5007ms and failed: wait_for_file() failed
二、修改方法,找到对应的init.xxx.rc文件:
on bootlog
# wait /dev/block/bootdevice/by-name/cache
start logcat_boot
start kmsg_boot
三、测试对比
未优化之前的时间:
[ 25.206440] Boot completed
[ 24.588259] Boot completed
[ 24.287756] Boot completed
[ 24.073655] Boot completed 优化之后的时间:
[ 22.822842] Boot completed
[ 22.647295] Boot completed
[ 22.641041] Boot completed
[ 22.605505] Boot completed