merge with master
authorJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:16:57 +0000 (01:16 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:16:57 +0000 (01:16 +0900)
osp-service-app-loader/CMakeLists.txt
osp-service-app-loader/serviceapp_loader.c
osp-system-service-loader/CMakeLists.txt
osp-system-service-loader/systemservice_loader.c
osp-ui-app-loader/CMakeLists.txt
osp-ui-app-loader/uiapp_loader.c
packaging/osp-loader.spec

index 42c69e2..77a58ae 100755 (executable)
@@ -18,4 +18,4 @@ SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EX
 TARGET_LINK_LIBRARIES(${this_target} "-ldl -ldlog -laul")
 TARGET_LINK_LIBRARIES(${this_target} "-Wl,--no-undefined -Wl,--as-needed -pie")
 
-INSTALL(TARGETS ${this_target} DESTINATION lib/osp)
+INSTALL(TARGETS ${this_target} DESTINATION ${LIB_INSTALL_DIR}/osp)
index c229cc4..b49d1c8 100644 (file)
@@ -33,7 +33,9 @@
 #include <dlog.h>
 #include <privilege-control.h>
 
-#define LOG_LOADER_TAG "LDR_LOG"
+#undef LOG_TAG
+#define LOG_TAG "LOADER"
+
 #define MAX_APPID 20
 #define MAX_APP_EXECUTABLE_NAME 230
 
@@ -48,7 +50,7 @@ print_args(int argc, char* argv[])
        for (; i < argc; i++)
        {
                p = argv[i];
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "%dth arg : [%s]", i, p);
+               LOGI("%dth arg : [%s]", i, p);
        }
 }
 
@@ -143,27 +145,27 @@ osp_do_pre_exe(const char* bin_path)
        handle = dlopen("libosp-env-config.so", RTLD_LAZY | RTLD_LOCAL);
        if (!handle)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::Io > Failed to dlopen osp-env-config.so (%s)", dlerror());
+               LOGE("Failed to dlopen osp-env-config.so (%s)", dlerror());
                return -1;
        }
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > dlopen() ok");
+       LOGI("Tizen::App > dlopen() ok");
 
        do_pre_exec_fn = (int (*)(const char*, const char*)) dlsym(handle, "do_pre_exec");
        errormsg = dlerror();
        if (errormsg != NULL)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to dlsym() (%s)", errormsg);
+               LOGE("Failed to dlsym() (%s)", errormsg);
                dlclose(handle);
                return -1;
        }
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > dlsym() ok");
+       LOGI("dlsym() ok");
 
        ret = do_pre_exec_fn(NULL, bin_path);
        if (ret < 0)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to do_pre_exe() (%d)", ret);
+               LOGE("Failed to do_pre_exe() (%d)", ret);
        }
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > do_pre_exec() ok");
+       LOGI("do_pre_exec() ok");
 
        dlclose(handle);
 
@@ -178,7 +180,7 @@ get_appid_executable_name_from_path(const char path[], char appid[], char execut
        const char* p = strrchr(path, '/');
        if (p == NULL)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Improper path %s", __func__, __LINE__, path);
+               LOGI("Improper path %s", path);
                return -1;
        }
 
@@ -186,23 +188,23 @@ get_appid_executable_name_from_path(const char path[], char appid[], char execut
        const int exec_len = strlen(p);
        if (exec_len <= 0 || exec_len > PATH_MAX || path_len <= 0 || path_len > PATH_MAX)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Improper path %s", __func__, __LINE__, path);
+               LOGI("Improper path %s", path);
                return -1;
        }
 
        strncpy(executable_name, p + 1, exec_len);
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, exeName is %s", executable_name);
+       LOGI("exeName is %s", executable_name);
 
        if (path_len < /* '/' */ 1 + 10 + strlen("/bin/") + exec_len)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Improper path %s", __func__, __LINE__, path);
+               LOGI("Improper path %s", path);
                return -1;
        }
 
        strncpy(appid, p - strlen("bin/") - 10, 10);
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, appId is %s", appid);
+       LOGI("appId is %s", appid);
 
        return 1;
 }
