Remove hardcoded path for multiuser support 90/17090/6 tizen_3.0.m14.2_ivi submit/tizen_common/20140521.163740 submit/tizen_common/20140521.232441 submit/tizen_common/20140522.130648 submit/tizen_common/20140522.135644 submit/tizen_common/20140522.140947 submit/tizen_ivi/20140618.000000 submit/tizen_ivi/20140618.000001 submit/tizen_ivi/20140619.000000 submit/tizen_ivi/20140622.000000 submit/tizen_ivi/20140623.000000 submit/tizen_ivi/20140624.064036 submit/tizen_ivi/20140626.125712 submit/tizen_ivi/20140626.130032 submit/tizen_ivi/20140626.144348 tizen_3.0.m14.2_ivi_release
authorSabera Djelti (sdi2) <sabera.djelti@open.eurogiciel.org>
Mon, 3 Mar 2014 17:14:11 +0000 (18:14 +0100)
committerSabera Djelti (sdi2) <sabera.djelti@open.eurogiciel.org>
Fri, 18 Apr 2014 13:24:01 +0000 (15:24 +0200)
Change-Id: I5094dd358fb75fc618a196477725b4227e4d8b6b
Bug-Tizen: PTREL-283
Signed-off-by: Sabera Djelti (sdi2) <sabera.djelti@open.eurogiciel.org>
15 files changed:
CMakeLists.txt
packaging/system-server.spec
pm_event/CMakeLists.txt
pm_event/pm_event.c
scripts/mmc-smack-label
src/bs/bs.c
src/core/data.h
src/display/core.c
src/mmc/mmc-handler.c
src/mmc/mmc-handler.h
src/time/time-handler.c
sysman/CMakeLists.txt
sysman/set_pmon/regpmon
utils/mmc-smack-label [deleted file]
utils/regpmon

index 891c2c9..d4e7158 100755 (executable)
@@ -120,6 +120,7 @@ SET( local_pkgs
        notification
        libsmack
        libsystemd-daemon
+       libtzplatform-config
 )
 
 IF(X11_SUPPORT)
index c6249ad..533f010 100755 (executable)
@@ -37,6 +37,8 @@ BuildRequires:  gettext
 BuildRequires:  pkgconfig(sensor)
 BuildRequires:  pkgconfig(libsystemd-daemon)
 BuildRequires:  pkgconfig(capi-base-common)
+BuildRequires:  pkgconfig(libtzplatform-config)
+
 %{?systemd_requires}
 Requires(preun): /usr/bin/systemctl
 Requires(post): /usr/bin/systemctl
@@ -178,7 +180,7 @@ cp %{SOURCE3} .
 cp %{SOURCE4} .
 cp %{SOURCE5} .
 cp %{SOURCE6} .
-%cmake .
+%cmake . -DTZ_SYS_ETC=%TZ_SYS_ETC
 
 %install
 rm -rf %{buildroot}
@@ -199,6 +201,8 @@ rm -f %{buildroot}%{_bindir}/restart
 
 %post
 #memory type vconf key init
+users_gid=$(getent group $TZ_SYS_USER_GROUP | cut -f3 -d':')
+
 vconftool set -t int memory/sysman/usbhost_status -1 -i
 vconftool set -t int memory/sysman/mmc 0 -i
 vconftool set -t int memory/sysman/earjack_key 0 -i
@@ -217,10 +221,10 @@ vconftool set -t int memory/sysman/mmc_unmount -1 -i
 vconftool set -t int memory/sysman/mmc_format -1 -i
 vconftool set -t int memory/sysman/mmc_format_progress 0 -i
 vconftool set -t int memory/sysman/mmc_err_status 0 -i
-vconftool set -t int memory/sysman/power_off 0 -u 5000 -i -f
+vconftool set -t int memory/sysman/power_off 0 -g $users_gid -i -f
 vconftool set -t int memory/sysman/battery_level_status -1 -i
 vconftool set -t string memory/private/sysman/added_storage_uevent "" -i
