Reduce boot time by proactively creating dm devices
When activating APEXes coming from /data, we need to mount them on top
of dm-verity device. Once apexd asks device-mapper to create a dm-verity
device, it needs to wait for ueventd to receive a corresponding uevent
from kernel and create a user space paths for the device, which affects
boot time of the devices with APEXes on /data.
This change tries to minimize impact by proactively creating empty dm
devices during apexd-bootstrap, so that paths in user space will be
already created by the time regular apexd starts. Since at the time of
apexd-bootstrap we don't really know what APEXes have an updated version
on /data, we simply create a dm device for each of them, and clean up
unused ones after boot completes.
Bug: 190618831
Test: atest ApexTestCases
Test: adb reboot
Change-Id: Icee944eae5643f3db19cf4c5db4f136f6735de68
Merged-In: Icee944eae5643f3db19cf4c5db4f136f6735de68
(cherry picked from commit b2b8987fda80f0bac96101450acc8dda3db044eb)
2 files changed