return 0;
}
-int Util::MountLibraryDirectories(const tizen_base::Bundle& b) {
- auto lib_dir = ModifyDirectories(b.GetStringArray(kAulMountLibDir));
- if (!lib_dir.empty()) {
- auto root_path = b.GetString(kAulRootPath);
+int Util::MountGadgetAndLibrary(const tizen_base::Bundle& b) {
+ auto lib_paths = ModifyDirectories(b.GetStringArray(kAulMountLibDir));
+ auto gadget_paths = ValidateAndModifyGadgetPaths(
+ b.GetStringArray(kAulMountGadgetPaths));
+ if (lib_paths.empty() && gadget_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 = root_path + "/bin/.res_mount/";
- if (access(dest.c_str(), F_OK) != 0) {
- auto app_type = b.GetString(kAulAppType);
- if (app_type.find("dotnet") != std::string::npos)
- dest = root_path + "/bin/";
- else
- dest = root_path + "/lib/";
- }
-
- MountDirectories(lib_dir, dest);
- }
+ if (access(dest.c_str(), F_OK) != 0)
+ dest = root_path + "/bin/";
- return 0;
-}
+ std::vector<std::string> source;
+ if (!gadget_paths.empty())
+ source.insert(source.end(), gadget_paths.begin(), gadget_paths.end());
-int Util::MountGadgetDirectories(const tizen_base::Bundle& b) {
- auto gadget_paths = b.GetStringArray(kAulMountGadgetPaths);
- if (!gadget_paths.empty()) {
- gadget_paths = ValidateAndModifyGadgetPaths(gadget_paths);
- auto root_path = b.GetString(kAulRootPath);
- auto dest = root_path + "/bin/.res_mount/";
- if (access(dest.c_str(), F_OK) != 0) dest = root_path + "/bin/";
+ if (!lib_paths.empty())
+ source.insert(source.end(), lib_paths.begin(), lib_paths.end());
- return MountDirectories(gadget_paths, dest);
+ return MountDirectories(source, dest);
}
- return 0;
+ if (lib_paths.empty()) return 0;
+
+ auto dest = root_path + "/lib/";
+ return MountDirectories(lib_paths, dest);
}
int Util::WaitTepMount(const AppInfo* app_info) {
static void DeleteSocketPath(pid_t pid, uid_t uid);
static int EnableExternalPackage(const AppInfo* app_info);
static int MountResourceDirectories(const AppInfo* app_info);
- [[nodiscard]] static int MountGadgetDirectories(const tizen_base::Bundle& b);
+ static int MountGadgetAndLibrary(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 = {});
static int PrepareAppIdFile(const AppInfo* app_info);
static int SendCmdToAmd(enum AmdCmd cmd);
static int SendCmdToAmd(enum AmdCmd cmd, bundle* request, int opt);
- static int MountLibraryDirectories(const tizen_base::Bundle& b);
static std::vector<std::string> Split(const std::string& str,
const std::string& delim);
static std::string ToUpper(std::string str);