@@ -230,7 +232,7 @@ get_dir_fd_from_path(const char* path)
                }   
        }   
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Wrong path format : %s.", __func__, __LINE__, path);
+       LOGI("Wrong path format : %s.", path);
 
        return -1; 
 
@@ -239,7 +241,7 @@ OUT:
 
        const int fd = open(dname, O_RDONLY | O_CLOEXEC | O_DIRECTORY);
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Directory path : %s, fd : %d.", __func__, __LINE__, dname, fd);
+       LOGI("Directory path : %s, fd : %d.", dname, fd);
        return fd; 
 }
 
@@ -258,13 +260,13 @@ main(int argc, char* argv[])
        memset(appid, 0, sizeof(appid));
        memset(executable_name, 0, sizeof(executable_name));
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Initializing.", __func__, __LINE__);
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > argc %d, argv 0x%x.", __func__, __LINE__, argc, argv);
+       LOGI("Initializing.");
+       LOGI("argc %d, argv 0x%x.", argc, argv);
        print_args(argc, argv);
 
        // convert package path to appId
        get_appid_executable_name_from_path(argv[0], appid, executable_name);
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Osp appId %s.", __func__, __LINE__, appid);
+       LOGI("Osp appId %s.", appid);
 
 
        if (getuid() == 0)
@@ -288,7 +290,7 @@ main(int argc, char* argv[])
        real_handle = dlopen(buffer, RTLD_LAZY);
        if (!real_handle)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to open %s : %s.", buffer, dlerror());
+               LOGE("Failed to open %s : %s.", buffer, dlerror());
                return -1;
        }
 
@@ -296,7 +298,7 @@ main(int argc, char* argv[])
        errormsg = dlerror();
        if (errormsg != NULL)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to find InitAppInfo() : %s.", errormsg);
+               LOGE("Failed to find InitAppInfo() : %s.", errormsg);
                dlclose(real_handle);
                fprintf(stderr, "executable does not have proper osp library dependency.\n");
                return -1;
@@ -305,7 +307,7 @@ main(int argc, char* argv[])
        int fd = get_dir_fd_from_path(argv[0]);
        if (fd == -1)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to open path.");
+               LOGE("Failed to open path.");
                fprintf(stderr, "Failed to open %s.\n", argv[0]);
                dlclose(real_handle);
                return -1;
@@ -315,7 +317,7 @@ main(int argc, char* argv[])
        errormsg = dlerror();
        if (errormsg != NULL)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to find OspMain() : %s.", errormsg);
+               LOGE("Failed to find OspMain() : %s.", errormsg);
                dlclose(real_handle);
                return -1;
        }
@@ -324,10 +326,10 @@ main(int argc, char* argv[])
        (*pAppInfoInit)(appid, executable_name, argc, argv, fd);
        (*pRealMain)(argc, argv);
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Osp application terminates.", __func__, __LINE__);
+       LOGI("Osp application terminates.");
 
        //dlclose(real_handle);
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Osp cleanup finished for %s.", __func__, __LINE__, argv[0]);
+       LOGI("Osp cleanup finished for %s.", argv[0]);
 
        return 0;
 }
index d98054f..1f8e518 100755 (executable)
@@ -18,6 +18,6 @@ SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EX
 TARGET_LINK_LIBRARIES(${this_target} "-ldl -ldlog -laul")
 TARGET_LINK_LIBRARIES(${this_target} "-Wl,--no-undefined -Wl,--as-needed -pie")
 
-INSTALL(TARGETS ${this_target} DESTINATION lib/osp)
+INSTALL(TARGETS ${this_target} DESTINATION ${LIB_INSTALL_DIR}/osp)
 
 
index 27cf98c..d94a187 100644 (file)
@@ -30,7 +30,9 @@
 #include <aul.h>
 #include <dlog.h>
 
-#define LOG_LOADER_TAG "LDR_LOG"
+#undef LOG_TAG
+#define LOG_TAG "LOADER"
+
 #define MAX_APPID 20
 #define MAX_APP_EXECUTABLE_NAME 230
 
@@ -45,7 +47,7 @@ print_args(int argc, char* argv[])
        for (; i < argc; i++)
        {
                p = argv[i];
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "%dth arg : [%s]", i, p);
+               LOGI("%dth arg : [%s]", i, p);
        }
 }
 
