Apply the change of skel root path from /etc to /opt/etc 40/102740/18 accepted/tizen/3.0/common/20170109.083940 accepted/tizen/3.0/ivi/20170106.095011 accepted/tizen/3.0/mobile/20170106.094820 accepted/tizen/3.0/tv/20170106.094913 accepted/tizen/3.0/wearable/20170106.094941 accepted/tizen/common/20170110.085220 accepted/tizen/ivi/20170106.103643 accepted/tizen/mobile/20170106.103448 accepted/tizen/tv/20170106.103532 accepted/tizen/wearable/20170106.103608 submit/tizen/20170105.051706 submit/tizen_3.0/20170105.051635
authorjongmyeongko <jongmyeong.ko@samsung.com>
Tue, 6 Dec 2016 11:00:11 +0000 (20:00 +0900)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Thu, 5 Jan 2017 05:53:27 +0000 (21:53 -0800)
The change of skel root path is from readonly mount policy of root filesystem.
(/etc is included in root filesystem.)
Because the skel is designed as writable concept, the root path of skel should be changed in RW partition.

Change-Id: Iec87da4ee3533fb415114bc8c24e138e4cb01257
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
src/common/security_registration.cc
src/common/shared_dirs.cc
src/common/step/filesystem/step_create_per_user_storage_directories.cc

index 8aff02447f8c42d5eacbf55400b6bb97722c11d9..427d312ae026ad8a784c29277c539dee08333508 100644 (file)
@@ -49,7 +49,7 @@ const std::vector<std::pair<const char*, app_install_type>> kPathPolicies = {
   {tzplatform_getenv(TZ_SYS_HOME), SM_APP_INSTALL_LOCAL},
   {tzplatform_getenv(TZ_SYS_RW_APP), SM_APP_INSTALL_GLOBAL},
   {tzplatform_getenv(TZ_SYS_RO_APP), SM_APP_INSTALL_PRELOADED},
-  {tzplatform_mkpath(TZ_SYS_RO_ETC, "skel"), SM_APP_INSTALL_PRELOADED},
+  {tzplatform_mkpath(TZ_SYS_ETC, "skel"), SM_APP_INSTALL_PRELOADED},
 };
 
 bool PrepareRequest(const std::string& app_id, const std::string& pkg_id,
index c9d1de2d75a73e90cd4e850af4e256696683e41c..5de70392c5e309a044f304c14546099c0e24c01b 100644 (file)
@@ -69,7 +69,7 @@ const std::vector<const char*> kReadOnlyEntries = {
 const char kSharedResDir[] = "shared/res";
 const char kSharedDataDir[] = "shared/data";
 const char kSharedTrustedDir[] = "shared/trusted";
-const char kSkelAppDir[] = "/etc/skel/apps_rw";
+const char kSkelAppDir[] = "skel/apps_rw";
 const char kExternalStoragePrivilege[] =
     "http://tizen.org/privilege/externalstorage.appdata";
 const char kSystemShareGroupName[] = "system_share";
@@ -434,7 +434,8 @@ bool CreateSkelDirectories(const std::string& pkgid,
                            const std::string& api_version,
                            bool trusted, bool shareddata, bool is_readonly,
                            const std::vector<const char*> additional_dirs) {
-  bf::path path = bf::path(kSkelAppDir) / pkgid;
+  bf::path path = bf::path(tzplatform_getenv(TZ_SYS_ETC)) /
+                  bf::path(kSkelAppDir) / pkgid;
   LOG(DEBUG) << "Creating directories in: " << path;
 
   utils::VersionNumber api_ver(api_version);
@@ -481,7 +482,9 @@ bool CreateSkelDirectories(const std::string& pkgid,
 
 
 bool DeleteSkelDirectories(const std::string& pkgid) {
-  return DeleteDirectories(bf::path(kSkelAppDir), pkgid);
+  bf::path path = bf::path(tzplatform_getenv(TZ_SYS_ETC)) /
+                  bf::path(kSkelAppDir);
+  return DeleteDirectories(path, pkgid);
 }
 
 
@@ -528,7 +531,8 @@ bool CopyUserDirectories(const std::string& pkgid) {
     uid_t uid = std::get<0>(l);
     LOG(DEBUG) << "Copying directories for uid: " << uid;
     bf::path apps_rw(std::get<2>(l) / "apps_rw");
-    bf::path src = bf::path(kSkelAppDir) / pkgid;
+    bf::path src = bf::path(tzplatform_getenv(TZ_SYS_ETC)) /
+                   bf::path(kSkelAppDir) / pkgid;
     bf::path dst = apps_rw / pkgid;
     if (!ci::CopyDir(src, dst, FSFlag::FS_NONE, true))
       continue;
index 6fd400ab4cf828472dbb20ed1783004a7194c286..1de1c7e6ddd5536a60fc65c3f0fe6b6caf4b2410 100644 (file)
@@ -36,14 +36,10 @@ Step::Status StepCreatePerUserStorageDirectories::process() {
       break;
     }
   }
-  // Now, /etc/skel is RO mounted region, so we should skip the creation.
-  if (!context_->partial_rw.get()) {
-    if (!common_installer::CreateSkelDirectories(package_id,
-        str_ver, trusted, shareddata, context_->is_readonly_package.get(),
-        additional_shared_dirs_)) {
-      LOG(ERROR) << "Failed to create skel dirs";
-      return Status::APP_DIR_ERROR;
-    }
+  if (!common_installer::CreateSkelDirectories(package_id,
+      str_ver, trusted, shareddata, context_->is_readonly_package.get())) {
+    LOG(ERROR) << "Failed to create skel dirs";
+    return Status::APP_DIR_ERROR;
   }
 
   if (!CopyUserDirectories(package_id)) {