#define OPTVAL_NO_REMOVAL 1003
#define OPTVAL_KEEP_RWDATA 1004
#define OPTVAL_PARTIAL_RW 1005
+#define OPTVAL_MIGRATE_EXTIMG 1006
/* Supported options */
const char *short_opts = "k:l:i:d:c:m:t:o:r:p:s:b:e:M:y:u:w:D:A:qG";
{ "no-remove", 0, NULL, OPTVAL_NO_REMOVAL }, /* for preload RW */
{ "keep-rwdata", 0, NULL, OPTVAL_KEEP_RWDATA }, /* for preload RW */
{ "partial-rw", 0, NULL, OPTVAL_PARTIAL_RW }, /* for preload RO */
+ { "migrate-extimg", 1, NULL, OPTVAL_MIGRATE_EXTIMG },
{ 0, 0, 0, 0 } /* sentinel */
};
};
static uid_t g_target_uid;
+static pkgmgr_privilege_level g_privilege_level = PM_PRIVILEGE_UNKNOWN;
static const char *__get_signal_name(pkgmgr_installer *pi, const char *key,
const char *pkg_type)
return -1;
}
- r = send(fd, data, len, 0);
+ r = send(fd, data, len, MSG_NOSIGNAL);
if (r < 0) {
ERR("failed to send data: %d", errno);
close(fd);
pi->partial_rw = 1;
DBG("partial-rw request [%d]", pi->partial_rw);
break;
+ case OPTVAL_MIGRATE_EXTIMG:
+ /* request for legacy extimg migration */
+ if (mode) {
+ r = -EINVAL;
+ goto RET;
+ }
+ mode = OPTVAL_MIGRATE_EXTIMG;
+ pi->request_type = PKGMGR_REQ_MIGRATE_EXTIMG;
+ if (pi->pkgmgr_info)
+ free(pi->pkgmgr_info);
+ pi->pkgmgr_info = strndup(optarg, MAX_STRLEN);
+ DBG("legacy extimg migration requested");
+ break;
case 'k': /* session id */
if (pi->session_id)
free(pi->session_id);
return ret;
}
+API int pkgmgr_installer_set_privilege_level(pkgmgr_privilege_level level)
+{
+ g_privilege_level = level;
+
+ return 0;
+}
+
API int pkgmgr_installer_info_get_target_uid(uid_t *uid)
{
*uid = g_target_uid;
return 0;
}
+
+API int pkgmgr_installer_info_get_privilege_level(pkgmgr_privilege_level *level)
+{
+ *level = g_privilege_level;
+
+ return 0;
+}