@@ -60,27 +62,27 @@ osp_do_pre_exe(const char* bin_path)
        handle = dlopen("libosp-env-config.so", RTLD_LAZY | RTLD_LOCAL);
        if (!handle)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::Io > Failed to dlopen libosp-env-config.so (%s)", dlerror());
+               LOGE("Failed to dlopen libosp-env-config.so (%s)", dlerror());
                return -1;
        }
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > dlopen() ok");
+       LOGI("dlopen() ok");
 
        do_pre_exec_fn = (int (*)(const char*, const char*)) dlsym(handle, "do_pre_exec");
        errormsg = dlerror();
        if (errormsg != NULL)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to dlsym() (%s)", errormsg);
+               LOGE("Failed to dlsym() (%s)", errormsg);
                dlclose(handle);
                return -1;
        }
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > dlsym() ok");
+       LOGI("dlsym() ok");
 
        ret = do_pre_exec_fn(NULL, bin_path);
        if (ret < 0)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to do_pre_exe() (%d)", ret);
+               LOGE("Failed to do_pre_exe() (%d)", ret);
        }
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > do_pre_exec() ok");
+       LOGI("do_pre_exec() ok");
 
        dlclose(handle);
 
@@ -100,18 +102,18 @@ get_appid_executable_name_from_path(const char path[], char appid[], char execut
        const char* p = strstr(path, "/opt/apps/");
        if (p == NULL)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Improper path %s", __func__, __LINE__, path);
+               LOGI("Improper path %s", path);
                return -1;
        }
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Proper appId format", __func__, __LINE__);
+       LOGI("Proper appId format");
 
        begin = p + 9;
 
        end = strchr(begin + 1, '/');
        if (end == NULL)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, Improper path %s", path);
+               LOGI("Improper path %s", path);
                return -1;
        }
 
@@ -119,12 +121,12 @@ get_appid_executable_name_from_path(const char path[], char appid[], char execut
 
        if (len > MAX_APPID)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, Improper path %s with length %d", path, len);
+               LOGI("Improper path %s with length %d", path, len);
                return -1;
        }
 
        strncpy(appid, begin + 1, len);
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, appId is %s", appid);
+       LOGI("appId is %s", appid);
 
        int exe_len = 0;
 
@@ -134,7 +136,7 @@ get_appid_executable_name_from_path(const char path[], char appid[], char execut
                strncpy(executable_name, end + 5, exe_len);
        }
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, exeName is %s", executable_name);
+       LOGI("exeName is %s", executable_name);
 
        return 1;
 }
@@ -162,7 +164,7 @@ get_dir_fd_from_path(const char* path)
                }   
        }   
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Wrong path format : %s.", __func__, __LINE__, path);
+       LOGI("Wrong path format : %s.", path);
 
        return -1; 
 
@@ -171,7 +173,7 @@ OUT:
 
        const int fd = open(dname, O_RDONLY | O_CLOEXEC | O_DIRECTORY);
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Directory path : %s, fd : %d.", __func__, __LINE__, dname, fd);
+       LOGI("Directory path : %s, fd : %d.", dname, fd);
        return fd; 
 }
 
@@ -190,13 +192,13 @@ main(int argc, char* argv[])
        memset(appid, 0, sizeof(appid));
        memset(executable_name, 0, sizeof(executable_name));
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Initializing.", __func__, __LINE__);
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > argc %d, argv 0x%x.", __func__, __LINE__, argc, argv);
+       LOGI("Initializing.");
+       LOGI("argc %d, argv 0x%x.", argc, argv);
        print_args(argc, argv);
 
        // convert package path to appId
        get_appid_executable_name_from_path(argv[0], appid, executable_name);
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Osp appId %s.", __func__, __LINE__, appid);
+       LOGI("Osp appId %s.", appid);
 
 
        if (getuid() == 0)
@@ -217,7 +219,7 @@ main(int argc, char* argv[])
        real_handle = dlopen(buffer, RTLD_LAZY);
        if (!real_handle)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to open %s : %s.", buffer, dlerror());
+               LOGE("Failed to open %s : %s.", buffer, dlerror());
                return -1;
        }
 
