%define exclude_list_file_name resourced_proc_exclude.ini
-%define exclude_list_full_path %{TZ_SYS_ETC}/%{exclude_list_file_name}
-%define exclude_list_opt_full_path %{TZ_SYS_ETC}/%{exclude_list_file_name}
+%define exclude_list_ro_path /etc/%{exclude_list_file_name}
+%define exclude_list_rw_path %{TZ_SYS_ETC}/%{exclude_list_file_name}
%define database_full_path %{TZ_SYS_GLOBALUSER_DB}/.resourced-datausage.db
%define logging_storage_db_full_path %{TZ_SYS_GLOBALUSER_DB}/.resourced-heart-storage.db
%define rd_config_path /etc/resourced
-%define upgrade_script_path /usr/share/upgrade/scripts
+%define upgrade_file_path %{TZ_SYS_RO_SHARE}/upgrade/
BuildRequires: cmake
BuildRequires: pkgconfig(glib-2.0)
-DARCH=%{ARCH} \
-DCMAKE_BUILD_TYPE=Release \
-DEXCLUDE_LIST_FILE_NAME=%{exclude_list_file_name} \
- -DEXCLUDE_LIST_FULL_PATH=%{exclude_list_full_path} \
+ -DEXCLUDE_LIST_RO_PATH=%{exclude_list_ro_path} \
+ -DEXCLUDE_LIST_RW_PATH=%{exclude_list_rw_path} \
-DDATABASE_FULL_PATH=%{database_full_path} \
- -DEXCLUDE_LIST_OPT_FULL_PATH=%{exclude_list_opt_full_path} \
-DBLOCK_MODULE=%{block_module} \
-DCPU_MODULE=%{cpu_module} \
-DFREEZER_MODULE=%{freezer_module} \
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/share/license
cp -f LICENSE %{buildroot}/usr/share/license/%{name}
-mkdir -p %{buildroot}%{upgrade_script_path}
-cp -f scripts/resourced_upgrade.sh %{buildroot}%{upgrade_script_path}
+install -D data/%{exclude_list_file_name} %{buildroot}%{upgrade_file_path}/data/%{exclude_list_file_name}
+install -D scripts/resourced_upgrade.sh %{buildroot}%{upgrade_file_path}/scripts/resourced_upgrade.sh
%make_install
%if %{?heart_module} == ON
#install init.d script
mkdir -p %{TZ_SYS_ETC}
#make empty dynamic exclude list for first installation
-touch %{exclude_list_opt_full_path}
+touch %{exclude_list_rw_path}
if [ "$1" = "2" ]; then # upgrade begins
systemctl start resourced.service
%if %{?block_module} == ON
%config %{rd_config_path}/block.conf
%endif
-%{exclude_list_full_path}
+%{exclude_list_ro_path}
%if %{?heart_module} == ON
%config %{rd_config_path}/heart.conf
%attr(700, root, root) %{TZ_SYS_ETC}/dump.d/module.d/dump_heart_data.sh
%{_unitdir}/mem-stress.service
%{_unitdir}/graphical.target.wants/mem-stress.service
%endif
-%{upgrade_script_path}/resourced_upgrade.sh
+#For upgrade
+%{upgrade_file_path}/scripts/resourced_upgrade.sh
+%{upgrade_file_path}/data/%{exclude_list_file_name}
#!/bin/sh
-#------------------------------------------#
-# Resourced patch for upgrade (2.4 -> 3.0) #
-#------------------------------------------#
+#---------------------------------------#
+# Resourced upgrade script (2.4 -> 3.0) #
+#---------------------------------------#
# Macro
+source /etc/tizen-platform.conf
+
DB_DIR_24=/opt/usr/dbspace
-DB_DIR_30=/opt/usr/home/owner/.applications/dbspace
+DB_DIR_30=$TZ_SYS_HOME/owner/.applications/dbspace
DB_APPOPT_24=$DB_DIR_24/.resourced-appopt.db
DB_APPOPT_30=$DB_DIR_30/.resourced-heart-appopt.db
DB_DEFAULT_30_USR=$DB_DIR_30/.resourced-heart-default.db
DAT_DIR_24=/opt/usr/data/heart
-DAT_DIR_30=/opt/usr/home/owner/data/heart
+DAT_DIR_30=$TZ_SYS_HOME/owner/data/heart
-# Move DB
+# Move HEART DB
mv $DB_APPOPT_24 $DB_APPOPT_30
mv $DB_APPOPT_24-journal $DB_APPOPT_30-journal
mv $DB_STORAGE_24 $DB_STORAGE_30
chsmack -a User::Home $DB_STORAGE_30-shm
chsmack -a User::Home $DB_STORAGE_30-wal
-# Rename DB
+# Rename HEART DB
mv $DB_DEFAULT_24 $DB_DEFAULT_30_SYS
mv $DB_DEFAULT_24-journal $DB_DEFAULT_30_SYS-journal
mv $DB_DIR_24/.resourced-logging-leveldb $DB_DIR_24/.resourced-heart-leveldb
-# Divide DB
+# Divide HEART DB
cp $DB_DEFAULT_30_SYS $DB_DEFAULT_30_USR
cp $DB_DEFAULT_30_SYS-journal $DB_DEFAULT_30_USR-journal
DROP TABLE battery;
EOS
-# Move dat file
+# Move HEART dat file
mkdir -p $DAT_DIR_30
mv $DAT_DIR_24/.cpu.dat $DAT_DIR_30
+
+# Alter RO exclude list
+rm /usr/etc/resourced_proc_exclude.ini
+cp /usr/share/upgrade/data/resourced_proc_exclude.ini /etc/
+
+# Move RW exclude list
+mv /opt/usr/etc/resourced_proc_exclude.ini $TZ_SYS_ETC
+
+# Remove Deprecated directory
+rm -r /opt/usr/share/sluggish
ADD_DEFINITIONS("-DPROC_DEBUG")
ENDIF()
-INSTALL(FILES ${DATA_DIR}/${EXCLUDE_LIST_FILE_NAME} DESTINATION ${RD_SYS_ETC})
+INSTALL(FILES ${DATA_DIR}/${EXCLUDE_LIST_FILE_NAME} DESTINATION /etc)
#freezer module
IF("${FREEZER_MODULE}" STREQUAL "ON")
#ifndef _CONFIG_H_GENERATED
#define _CONFIG_H_GENERATED
-#cmakedefine EXCLUDE_LIST_FULL_PATH "@EXCLUDE_LIST_FULL_PATH@"
-#cmakedefine EXCLUDE_LIST_OPT_FULL_PATH "@EXCLUDE_LIST_OPT_FULL_PATH@"
+#cmakedefine EXCLUDE_LIST_RO_PATH "@EXCLUDE_LIST_RO_PATH@"
+#cmakedefine EXCLUDE_LIST_RW_PATH "@EXCLUDE_LIST_RW_PATH@"
/* It's command line arguments*/
#cmakedefine DATABASE_FULL_PATH "@DATABASE_FULL_PATH@"
static void _fill_exclude_list(GHashTable *list)
{
- fill_exclude_list_by_path(EXCLUDE_LIST_FULL_PATH, list);
- fill_exclude_list_by_path(EXCLUDE_LIST_OPT_FULL_PATH, list);
+ fill_exclude_list_by_path(EXCLUDE_LIST_RO_PATH, list);
+ fill_exclude_list_by_path(EXCLUDE_LIST_RW_PATH, list);
}
static void _exclude_list_change_cb(void *data, Ecore_File_Monitor *em,
Ecore_File_Event event, const char *path)
{
- _SD("file %s changed, path: %s, event: %d ", EXCLUDE_LIST_OPT_FULL_PATH,
+ _SD("file %s changed, path: %s, event: %d ", EXCLUDE_LIST_RW_PATH,
path, event);
g_hash_table_remove_all(proc_exclude_list);
_E("ecore_file_init() failed");
return;
}
- exclude_list_monitor = ecore_file_monitor_add(EXCLUDE_LIST_OPT_FULL_PATH,
+ exclude_list_monitor = ecore_file_monitor_add(EXCLUDE_LIST_RW_PATH,
_exclude_list_change_cb,
NULL);
if (exclude_list_monitor == NULL)