Modify destination of library and gadget mount 67/319667/3
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 29 Oct 2024 22:48:34 +0000 (07:48 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Wed, 30 Oct 2024 01:49:59 +0000 (01:49 +0000)
Currently, the library package is mounted to 'lib/' directory.
If the app type of the application is 'dotnet', the resources
should be mounted to 'bin/.rpk/' directory.
If the destination is not existed, we should try to mount resources to
'bin/' directory.

Change-Id: Ia2b3dfd2ae852441eb6bbeddd357696916850463
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/launchpad-core/util.cc

index 981b05f30b04d54d150027e902c1f8b35d46e261..f75c6dadef53a7be4afbf8d3cb455a74f07ce852 100644 (file)
@@ -512,7 +512,16 @@ 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);
-    MountDirectories(lib_dir, root_path + "/lib/");
+    auto dest = root_path + "/bin/.rpk/";
+    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);
   }
 
   return 0;
@@ -523,7 +532,10 @@ int Util::MountGadgetDirectories(const tizen_base::Bundle& b) {
   if (!gadget_paths.empty()) {
     gadget_paths = ValidateAndModifyGadgetPaths(gadget_paths);
     auto root_path = b.GetString(kAulRootPath);
-    return MountDirectories(gadget_paths, root_path + "/bin");
+    auto dest = root_path + "/bin/.rpk/";
+    if (access(dest.c_str(), F_OK) != 0) dest = root_path + "/bin/";
+
+    return MountDirectories(gadget_paths, dest);
   }
 
   return 0;