@@ -225,7 +227,7 @@ main(int argc, char* argv[])
        errormsg = dlerror();
        if (errormsg != NULL)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to find InitAppInfo() : %s.", errormsg);
+               LOGE("Failed to find InitAppInfo() : %s.", errormsg);
                dlclose(real_handle);
                fprintf(stderr, "executable does not have proper osp library dependency.\n");
                return -1;
@@ -234,7 +236,7 @@ main(int argc, char* argv[])
        int fd = get_dir_fd_from_path(argv[0]);
        if (fd == -1)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to open path.");
+               LOGE("Failed to open path.");
                fprintf(stderr, "Failed to open %s.\n", argv[0]);
                dlclose(real_handle);
                return -1;
@@ -244,7 +246,7 @@ main(int argc, char* argv[])
        errormsg = dlerror();
        if (errormsg != NULL)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to find OspMain() : %s.", errormsg);
+               LOGE("Failed to find OspMain() : %s.", errormsg);
                dlclose(real_handle);
                return -1;
        }
@@ -253,10 +255,10 @@ main(int argc, char* argv[])
        (*pAppInfoInit)(appid, executable_name, argc, argv, fd);
        (*pRealMain)(argc, argv);
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Osp application terminates.", __func__, __LINE__);
+       LOGI("Osp application terminates.");
 
        //dlclose(real_handle);
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Osp cleanup finished for %s.", __func__, __LINE__, argv[0]);
+       LOGI("Osp cleanup finished for %s.", argv[0]);
 
        return 0;
 }
index 8b347e8..75298cf 100755 (executable)
@@ -19,6 +19,6 @@ SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EX
 TARGET_LINK_LIBRARIES(${this_target} "-ldl -ldlog -laul")
 TARGET_LINK_LIBRARIES(${this_target} "-Wl,--no-undefined -Wl,--as-needed -pie")
 
-INSTALL(TARGETS ${this_target} DESTINATION lib/osp)
+INSTALL(TARGETS ${this_target} DESTINATION ${LIB_INSTALL_DIR}/osp)
 
 
index 7a0c190..ab327e6 100644 (file)
@@ -34,7 +34,9 @@
 #include <dlog.h>
 #include <privilege-control.h>
 
-#define LOG_LOADER_TAG "LDR_LOG"
+#undef LOG_TAG
+#define LOG_TAG "LOADER"
+
 #define MAX_APPID 20
 #define MAX_APP_EXECUTABLE_NAME 230
 #define MAX_PACKAGE_NAME 100
@@ -43,7 +45,6 @@
 
 
 static const char APPFW_SONAME[] = "libosp-appfw.so.1";
-static int __legacyMode = 0;
 
 #if 0
 #define SPLASH_WINDOW_PACKAGE_NAME "com.samsung.splash"
@@ -69,7 +70,7 @@ print_args(int argc, char* argv[])
        for (; i < argc; i++)
        {
                p = argv[i];
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "%dth arg : [%s]", i, p);
+               LOGD("%dth arg : [%s]", i, p);
        }
 }
 
@@ -163,27 +164,27 @@ osp_do_pre_exe(const char* bin_path)
        handle = dlopen("libosp-env-config.so", RTLD_LAZY | RTLD_LOCAL);
        if (!handle)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::Io > Failed to dlopen osp-env-config.so (%s)", dlerror());
+               LOGE("Failed to dlopen osp-env-config.so (%s)", dlerror());
                return -1;
        }
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > dlopen() ok");
+       LOGD("dlopen() ok");
 
        do_pre_exec_fn = (int (*)(const char*, const char*)) dlsym(handle, "do_pre_exec");
        errormsg = dlerror();
        if (errormsg != NULL)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to dlsym() (%s)", errormsg);
+               LOGE("Failed to dlsym() (%s)", errormsg);
                dlclose(handle);
                return -1;
        }
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > dlsym() ok");
+       LOGD("dlsym() ok");
 
        ret = do_pre_exec_fn(NULL, bin_path);
        if (ret < 0)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to do_pre_exe() (%d)", ret);
+               LOGE("Failed to do_pre_exe() (%d)", ret);
        }
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > do_pre_exec() ok");
+       LOGD("do_pre_exec() ok");
 
        dlclose(handle);
 
