summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarol Lewandowski <karol.k.lewandowski@gmail.com>2019-08-13 22:50:58 (GMT)
committerKarol Lewandowski <karol.k.lewandowski@gmail.com>2019-08-13 22:50:58 (GMT)
commit483e5b31bcf65008a5abbc031fa5cbf579fe97b9 (patch)
treeefa615fa2da86baab277a80fb9cd19d25cb55160
parent6e7cfdcd678faae94b8c7b86963ad0a9b22bc0c7 (diff)
downloadcrash-worker-klewandowski/sandbox/wip-cleanup-upgrade.zip
crash-worker-klewandowski/sandbox/wip-cleanup-upgrade.tar.gz
crash-worker-klewandowski/sandbox/wip-cleanup-upgrade.tar.bz2
-rw-r--r--include/defs.h.in3
-rw-r--r--packaging/crash-worker.spec20
-rw-r--r--src/crash-manager/500.crash-manager-upgrade.sh.in20
-rw-r--r--src/log_dump/log_dump.c5
4 files changed, 15 insertions, 33 deletions
diff --git a/include/defs.h.in b/include/defs.h.in
index a333ff7..766af5b 100644
--- a/include/defs.h.in
+++ b/include/defs.h.in
@@ -3,14 +3,13 @@
#define KERNEL_DEFINED_TASK_COMM_LEN 16 // from include/linux/sched.h
-#define CRASH_PATH "@CRASH_PATH@"
#define CRASH_ROOT_PATH "@CRASH_ROOT_PATH@"
-#define CRASH_TEMP "@CRASH_TEMP@"
#define SYS_ASSERT "@SYS_ASSERT@"
#define CRASH_STACK_BIN_PATH "@CRASH_STACK_BIN_PATH@"
#define CRASH_POPUP_BIN_PATH "@CRASH_POPUP_BIN_PATH@"
#define CRASH_NOTIFY_BIN_PATH "@CRASH_NOTIFY_BIN_PATH@"
#define LOG_DUMP_BIN_PATH "@LOG_DUMP_BIN_PATH@"
+#define LOG_DUMP_SCRIPTS_PATH "@LOG_DUMP_SCRIPTS_PATH@"
#define DUMP_SYSTEMSTATE_BIN_PATH "@DUMP_SYSTEMSTATE_BIN_PATH@"
#define DUMP_SYSTEMSTATE_CONFIG_DIR_PATH "@DUMP_SYSTEMSTATE_CONFIG_DIR_PATH@"
#define CRASH_MANAGER_CONFIG_PATH "@CRASH_MANAGER_CONFIG_PATH@"
diff --git a/packaging/crash-worker.spec b/packaging/crash-worker.spec
index ecbd3de..292fd74 100644
--- a/packaging/crash-worker.spec
+++ b/packaging/crash-worker.spec
@@ -83,15 +83,12 @@ Summary: Livedumper allows to dump core of live process
#Path to store logs and coredump files
%define crash_root_path %{TZ_SYS_CRASH_ROOT}
-%define crash_path %{TZ_SYS_CRASH}
-%define crash_temp %{crash_root_path}/temp
#Debug mode path - existence of file at path below mean that core file should be generated
%define debugmode_path %{TZ_SYS_ETC}/.debugmode
#Path for log_dump module
%define crash_all_log %{TZ_SYS_ALLLOGS}
-%define crash_dump_gen %{TZ_SYS_DUMPGEN}
%define upgrade_script_path %{TZ_SYS_RO_SHARE}/upgrade/scripts
@@ -120,13 +117,12 @@ export CFLAGS+=" -Werror"
-DDUMP_SYSTEMSTATE_CONFIG_DIR_PATH=%{_sysconfdir}/dump_systemstate.conf.d \
-DCRASH_MANAGER_CONFIG_PATH=%{_sysconfdir}/crash-manager.conf \
-DCRASH_ROOT_PATH=%{crash_root_path} \
- -DCRASH_PATH=%{crash_path} \
- -DCRASH_TEMP=%{crash_temp} \
-DDEBUGMODE_PATH=%{debugmode_path} \
-DMINICOREDUMPER_BIN_PATH=%{_sbindir}/minicoredumper \
-DMINICOREDUMPER_CONFIG_PATH=%{_sysconfdir}/minicoredumper/minicoredumper.cfg.json \
-DLIVEDUMPER_BIN_PATH=%{_bindir}/livedumper \
-DLOG_DUMP_BIN_PATH=%{_bindir}/log_dump \
+ -DLOG_DUMP_SCRIPTS_PATH=%{_sysconfdir}/dump.d \
-DDUMP_SYSTEMSTATE_BIN_PATH=%{_bindir}/dump_systemstate \
-DCRASH_STACK_BIN_PATH=%{_libexecdir}/crash-stack \
-DCRASH_POPUP_BIN_PATH=%{_libexecdir}/crash-popup-launch \
@@ -146,16 +142,13 @@ make doc
%install
rm -rf %{buildroot}
%make_install
-mkdir -p %{buildroot}%{crash_root_path}
-mkdir -p %{buildroot}%{crash_path}
-mkdir -p %{buildroot}%{crash_temp}
+mkdir -p %{buildroot}%{crash_root_path}/{dump,livedump,temp,log}
# log_dump dir
%if %{with logdump}
mkdir -p %{buildroot}%{crash_all_log}
-mkdir -p %{buildroot}%{crash_dump_gen}
-cp dump_scripts/* %{buildroot}%{crash_dump_gen}
-chmod 755 %{buildroot}%{crash_dump_gen}/*
+mkdir -p %{buildroot}%{_sysconfdir}/dump.d
+install -m755 dump_scripts/* %{buildroot}%{_sysconfdir}/dump.d
%endif
%post
@@ -210,7 +203,10 @@ sed -i "/${pattern}/D" %{_sysconfdir}/ld.so.preload
%if %{with logdump}
%dir %{crash_all_log}
-%{crash_dump_gen}/*
+%{_sysconfdir}/dump.d/module_log.sh
+%{_sysconfdir}/dump.d/move_dump.sh
+%{_sysconfdir}/dump.d/system_log.sh
+%{_sysconfdir}/dump.d/zz_legacy.sh
%attr(-,root,root) %{_unitdir}/log_dump.service
%attr(-,root,root) %{_sysconfdir}/dbus-1/system.d/log_dump.conf
%attr(-,root,root) %{_datadir}/dbus-1/system-services/org.tizen.system.crash.service
diff --git a/src/crash-manager/500.crash-manager-upgrade.sh.in b/src/crash-manager/500.crash-manager-upgrade.sh.in
index 63b2d3f..ca33bea 100644
--- a/src/crash-manager/500.crash-manager-upgrade.sh.in
+++ b/src/crash-manager/500.crash-manager-upgrade.sh.in
@@ -1,21 +1,9 @@
#!/bin/sh
-#----------------------------------------------#
-# crash-manager patch for upgrade (2.4 -> 3.0) #
-#----------------------------------------------#
-
PATH=/bin:/usr/bin:/sbin:/usr/sbin
-rm -rf /opt/usr/share/crash # Crash path of Tizen 2.4
-
-mkdir -p @CRASH_ROOT_PATH@
-mkdir -p @CRASH_TEMP@
-mkdir -p @CRASH_PATH@
-
-find @CRASH_ROOT_PATH@ -type d | xargs chsmack -a "System::Shared" -t
-find @CRASH_ROOT_PATH@ -type d | xargs chmod 775
-find @CRASH_ROOT_PATH@ -type d | xargs chown system:system
+rm -rf /opt/usr/share/crash
-find @CRASH_PATH@ -type d | xargs chsmack -a "System::Shared" -t
-find @CRASH_PATH@ -type d | xargs chmod 775
-find @CRASH_PATH@ -type d | xargs chown system:system
+mkdir -p @CRASH_ROOT_PATH@/{dump,livedump,temp,log}
+chmod 755 @CRASH_ROOT_PATH@/{dump,livedump,temp,log}
+chsmack -a System @CRASH_ROOT_PATH@/{dump,livedump,temp,log}
diff --git a/src/log_dump/log_dump.c b/src/log_dump/log_dump.c
index 994ed59..35c5766 100644
--- a/src/log_dump/log_dump.c
+++ b/src/log_dump/log_dump.c
@@ -51,7 +51,7 @@ static const struct option opts[] = {
/* crash worker configuration - for admin-selectable CrashRootPath */
config_t config;
/* tzplaform vars */
-char *dir_scripts;
+const char *const dir_scripts = LOG_DUMP_SCRIPS_PATH;
/* dynamic vars */
char *dir_dump;
char *dir_log;
@@ -110,8 +110,6 @@ static bool init_vars(const char *crash_root)
_D("config: dir_debug is %s", dir_debug);
_D("config: dir_temp is %s", dir_temp);
_D("config: dir_temp_logdump is %s", dir_temp_logdump);
-
- dir_scripts = strdup(tzplatform_getenv(TZ_SYS_DUMPGEN));
_D("config: dir_scripts is %s", dir_scripts);
if (system_info_get_platform_string(SYSTEM_INFO_KEY_BUILD_STRING, &version_string) != SYSTEM_INFO_ERROR_NONE) {
@@ -132,6 +130,7 @@ static bool init_vars(const char *crash_root)
assert(dir_debug);
assert(dir_temp);
assert(dir_temp_logdump);
+ assert(dir_scripts);
return true;
fail: