aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessandro Astone <ales.astone@gmail.com>2019-03-26 16:58:21 +0100
committerMichael Bestas <mkbestas@lineageos.org>2019-04-05 02:11:57 +0300
commitcfd573a6cdf81047a8cf0f435560320ffee3b10c (patch)
treec966a3f2b9870ac49d6def1450ced7179e724f6c
parentde4ae5bd66e76518efbe16284917d5f8812d908d (diff)
downloadandroid_bootable_recovery-cfd573a6cdf81047a8cf0f435560320ffee3b10c.tar.gz
android_bootable_recovery-cfd573a6cdf81047a8cf0f435560320ffee3b10c.tar.bz2
android_bootable_recovery-cfd573a6cdf81047a8cf0f435560320ffee3b10c.zip
recovery: VolumeManager: support for multiple /data fs entries
Change-Id: I0ec2c9f3c44b3aa69e07aa97e45a0ee3214ffd05
-rw-r--r--volume_manager/VolumeManager.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/volume_manager/VolumeManager.cpp b/volume_manager/VolumeManager.cpp
index a86bc9f9..9351396a 100644
--- a/volume_manager/VolumeManager.cpp
+++ b/volume_manager/VolumeManager.cpp
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+#include <blkid/blkid.h>
#include <dirent.h>
#include <fcntl.h>
#include <fs_mgr.h>
@@ -122,7 +123,11 @@ static int process_config(VolumeManager* vm, fstab_rec** data_recp) {
fstype, mntopts));
} else {
if (!*data_recp && !strcmp(fstab->recs[i].mount_point, "/data")) {
- *data_recp = &fstab->recs[i];
+ char* detected_fs_type =
+ blkid_get_tag_value(nullptr, "TYPE", fstab->recs[i].blk_device);
+ if (!strcmp(detected_fs_type, fstab->recs[i].fs_type)) {
+ *data_recp = &fstab->recs[i];
+ }
}
}
}