setenv("GADGET_PKGIDS", pkgids.c_str(), 1);
}
+void SetServicePkgIdsEnvironments(const tizen_base::Bundle& b) {
+ auto service_pkgids = b.GetStringArray(kAulMountServicePkgIds);
+ if (service_pkgids.empty()) return;
+
+ std::string pkgids;
+ for (auto& pkgid : service_pkgids) {
+ if (!pkgids.empty()) pkgids += ":";
+
+ pkgids += pkgid;
+ }
+
+ setenv("SERVICE_PACKAGES", pkgids.c_str(), 1);
+}
+
#ifdef TIZEN_FEATURE_SET_PERSONALITY_32
static void SetExecutionDomain() {
int ret = personality(PER_LINUX32);
setenv("GCOV_PREFIX", "/tmp", 1);
setenv("DALI_DISABLE_PARTIAL_UPDATE", "0", 1);
SetGadgetPkgIdsEnvironments(b);
+ SetServicePkgIdsEnvironments(b);
}
void Util::DeleteSocketDirectory(pid_t pid) {
}
int Util::MountGadgetDirectories(const tizen_base::Bundle& b) {
- auto gadget_paths =
- ValidateAndModifyGadgetPaths(b.GetStringArray(kAulMountGadgetPaths));
+ auto gadget_paths = ValidateAndModifyGadgetPaths(
+ b.GetStringArray(kAulMountGadgetPaths));
if (gadget_paths.empty()) return 0;
auto app_type = b.GetString(kAulAppType);
return MountDirectories(lib_paths, dest);
}
+int Util::MountServiceDirectories(const tizen_base::Bundle& b) {
+ auto service_paths =
+ ModifyDirectories(b.GetStringArray(kAulMountServicePaths));
+
+ if (service_paths.empty()) return 0;
+
+ auto root_path = b.GetString(kAulRootPath);
+ auto app_type = b.GetString(kAulAppType);
+ if (app_type.find("dotnet") != std::string::npos) {
+ auto dest = GetDestPath(root_path, "service");
+ return MountDirectories(service_paths, dest);
+ }
+
+ if (service_paths.empty()) return 0;
+
+ auto dest = root_path + "/bin/";
+ return MountDirectories(service_paths, dest);
+}
+
int Util::WaitTepMount(const AppInfo* app_info) {
if (app_info->GetBundle().GetType(kAulTepPath) == BUNDLE_TYPE_NONE)
return 0;
static int MountResourceDirectories(const AppInfo* app_info);
static int MountGadgetDirectories(const tizen_base::Bundle& b);
static int MountLibraryDirectories(const tizen_base::Bundle& b);
+ static int MountServiceDirectories(const tizen_base::Bundle& b);
static int WaitTepMount(const AppInfo* app_info);
static std::string GetLibDirectory(const std::string& app_path);
static void CloseAllFds(const std::vector<int>& except_fds = {});