apexd: support zero-hash on dm-verity mount
When activating APEX package which has zero-ed hashtree for
smaller OTA update size, APEXD generates hashtree on device and
stores it for later use in /data/apex/hashtree/.
Note that dm-verity allows us to create a device with separate hash
device and it should be a block device. So, we need an additional loop
device for hash.
TODOs:
- remove unused hashtree files on boot complete
- set unique name for hashtree file instead of package id(name@ver).
package id may not be unique among APEX files.
- database entries for additional loop device(hashtree)
- tests
Bug: 120058143
Test: activate via dm-verity with generated hashtree
Change-Id: Id75dec08897f96628f3b45eeadcb552e9ffc87ab
6 files changed