-vconftool set -t string memory/private/sysman/removed_storage_uevent "" -u 5000 -i
+vconftool set -t string memory/private/sysman/removed_storage_uevent "" -g $users_gid -i
 
 vconftool set -t int memory/sysman/hdmi 0 -i
 
@@ -229,13 +233,13 @@ vconftool set -t int memory/sysman/stime_changed 0 -i
 #db type vconf key init
 vconftool set -t int db/sysman/mmc_dev_changed 0 -i
 
-vconftool set -t int memory/pm/state 0 -i -g 5000
+vconftool set -t int memory/pm/state 0 -i -g $users_gid
 vconftool set -t int memory/pm/battery_timetofull -1 -i
 vconftool set -t int memory/pm/battery_timetoempty -1 -i
-vconftool set -t int memory/pm/sip_status 0 -i -g 5000
-vconftool set -t int memory/pm/custom_brightness_status 0 -i -g 5000
+vconftool set -t int memory/pm/sip_status 0 -i -g $users_gid
+vconftool set -t int memory/pm/custom_brightness_status 0 -i -g $users_gid
 vconftool set -t bool memory/pm/brt_changed_lpm 0 -i
-vconftool set -t int memory/pm/current_brt 60 -i -g 5000
+vconftool set -t int memory/pm/current_brt 60 -i -g $users_gid
 
 heynotitool set system_wakeup
 heynotitool set pm_event
index e3af587..b4f4dfa 100755 (executable)
@@ -7,7 +7,10 @@ SET(EXEC_PREFIX "\${prefix}")
 SET(LIBDIR "\${prefix}/lib")
 SET(INCLUDEDIR "\${prefix}/include")
 SET(VERSION 0.1.9)
+
 INCLUDE(FindPkgConfig)
