1.问题描述

启动异常耗时多10s左右.jpg

从bootchart中可以看到系统启动过程中在qseecomd进程启动附近存在启动异常的问题,导致耗时直接拉长10s左右。

2.问题调查

第一印象就是找qseecomd是否出现异常,导致起不来。搜索qsee的日志如下

qseecomd缺少库.png

从日志中看是否是因为缺少库导致qsee进程启动异常?

然而后面讲这几个库打入之后,qsee启动正常了,还是有10s左右的延迟。

然后继续撸日志。其中内核dmesg日志中发现了如下报错信息:

1
2
3
4
5
[    9.023590] init: wait for '/dev/block/vdr' timed out and took 5000ms
[ 9.025344] init: Command 'wait /dev/block/vdr' action=post-fs (/vendor/etc/init/init.lion.rc:16) took 5002ms and failed: wait_for_file() failed
[ 9.026884] init: Service 'exec 3 (/system/bin/recovery-refresh)' (pid 349) exited with status 254
[ 14.034569] init: wait for '/dev/block/vdq' timed out and took 5004ms
[ 14.036038] init: Command 'wait /dev/block/vdq' action=post-fs (/vendor/etc/init/init.lion.rc:24) took 5006ms and failed: wait_for_file() failed

大概看一下,vdrvdq分区挂载失败了,每个等了5000ms,差不多10s左右,感觉问题找到了。验证一下。

找到/vendor/etc/init/init.lion.rc文件,查看vdrvdq两个分区挂载情况。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/android/device/gxatek/product/init.lion.rc
on post-fs
# Keeping following partitions outside fstab file. As user may not have
# these partition flashed on the device. Failure to mount any partition in fstab file
# results in failure to launch late-start class.
wait /dev/block/vdr
mount ext4 /dev/block/vdr /vehicledefcfg noatime nosuid nodev barrier=1

mkdir /data/vendor/vehicledefcfg 0551 system system
mkdir /vehicleconfig/data 0771 system system
mkdir /vehicleconfig/data/mnt-c 0771 system system
mkdir /vehicleconfig/data/mnt-wt 0771 system system
mkdir /vehicleconfig/data/mnt-backup 0770 system system
wait /dev/block/vdq
mount ext4 /dev/block/vdq /vehicleconfig/data/mnt-wt noatime nosuid nodev barrier=1
mount ext4 /dev/block/vdq /vehicleconfig/data/mnt-c noatime nosuid nodev barrier=1

chown system system /vehicleconfig/data/mnt-wt
chown system system /vehicleconfig/data/mnt-c
chown system system /vehicledefcfg

可以看到这两个分区是平台的分区,项目分支可能没有这两个分区。因此注释掉此部分代码,重编系统看看能否修复。

答案是肯定的,注销掉这部分代码,系统起来不会尝试挂载这两个分区,就不会等待10s, 因此问题得到解决。