@@ -191,14 +192,14 @@ osp_do_pre_exe(const char* bin_path)
 }
 
 static int
-get_appid_executable_name_from_path_new(const char path[], char appid[], char executable_name[])
+get_appid_executable_name_from_path(const char path[], char appid[], char executable_name[])
 {
        // path is "/opt/apps/[appid]/bin/[executable_name]"
 
        const char* p = strrchr(path, '/');
        if (p == NULL)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Improper path %s", __func__, __LINE__, path);
+               LOGI("Improper path %s", path);
                return -1;
        }
 
@@ -206,95 +207,35 @@ get_appid_executable_name_from_path_new(const char path[], char appid[], char ex
        const int exec_len = strlen(p);
        if (exec_len <= 0 || exec_len > PATH_MAX || path_len <= 0 || path_len > PATH_MAX)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Improper path %s", __func__, __LINE__, path);
+               LOGI("Improper path %s", path);
                return -1;
        }
 
        strncpy(executable_name, p + 1, exec_len);
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, exeName is %s", executable_name);
+       LOGI("ExeName is %s", executable_name);
 
        if (path_len < /* '/' */ 1 + 10 + strlen("/bin/") + exec_len)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Improper path %s", __func__, __LINE__, path);
+               LOGI("Improper path %s", path);
                return -1;
        }
 
        strncpy(appid, p - strlen("bin/") - 10, 10);
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, appId is %s", appid);
+       LOGI("PackageId is %s", appid);
 
        return 1;
 }
 
-static int
-get_appid_executable_name_from_path(const char path[], char appid[], char executable_name[])
-{
-       const char* begin = NULL;
-       const char* end = NULL;
-       const int path_len = strlen(path);
-
-       // path is "/opt/apps/[appid]/bin/[executable_name]"
-
-       // Calculate the header
-       const char* p = strstr(path, "/apps/org.tizen.");
-       if (p == NULL)
-       {
-               return get_appid_executable_name_from_path_new(path, appid, executable_name);
-       }
-
-       __legacyMode = 1;
-
-       begin = p + 15;
-
-       end = strchr(begin + 1, '/');
-       if (end == NULL)
-       {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, Improper path %s", path);
-               return -1;
-       }
-
-       const int len = end - begin - 1;
-
-       if (len > MAX_APPID)
-       {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, Improper path %s with length %d", path, len);
-               return -1;
-       }
-
-       strncpy(appid, begin + 1, len);
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, appId is %s", appid);
-
-       int exe_len = 0;
-
-       if (path_len > len + 21)
-       {
-               exe_len = MIN(MAX_APP_EXECUTABLE_NAME - 1, path_len - len - 21);
-               strncpy(executable_name, end + 5, exe_len);
-       }
-
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, exeName is %s", executable_name);
-
-       return 1;
-}
 
 static int
 get_package_name_from_appid_executable_name(const char appid[], const char executable_name[], char package_name[])
 {
-       if (__legacyMode == 1)
-       {
-               // package name is "org.tizen.[appid]#[executable_name]"
+       // package name is "[appid]"
 
-               snprintf(package_name, MAX_PACKAGE_NAME, "org.tizen.%s#%s", appid, executable_name);
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, package_name is %s", package_name);
-       }
-       else
-       {
-               // package name is "[appid]"
-
-               snprintf(package_name, MAX_PACKAGE_NAME, "%s", appid);
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, package_name is %s", package_name);
-       }
+       snprintf(package_name, MAX_PACKAGE_NAME, "%s", appid);
+       LOGI("Package_name is %s", package_name);
 
        return 0;
 }
@@ -322,7 +263,7 @@ get_dir_fd_from_path(const char* path)
                }
        }
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Wrong path format : %s.", __func__, __LINE__, path);
+       LOGI("Wrong path format : %s.", path);
 
        return -1;
 
@@ -331,7 +272,7 @@ OUT:
 
        const int fd = open(dname, O_RDONLY | O_CLOEXEC | O_DIRECTORY);
        
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Directory path : %s, fd : %d.", __func__, __LINE__, dname, fd);
+       LOGI("Directory path : %s, fd : %d.", dname, fd);
        return fd;
 }
 