+pkg_check_modules(deep_pkgs REQUIRED libtzplatform-config)
+
 FOREACH(flag ${deep_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
index 319a2d8..1707324 100644 (file)
@@ -20,8 +20,9 @@
 #include <stdio.h>
 #include <string.h>
 #include <limits.h>
+#include <tzplatform_config.h>
 
-#define PM_EVENT_NOTI_PATH     "/opt/share/noti/pm_event"
+#define PM_EVENT_NOTI_PATH     tzplatform_mkpath(TZ_SYS_SHARE, "noti/pm_event")
 #define PM_EVENT_CMD_LENGTH            50
 
 int main(int argc, char *argv[])
index 4d8fcad..3c4f3c6 100755 (executable)
@@ -1,7 +1,8 @@
 #!/bin/bash
+source /etc/tizen-platform.conf
 MOUNT_DIRECTORY=$1
-find $MOUNT_DIRECTORY -type d | xargs chsmack -a 'system::ext_storage' -t
-find $MOUNT_DIRECTORY -type f | xargs chsmack -a 'system::ext_storage'
+find $MOUNT_DIRECTORY -type d | xargs chsmack -a 'System::Shared' -t
+find $MOUNT_DIRECTORY -type f | xargs chsmack -a 'System::Shared'
 find $MOUNT_DIRECTORY -type f | xargs chmod -x
-find $MOUNT_DIRECTORY | xargs chown app:app
+find $MOUNT_DIRECTORY | xargs chown $TZ_USER_NAME:$TZ_SYS_USER_GROUP
 find $MOUNT_DIRECTORY | xargs chmod 777
index 3eafbfa..d836862 100644 (file)
@@ -33,6 +33,7 @@
 #include "core/log.h"
 #include "core/launch.h"
 #include "core/devices.h"
+#include <tzplatform_config.h>
 
 #define CRASH_WORKER_MAX       3
 #define CRASH_PID_MAX 7
 #define CRASH_PROCESSNAME_MAX NAME_MAX
 #define CRASH_EXEPATH_MAX NAME_MAX
 #define CRASH_ARG_MAX (CRASH_PROCESSNAME_MAX + CRASH_EXEPATH_MAX + CRASH_TIME_MAX + CRASH_PID_MAX + CRASH_MODE_MAX + CRASH_VERIFY_MAX)
-#define CRASH_NOTI_DIR         "/opt/share/crash"
+#define CRASH_NOTI_DIR         tzplatform_mkpath(TZ_SYS_SHARE, "crash")
 #define CRASH_NOTI_FILE                "curbs.log"
-#define CRASH_NOTI_PATH CRASH_NOTI_DIR"/"CRASH_NOTI_FILE
-#define CRASH_COREDUMP_PATH            "/opt/usr/share/crash/core"
-#define CRASH_DUMP_PATH                "/opt/usr/share/crash/dump"
-#define CRASH_INFO_PATH                "/opt/share/crash/info"
+#define CRASH_NOTI_PATH tzplatform_mkpath(TZ_SYS_SHARE, "crash/"CRASH_NOTI_FILE)
+#define CRASH_COREDUMP_PATH            tzplatform_mkpath(TZ_USER_SHARE, "crash/core")
+#define CRASH_DUMP_PATH                tzplatform_mkpath(TZ_USER_SHARE, "crash/dump")
+#define CRASH_INFO_PATH                tzplatform_mkpath(TZ_SYS_SHARE, "crash/info")
 #define CRASH_WORKER_PATH      "/usr/bin/crash-worker"
-#define CRASH_POPUP_PATH       "/usr/apps/org.tizen.crash-popup/bin/crash-popup"
+#define CRASH_POPUP_PATH       tzplatform_mkpath(TZ_SYS_RO_APP, "org.tizen.crash-popup/bin/crash-popup")
 
 static int noti_fd;
 static int add_noti(void);
index c9b9c0b..f35e1a7 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <Ecore.h>
 #include <unistd.h>
+#include <tzplatform_config.h>
 
 enum {
        WIN_CREATE = 0,
@@ -101,7 +102,7 @@ enum {
 #define OOMADJ_APP_LIMIT               (-16)
 
 #define MOVINAND_MOUNT_POINT           "/opt/media"
-#define MMC_MOUNT_POINT                        "/opt/storage/sdcard"
+#define MMC_MOUNT_POINT                        tzplatform_mkpath(TZ_SYS_STORAGE,"sdcard")
 
 struct ui_contention_info {
 
index 8b7100d..fac7e8a 100644 (file)
 #include "core/devices.h"
 #include "core/device-notifier.h"
 #include "core/udev.h"
+#include <tzplatform_config.h>
 
 #define USB_CON_PIDFILE                        "/var/run/.system_server.pid"
 #define PM_STATE_LOG_FILE              "/var/log/pm_state.log"
 #define PM_WAKEUP_NOTI_NAME            "system_wakeup"
 #define PM_EVENT_NOTI_NAME             "pm_event"
-#define PM_EVENT_NOTI_PATH             "/opt/share/noti/"PM_EVENT_NOTI_NAME
+#define PM_EVENT_NOTI_PATH             tzplatform_mkpath(TZ_SYS_SHARE,"noti/"PM_EVENT_NOTI_NAME)
 
 /**
  * @addtogroup POWER_MANAGER
index dbbcb15..728dfc7 100644 (file)
@@ -37,6 +37,7 @@
 #include "core/common.h"
 #include "core/devices.h"
 #include "mmc-handler.h"
+#include <tzplatform_config.h>
 
 #define VCONFKEY_INTERNAL_PRIVATE_MMC_ID       "db/private/sysman/mmc_device_id"
 #define VCONFKEY_SYSMAN_MMC_INIT       -1
@@ -45,7 +46,7 @@
 #define PREDEF_UNMOUNT_MMC             "unmountmmc"
 #define PREDEF_FORMAT_MMC              "formatmmc"
 
-#define MMC_PARENT_PATH        "/opt/storage"
+#define MMC_PARENT_PATH        tzplatform_getenv(TZ_SYS_STORAGE)
 #define MMC_DEV                        "/dev/mmcblk"
 
 #define SMACKFS_MAGIC          0x43415d53
index 960df73..a9a9130 100644 (file)
 #include "core/device-handler.h"
 #include "core/common.h"
 #include "core/devices.h"
+#include <tzplatform_config.h>
 
 #define BUF_LEN             20
 
 #define SMACKFS_MOUNT_OPT              "smackfsroot=*,smackfsdef=*"
-#define MMC_MOUNT_POINT                "/opt/storage/sdcard"
+#define MMC_MOUNT_POINT                tzplatform_getenv(TZ_SYS_STORAGE)
 
 struct mmc_list {
 struct mmc_list *prev, *next;
index 76b5174..b6d0474 100644 (file)
@@ -18,6 +18,7 @@
 
 
 #include <stdio.h>
+#include <tzplatform_config.h>
 #include <stdbool.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -60,7 +61,7 @@
 #endif
 static const char default_rtc0[] = "/dev/rtc0";
 static const char default_rtc1[] = "/dev/rtc1";
-static const char default_localtime[] = "/opt/etc/localtime";
+static const char default_localtime[18];
 
 static const time_t default_time = 2147483645; // max(32bit) -3sec
 static Ecore_Fd_Handler *tfdh = NULL; // tfd change noti
@@ -84,6 +85,7 @@ int handle_timezone(char *str)
        struct stat sts;
        time_t now;
        struct tm *ts;
+       strcpy(default_localtime, tzplatform_mkpath(TZ_SYS_ETC, "localtime"));
        const char *sympath = default_localtime;
 
        if (str == NULL)
index afedccc..abf4d72 100755 (executable)
@@ -15,7 +15,7 @@ SET(VERSION "${VERSION_MAJOR}.2.0")
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED vconf dlog)
+pkg_check_modules(pkgs REQUIRED vconf dlog libtzplatform-config)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 3aa71e8..2c8c2d0 100755 (executable)
@@ -1,9 +1,9 @@
 #!/bin/sh
-
+source /etc/tizen-platform.conf
 # Don't regist processes on hibernation capturing sequence
-if [ -e /opt/etc/.hib_capturing ] ; then
+if [ -e $TZ_SYS_ETC/.hib_capturing ] ; then
        exit 0
-elif [ -e /opt/etc/.hib_capturing_firstboot ]; then
+elif [ -e $TZ_SYS_ETC/.hib_capturing_firstboot ]; then
        exit 0
 fi
 
diff --git a/utils/mmc-smack-label b/utils/mmc-smack-label
deleted file mode 100755 (executable)
index 4d8fcad..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-MOUNT_DIRECTORY=$1
-find $MOUNT_DIRECTORY -type d | xargs chsmack -a 'system::ext_storage' -t
-find $MOUNT_DIRECTORY -type f | xargs chsmack -a 'system::ext_storage'
-find $MOUNT_DIRECTORY -type f | xargs chmod -x
-find $MOUNT_DIRECTORY | xargs chown app:app
-find $MOUNT_DIRECTORY | xargs chmod 777
index a531c5b..1507f41 100755 (executable)
@@ -1,9 +1,9 @@
 #!/bin/sh
-
+source /etc/tizen-platform.conf
 # Don't regist processes on hibernation capturing sequence
-if [ -e /opt/etc/.hib_capturing ] ; then
+if [ -e $TZ_SYS_ETC/.hib_capturing ] ; then
        exit 0
-elif [ -e /opt/etc/.hib_capturing_firstboot ]; then
+elif [ -e $TZ_SYS_ETC/.hib_capturing_firstboot ]; then
        exit 0
 fi