#define WGT_RW_DIR tzplatform_mkpath(TZ_SYS_RO_APP, ".preload-rw-wgt")
static int _install_preload_pkg(const char *backend, const char *directory,
- bool readonly)
+ bool readonly, bool skip_reference_check)
{
DIR *dir;
struct dirent *file_info;
if (pid == 0) {
execl(backend, backend, "-i", file_path,
readonly ? "--preload" : "--preload-rw",
+ skip_reference_check ?
+ "--skip-check-reference" :
+ "",
(char *)NULL);
} else if (pid < 0) {
_E("failed to fork and execute %s!", backend);
char err_msg[BUFSZE];
int handle = -1;
int ret;
+ bool skip_reference_check = false;
if (!_is_authorized(getuid())) {
_E("You are not an authorized user!");
return -1;
}
- if (_install_preload_pkg(TPK_BACKEND_CMD, TPK_DIR, true) < 0)
+ if (argc > 1 && !strcmp(argv[1], "--skip-reference-check"))
+ skip_reference_check = true;
+
+ if (_install_preload_pkg(TPK_BACKEND_CMD, TPK_DIR, true,
+ skip_reference_check) < 0)
goto error;
- if (_install_preload_pkg(WGT_BACKEND_CMD, WGT_DIR, true) < 0)
+ if (_install_preload_pkg(WGT_BACKEND_CMD, WGT_DIR, true,
+ skip_reference_check) < 0)
goto error;
- if (_install_preload_pkg(TPK_BACKEND_CMD, TPK_RW_DIR, false) < 0)
+ if (_install_preload_pkg(TPK_BACKEND_CMD, TPK_RW_DIR, false,
+ skip_reference_check) < 0)
goto error;
- if (_install_preload_pkg(WGT_BACKEND_CMD, WGT_RW_DIR, false) < 0)
+ if (_install_preload_pkg(WGT_BACKEND_CMD, WGT_RW_DIR, false,
+ skip_reference_check) < 0)
goto error;
return 0;