static GHashTable *mount_point_hash;
-static const char *__get_app_root_path(const amd_appinfo_h ai)
-{
- const char *path_app_root;
- const char *global;
- const char *preload;
-
- preload = amd_appinfo_get_value(ai, AMD_AIT_PRELOAD);
- global = amd_appinfo_get_value(ai, AMD_AIT_GLOBAL);
- if (global && strcmp(global, "true") == 0) {
- if (preload && strcmp(preload, "true") == 0)
- path_app_root = PATH_GLOBAL_APP_RO_ROOT;
- else
- path_app_root = PATH_GLOBAL_APP_RW_ROOT;
- } else {
- path_app_root = PATH_APP_ROOT;
- }
-
- return path_app_root;
-}
-
static char **__extractor_mountable_get_tep_paths(const amd_appinfo_h ai)
{
char tep_path[PATH_MAX];
char **mnt_path;
- const char *pkgid;
const char *tep_name;
+ const char *root_path;
if (ai == NULL)
return NULL;
- pkgid = amd_appinfo_get_value(ai, AMD_AIT_PKGID);
- if (pkgid == NULL)
- return NULL;
-
tep_name = amd_appinfo_get_value(ai, AMD_AIT_TEP);
if (tep_name == NULL)
return NULL;
free(mnt_path);
return NULL;
}
- snprintf(tep_path, PATH_MAX, "%s/%s/tep/mount",
- __get_app_root_path(ai), pkgid);
+
+ root_path = amd_appinfo_get_value(ai, AMD_AIT_ROOT_PATH);
+ snprintf(tep_path, PATH_MAX, "%s/tep/mount", root_path);
mnt_path[0] = strdup(tep_path);
if (mnt_path[0] == NULL) {
_E("Out of memory");
{
char mount_point[PATH_MAX];
char **mnt_path;
- const char *pkgid;
const char *tpk;
+ const char *root_path;
if (ai == NULL)
return NULL;
- pkgid = amd_appinfo_get_value(ai, AMD_AIT_PKGID);
- if (pkgid == NULL)
- return NULL;
-
tpk = amd_appinfo_get_value(ai, AMD_AIT_MOUNTABLE_PKG);
if (tpk == NULL)
return NULL;
free(mnt_path);
return NULL;
}
- snprintf(mount_point, PATH_MAX, "%s/%s/.pkg",
- __get_app_root_path(ai), pkgid);
+ root_path = amd_appinfo_get_value(ai, AMD_AIT_ROOT_PATH);
+ snprintf(mount_point, PATH_MAX, "%s/.pkg", root_path);
mnt_path[0] = strdup(mount_point);
if (mnt_path[0] == NULL) {
free(mnt_path[1]);