#include <tzplatform_config.h>
#include <blkid.h>
#include <libsyscommon/libgdbus.h>
+#include <libsyscommon/common.h>
#include "common.h"
#include "log.h"
#define FORMAT_TIMEOUT (120*1000)
#define USER_PARTITION "user"
+#define CONTAINER_USER_PARTITION "contain-user"
/*
Get compat path from origin Multi-user path
blkid_dev dev;
int ret_val;
bool found = false;
+ char *user_label = is_container()? CONTAINER_USER_PARTITION: USER_PARTITION;
if (!mounted)
return STORAGE_ERROR_INVALID_PARAMETER;
+ _D("Find user partition label: %s", user_label);
ret_val = blkid_get_cache(&cache, NULL);
if (ret_val < 0) {
_E("Failed to get cache"); //LCOV_EXCL_LINE
return STORAGE_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
}
- ret_val = blkid_dev_set_search(iter, "LABEL", USER_PARTITION);
+ ret_val = blkid_dev_set_search(iter, "LABEL", user_label);
if (blkid_dev_next(iter, &dev) == 0) {
dev = blkid_verify(cache, dev);
if (dev) {
found = true;
- _D("Partition for user data is found(LABEL=user)");
+ _D("Partition for user data is found(LABEL=%s)", user_label);
}
}
blkid_dev_iterate_end(iter);
return STORAGE_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
}
- ret_val = blkid_dev_set_search(iter, "PARTLABEL", USER_PARTITION);
+ ret_val = blkid_dev_set_search(iter, "PARTLABEL", user_label);
if (blkid_dev_next(iter, &dev) == 0) {
dev = blkid_verify(cache, dev);
if (dev) {
found = true;
- _D("Partition for user data is found(PARTLABEL=user)");
+ _D("Partition for user data is found(PARTLABEL=%s)", user_label);
}
}
blkid_dev_iterate_end(iter);