Separate .res_mount path(/lib, /gadget, /service) accepted/tizen/unified/20250304.070226 accepted/tizen/unified/x/20250304.080635
authorj-h.choi <j-h.choi@samsung.com>
Fri, 21 Feb 2025 04:42:32 +0000 (13:42 +0900)
committer조웅석/MDE Lab(SR)/삼성전자 <ws77.cho@samsung.com>
Mon, 24 Feb 2025 07:45:57 +0000 (16:45 +0900)
NativeLauncher/installer-plugin/dotnet_apptype_plugin.cc
NativeLauncher/util/path_manager.cc

index e10ebbdf7d5987f0897ca74b05b4c23027766e49..dc9750265a89b7f91e58b32735143e90566280e5 100644 (file)
@@ -73,22 +73,34 @@ extern "C" int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr doc, const char* pkgId)
 
        if (hasResControl(pkgId)) {
                std::string binPath = concatPath(rootPath, "bin");
-               std::string resMountPath = concatPath(binPath, RES_MOUNT_SUB_DIR);
-               if (exist(resMountPath)) {
-                       return 0;
-               }
+               std::string resMount = concatPath(binPath, RES_MOUNT_SUB_DIR);
+               std::string resMountGadgetPath = concatPath(resMount, "gadget");
+               std::string resMountServicePath = concatPath(resMount, "service");
+               std::string resMountLibPath = concatPath(resMount, "lib");
+               std::vector<std::string> resMountPaths = {resMount, resMountGadgetPath, resMountServicePath, resMountLibPath};
 
                // Create a .res_mount folder 3 times to prevent malfunctions in app execution.
                // If folder creation still fails, the app installation is processed to fail.
                for (int i = 1; i <= 4; i++) {
+                       resMountPaths.erase(std::remove_if(resMountPaths.begin(), resMountPaths.end(), [](const std::string& path) {
+                               return exist(path);
+                       }), resMountPaths.end());
+
+                       if (resMountPaths.size() == 0) {
+                               return 0;
+                       }
+
                        if (i == 4) {
                                _ERR("The .res_mount folder could not be created despite 3 attempts. Stop installing the [%s]", pkgId);
                                return -1;
                        }
-                       if (createDir(resMountPath)) {
-                               return 0;
+
+                       for (auto &path : resMountPaths) {
+                               if (exist(path) || createDir(path)) {
+                                       continue;
+                               }
+                               _INFO("Retry %d. Cannot create directory [%s]", i, path.c_str());
                        }
-                       _INFO("Retry %d. Cannot create directory [%s]", i, resMountPath.c_str());
                }
        }
 
index 9d97100a88dbd68c4145fe78b4a9bc5e95dad40b..19dde34bb4e86ac1614bf751ebdc99955751b9b6 100644 (file)
@@ -62,7 +62,12 @@ void PathManager::updateAppRelatedPath(const std::string& appRootPath, const std
        std::string appNIBinPath = concatPath(concatPath(appNIRootPath, "bin"), APP_NI_SUB_DIR);
        std::string appNILibPath = concatPath(concatPath(appNIRootPath, "lib"), APP_NI_SUB_DIR);
 
-       appResMountPath = concatPath(appBinPath, RES_MOUNT_SUB_DIR);
+       std::string resMount = concatPath(appBinPath, RES_MOUNT_SUB_DIR);
+       std::string resMountGadget = concatPath(resMount, "gadget");
+       std::string resMountService = concatPath(resMount, "service");
+       std::string resMountLib = concatPath(resMount, "lib");
+
+       appResMountPath = resMountGadget + ":" + resMountService + ":" + resMountLib;
        appTacPath = concatPath(appBinPath, TAC_SYMLINK_SUB_DIR);
        appPaths = appRootPath + ":" + appBinPath + ":" + appLibPath + ":" + appTacPath;
        appNIPaths = appNIBinPath + ":" + appNILibPath + ":" + appTacPath;