@@ -351,14 +292,13 @@ main(int argc, char* argv[])
        memset(executable_name, 0, sizeof(executable_name));
        memset(package_name, 0, sizeof(package_name));
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Initializing.", __func__, __LINE__);
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > argc %d, argv 0x%x.", __func__, __LINE__, argc, argv);
+       LOGI("Initializeing : argc %d, argv 0x%x.", argc, argv);
        print_args(argc, argv);
 
        // convert package path to package name
        get_appid_executable_name_from_path(argv[0], appid, executable_name);
        get_package_name_from_appid_executable_name(appid, executable_name, package_name);
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Osp package_name %s.", __func__, __LINE__, package_name);
+       LOGI("Osp package_name %s.", package_name);
 
 #if 0
        // pequest splash window
@@ -392,7 +332,7 @@ main(int argc, char* argv[])
        void* so_handle = dlopen(APPFW_SONAME, RTLD_LAZY);
        if (!so_handle)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to open framework : %s.", dlerror());
+               LOGE("Failed to open framework : %s.", dlerror());
                return -1;
        }
 
@@ -400,7 +340,7 @@ main(int argc, char* argv[])
        errormsg = dlerror();
        if (errormsg != NULL)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to find InitAppInfo() : %s.", errormsg);
+               LOGE("Failed to find InitAppInfo() : %s.", errormsg);
                fprintf(stderr, "Improper osp library entry : %s.\n", errormsg);
                dlclose(so_handle);
                return -1;
@@ -409,7 +349,7 @@ main(int argc, char* argv[])
        int fd = get_dir_fd_from_path(argv[0]);
        if (fd == -1)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to open path.");
+               LOGE("Failed to open path.");
                fprintf(stderr, "Failed to open %s.\n", argv[0]);
                dlclose(so_handle);
                return -1;
@@ -418,7 +358,7 @@ main(int argc, char* argv[])
        handle = dlopen(buffer, RTLD_LAZY | RTLD_GLOBAL);
        if (!handle)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to open %s : %s.", buffer, dlerror());
+               LOGE("Failed to open %s : %s.", buffer, dlerror());
                dlclose(so_handle);
                return -1;
        }
@@ -427,7 +367,7 @@ main(int argc, char* argv[])
        errormsg = dlerror();
        if (errormsg != NULL)
        {
-               LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App > Failed to find OspMain() : %s.", errormsg);
+               LOGE("Failed to find OspMain() : %s.", errormsg);
                dlclose(handle);
                dlclose(so_handle);
                return -1;
@@ -437,10 +377,10 @@ main(int argc, char* argv[])
        (*pAppInfoInit)(appid, executable_name, argc, argv, fd);
        (*pRealMain)(argc, argv);
 
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Osp application terminates.", __func__, __LINE__);
+       LOGI("Osp application terminates.");
 
        dlclose(handle);
-       LOG(LOG_DEBUG, LOG_LOADER_TAG, "Tizen::App, %s, %d > Osp cleanup finished for %s.", __func__, __LINE__, argv[0]);
+       LOGI("Osp cleanup finished for %s.", argv[0]);
 
        return 0;
 }
index e9542c2..452029b 100755 (executable)
@@ -1,17 +1,17 @@
 Name:          osp-loader
 Summary:       osp application loader
-Version:       1.2.0.0
+Version:       1.2.1.0
 Release:       1
 Group:         TO_BE/FILLED_IN
-License:       Apache License, Version 2.0 or Flora
+License:       Apache-2.0 or Flora
 Source0:       %{name}-%{version}.tar.gz
 BuildRequires: cmake
 BuildRequires: pkgconfig(aul)
-BuildRequires:  pkgconfig(dlog)
-BuildRequires:  pkgconfig(libprivilege-control)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(libprivilege-control)
 
 # runtime requires
-Requires: osp-env-config 
+Requires: osp-env-config
 
 %description
 osp application loader
@@ -20,10 +20,10 @@ osp application loader
 %setup -q
 
 %build 
-%ifarch %{ix86}
-CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ -D_OSP_EMUL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+%ifarch %{ix86} x86_64
+CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ -D_OSP_EMUL_" %cmake .
 %else
-CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_OSP_ARMEL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_OSP_ARMEL_" %cmake .
 %endif
 
 # Call make instruction with smp support