%define exclude_list_file_name resourced_proc_exclude.ini
%define exclude_list_full_path /usr/etc/%{exclude_list_file_name}
-%define exclude_list_opt_full_path /opt/usr/etc/%{exclude_list_file_name}
-%define database_full_path /opt/usr/dbspace/.resourced-datausage.db
+%define exclude_list_opt_full_path %{TZ_SYS_ETC}/%{exclude_list_file_name}
+%define database_full_path %{TZ_SYS_DB}/.resourced-datausage.db
-%define logging_db_full_path /opt/usr/dbspace/.resourced-logging.db
-%define logging_storage_db_full_path /opt/usr/dbspace/.resourced-logging-storage.db
+%define logging_db_full_path %{TZ_SYS_DB}/.resourced-logging.db
+%define logging_storage_db_full_path %{TZ_SYS_DB}/.resourced-logging-storage.db
BuildRequires: cmake
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(leveldb)
BuildRequires: pkgconfig(eventsystem)
BuildRequires: pkgconfig(capi-system-info)
+BuildRequires: pkgconfig(libtzplatform-config)
#only for data types
BuildRequires: pkgconfig(tapi)
-DBLOCK_MODULE=%{block_module} \
-DTESTS_MODULE=%{tests_module} \
-DMEM_STRESS=%{mem_stress} \
- -DDEBUG_LOG=%{debug_log}
+ -DDEBUG_LOG=%{debug_log} \
+ -DRD_SYS_ETC=%{TZ_SYS_ETC} \
+ -DRD_SYS_STORAGE=%{TZ_SYS_STORAGE} \
+ -DRD_SYS_DATA=%{TZ_SYS_DATA} \
+ -DRD_SYS_DB=%{TZ_SYS_DB} \
+ -DRD_SYS_SHARE=%{TZ_SYS_SHARE} \
+ -DRD_SYS_VAR=%{TZ_SYS_VAR} \
+ -DRD_USER_CONTENT=%{TZ_USER_CONTENT}
make %{?jobs:-j%jobs}
%make_install
%if %{?heart_module} == ON
- mkdir -p %{buildroot}/opt/usr/data/heart
- mkdir -p %{buildroot}/opt/usr/dbspace
+ mkdir -p %{buildroot}%{TZ_SYS_DATA}/heart
+ mkdir -p %{buildroot}/%{TZ_SYS_DB}
sqlite3 %{buildroot}%{logging_db_full_path}
sqlite3 --line %{buildroot}%{logging_storage_db_full_path} 'PRAGMA journal_mode = WAL'
touch %{buildroot}%{logging_storage_db_full_path}-shm
%endif
%if %{?network_state} == ON
- mkdir -p %{buildroot}/opt/usr/dbspace
+ mkdir -p %{buildroot}/%{TZ_SYS_DB}
sqlite3 %{buildroot}%{database_full_path} < %{buildroot}/usr/share/traffic_db.sql
rm %{buildroot}/usr/share/traffic_db.sql
sqlite3 %{buildroot}%{database_full_path} < %{buildroot}/usr/share/exception_db.sql
ln -sf %{_unitdir}/resourced.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
#install init.d script
-mkdir -p /opt/usr/etc
+mkdir -p %{TZ_SYS_ETC}
#make empty dynamic exclude list for first installation
touch %{exclude_list_opt_full_path}
%config(noreplace) %attr(660,root,app) %{database_full_path}-journal
/usr/bin/datausagetool
%config /etc/resourced/network.conf
- /etc/opt/upgrade/500.resourced-datausage.patch.sh
- %attr(700,root,root) /etc/opt/upgrade/500.resourced-datausage.patch.sh
+ %{TZ_SYS_ETC}/upgrade/500.resourced-datausage.patch.sh
+ %attr(700,root,root) %{TZ_SYS_ETC}/upgrade/500.resourced-datausage.patch.sh
%{_bindir}/net-cls-release
%endif
%config %{_sysconfdir}/dbus-1/system.d/resourced.conf
%{exclude_list_full_path}
%if %{?heart_module} == ON
%config /etc/resourced/heart.conf
- %attr(700, root, root) /opt/etc/dump.d/module.d/dump_heart_data.sh
+ %attr(700, root, root) %{TZ_SYS_ETC}/dump.d/module.d/dump_heart_data.sh
%attr(700, app, app) %{logging_storage_db_full_path}
%attr(700, app, app) %{logging_storage_db_full_path}-shm
%attr(700, app, app) %{logging_storage_db_full_path}-wal
# libresourced uses it
PROJECT(resource_d)
+ADD_DEFINITIONS("-DRD_SYS_ETC=\"${RD_SYS_ETC}\"")
+ADD_DEFINITIONS("-DRD_SYS_STORAGE=\"${RD_SYS_STORAGE}\"")
+ADD_DEFINITIONS("-DRD_SYS_DATA=\"${RD_SYS_DATA}\"")
+ADD_DEFINITIONS("-DRD_SYS_DB=\"${RD_SYS_DB}\"")
+ADD_DEFINITIONS("-DRD_SYS_SHARE=\"${RD_SYS_SHARE}\"")
+ADD_DEFINITIONS("-DRD_SYS_VAR=\"${RD_SYS_VAR}\"")
+
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/InstallSymlink.cmake)
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/ProcessGPERF.cmake)
${NETWORK_SOURCE_DIR}/db-guard.c
)
+ CONFIGURE_FILE(${NETWORK_SOURCE_DIR}/500.resourced-datausage.patch.sh.in
+ ${NETWORK_SOURCE_DIR}/500.resourced-datausage.patch.sh
+ @ONLY)
+
INSTALL(FILES ${NETWORK_SOURCE_DIR}/network.conf
DESTINATION /etc/resourced)
INSTALL(FILES ${NETWORK_SOURCE_DIR}/500.resourced-datausage.patch.sh
- DESTINATION /etc/opt/upgrade)
+ DESTINATION ${RD_SYS_ETC}/upgrade)
SET(REQUIRES_LIST ${REQUIRES_LIST}
openssl
IF("${HEART_MODULE}" STREQUAL "ON")
INSTALL(FILES ${HEART_SOURCE_DIR}/heart.conf
DESTINATION /etc/resourced RENAME heart.conf)
+ CONFIGURE_FILE(${HEART_SOURCE_DIR}/dump_heart_data.sh.in
+ ${HEART_SOURCE_DIR}/dump_heart_data.sh
+ @ONLY)
INSTALL(FILES ${HEART_SOURCE_DIR}/dump_heart_data.sh
- DESTINATION /opt/etc/dump.d/module.d)
+ DESTINATION ${RD_SYS_ETC}/dump.d/module.d)
ENDIF()
IF("${CPU_MODULE}" STREQUAL "ON")
ENDIF()
IF("${BLOCK_MODULE}" STREQUAL "ON")
- INSTALL(FILES ${BLOCK_SOURCE_DIR}/block.conf
- DESTINATION /etc/resourced RENAME block.conf)
+ INSTALL(FILES ${BLOCK_SOURCE_DIR}/block.conf
+ DESTINATION /etc/resourced RENAME block.conf)
ENDIF()
IF("${FREEZER_MODULE}" STREQUAL "ON")
#define PATH_MAX 256
#define INTERNAL_MEMORY_PATH "/opt/usr"
-#define EXTERNAL_MEMORY_PATH "/opt/storage/sdcard"
+#define EXTERNAL_MEMORY_PATH RD_SYS_STORAGE"/sdcard"
bool is_mounted(const char* path)
{
+++ /dev/null
-HEART_DEBUG=$1/heart
-/bin/mkdir -p ${HEART_DEBUG}
-/bin/cp -rf /opt/usr/dbspace/.resourced-logging-leveldb/ ${HEART_DEBUG}
-/bin/cp -rf /opt/usr/dbspace/.resourced-logging.db ${HEART_DEBUG}
-/bin/cp -rf /opt/usr/data/heart/ ${HEART_DEBUG}
--- /dev/null
+HEART_DEBUG=$1/heart
+/bin/mkdir -p ${HEART_DEBUG}
+/bin/cp -rf @RD_SYS_DB@/.resourced-logging-leveldb/ ${HEART_DEBUG}
+/bin/cp -rf @RD_SYS_DB@/.resourced-logging.db ${HEART_DEBUG}
+/bin/cp -rf @RD_SYS_DATA@/heart/ ${HEART_DEBUG}
#include "proc-common.h"
#include "edbus-handler.h"
-#define APPOPT_DB_FILE_NAME "/opt/usr/dbspace/.resourced-appopt.db"
+#define APPOPT_DB_FILE_NAME RD_SYS_DB"/.resourced-appopt.db"
#define APP_NAMES_TABLE "appnames"
#define APP_OPTS_TABLE "appopts"
#define QUERY_CREATE_APPNAMES "CREATE TABLE IF NOT EXISTS "APP_NAMES_TABLE" (appkey INTEGER PRIMARY KEY AUTOINCREMENT, appname TEXT NOT NULL UNIQUE);"
#include <sqlite3.h>
-#define HEART_STORAGE_DB "/opt/usr/dbspace/.resourced-logging-storage.db"
+#define HEART_STORAGE_DB RD_SYS_DB"/.resourced-logging-storage.db"
#define STORAGE_NAME "storage"
static bool heart_storage_initailized = false;
#include <time.h>
#define HEART_CONF_FILE_PATH "/etc/resourced/heart.conf"
-#define HEART_FILE_PATH "/opt/usr/data/heart"
+#define HEART_FILE_PATH RD_SYS_DATA"/heart"
#define HEART_CONF_SECTION "HEART"
struct heart_module_ops {
#define STRINGFY(x) #x
#define KEY_TO_STRING(x) STRINGFY(x)
-#define LOGGING_DB_FILE_NAME "/opt/usr/dbspace/.resourced-logging.db"
-#define LOGGING_LEVEL_DB_FILE_NAME "/opt/usr/dbspace/.resourced-logging-leveldb"
+#define LOGGING_DB_FILE_NAME RD_SYS_DB"/.resourced-logging.db"
+#define LOGGING_LEVEL_DB_FILE_NAME RD_SYS_DB"/.resourced-logging-leveldb"
#define HOUR_TO_SEC(x) (x*3600)
#define DAY_TO_SEC(x) (x*HOUR_TO_SEC(24))
#define MONTH_TO_SEC(x) (x*DAY_TO_SEC(30))
-network_db_version="`sqlite3 /opt/usr/dbspace/.resourced-datausage.db "PRAGMA user_version;"`"
+network_db_version="`sqlite3 "@RD_SYS_DB@"/.resourced-datausage.db "PRAGMA user_version;"`"
if [ 0"$network_db_version" -eq 1 ]
then
exit 1
fi
-sqlite3 /opt/usr/dbspace/.resourced-datausage.db "
+sqlite3 @RD_SYS_DB@/.resourced-datausage.db "
PRAGMA journal_mode=PERSIST;
DROP TABLE IF EXISTS fota;
ALTER TABLE statistics RENAME to fota;
hw_net_protocol_type, ifname, reserved, imsi from fota;
DROP TABLE IF EXISTS fota;
"
-sqlite3 /opt/usr/dbspace/.resourced-datausage.db "
+sqlite3 @RD_SYS_DB@/.resourced-datausage.db "
PRAGMA journal_mode=PERSIST;
DROP TABLE IF EXISTS fota;
ALTER TABLE quotas RENAME to fota;
DROP TABLE IF EXISTS fota;
"
-sqlite3 /opt/usr/dbspace/.resourced-datausage.db "
+sqlite3 @RD_SYS_DB@/.resourced-datausage.db "
PRAGMA journal_mode=PERSIST;
DROP TABLE IF EXISTS fota;
ALTER TABLE restrictions RENAME to fota;
static const struct module_ops *freezer;
static GSList *proc_module; /* proc sub-module list */
-#define BASE_UGPATH_PREFIX "/usr/ug/bin"
#define LOG_PREFIX "resourced"
#define TIZEN_SYSTEM_APPID "org.tizen.system"
#define WATCHDOG_KEY2 "_APP_NAME_"
#define WATCHDOG_VALUE_1 "watchdog"
-#define TIZEN_DEBUG_MODE_FILE "/opt/etc/.debugmode"
+#define TIZEN_DEBUG_MODE_FILE RD_SYS_ETC"/.debugmode"
#define INIT_PID 1
#define INIT_PROC_VAL -1
#include "file-helper.h"
#include "util.h"
-#define SLUGGISH_PATH "/opt/usr/share/sluggish" /* Path to dump system snapshot */
-#define PATH_DLOG "/opt/var/log/dlog_main" /* Platform log file */
-#define PATH_DLOG1 "/opt/var/log/dlog_main.1" /* Platform log file */
+#define SLUGGISH_PATH RD_SYS_SHARE"/sluggish" /* Path to dump system snapshot */
+#define PATH_DLOG RD_SYS_VAR"/log/dlog_main" /* Platform log file */
+#define PATH_DLOG1 RD_SYS_VAR"/log/dlog_main.1" /* Platform log file */
#define MAX_TIMESTAMP_LEN 30
#define MAX_FILENAME_LEN 256
#define MAX_BUF_LEN 1024
#include "trace.h"
#include "vip-process.h"
-#define TIZEN_DEBUG_MODE_FILE "/opt/etc/.debugmode"
+#define TIZEN_DEBUG_MODE_FILE RD_SYS_ETC"/.debugmode"
#define DUMP_PATH "/usr/bin/all_log_dump.sh"
#define REBOOT_PATH "/usr/sbin/reboot"
#define WAIT_TIMEOUT 10