diff options
author | Nikita Ioffe <ioffe@google.com> | 2019-11-21 21:40:03 +0000 |
---|---|---|
committer | Nikita Ioffe <ioffe@google.com> | 2019-11-22 13:34:59 +0000 |
commit | 5110628a1263dccefafcbb536ba5867a5c04dcc9 (patch) | |
tree | 8b4c4d96a3b64df56066c8ac6995c4202dd827df /trusty/coverage/coverage_test.cpp | |
parent | 402393891499051e3a47c2bed0b2b994687de6ba (diff) |
Fix logic to figure out what /data fstab entry was mounted
Now the logic is handled by following API:
GetMountedEntryForUserdata(Fstab* fstab).
Behind the scenes it does the following:
1. Reads /proc/mounts and gets block device /data is actually mounted on.
2. In case of it's a dm-device, recursively goes into it's slaves until
finds the underlying block device.
3. Optimistically assumes that corresponding block device is a symlink
and tries to read it.
4. Reads all the entries corresponding to /data from fstab.
5. For each of them, optimistically tries to readlink block_device.
6. If it matches the resolved block devices, we found our fstab entry!
Also added a test to CtsFsMgrTestCases asserting that /data was mounted
from one of entries in default fstab.
Test: on blueline & taimen, with & without checkpointing:
Test: atest CtsFsMgrTestCases
Test: adb reboot userspace
Bug: 135984674
Change-Id: Ic70daeeb18096c7b134004334cc674dacc6e36f3
Diffstat (limited to 'trusty/coverage/coverage_test.cpp')
0 files changed, 0 insertions, 0 deletions