PM state dump: change target directory 03/96203/2
authorSunmin Lee <sunm.lee@samsung.com>
Tue, 8 Nov 2016 06:23:42 +0000 (15:23 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Tue, 8 Nov 2016 09:22:16 +0000 (18:22 +0900)
Change target directory of pm_state.log.
In addition, the script that dumps pm state is installed to
dump script directory (TZ_SYS_DUMPGEN).

Change-Id: I65a7647a738354b6a062fff502af4cebd0f25f2b

packaging/deviced.spec
scripts/dump_pmstate_log.sh [new file with mode: 0755]
src/display/core.c

index 159f606..eea0d6e 100644 (file)
@@ -229,6 +229,9 @@ mkdir -p %{buildroot}%{_prefix}/lib/udev/rules.d
 install -m 644 udev/99-usbhost.rules %{buildroot}%{_prefix}/lib/udev/rules.d/99-usbhost.rules
 %endif
 
+mkdir -p %{buildroot}%{TZ_SYS_DUMPGEN}
+install -m 775 scripts/dump_pmstate_log.sh %{buildroot}%{TZ_SYS_DUMPGEN}/dump_pmstate_log.sh
+
 %post
 #memory type vconf key init
 users_gid=$(getent group %{TZ_SYS_USER_GROUP} | cut -f3 -d':')
@@ -309,6 +312,7 @@ systemctl daemon-reload
 %{_bindir}/devicectl
 %if %{?usb_module} == on
 %{_bindir}/direct_set_debug.sh
+%{TZ_SYS_DUMPGEN}/dump_pmstate_log.sh
 %endif
 
 %files -n libdeviced
diff --git a/scripts/dump_pmstate_log.sh b/scripts/dump_pmstate_log.sh
new file mode 100755 (executable)
index 0000000..a9b8346
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# Dump PM state log
+#
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+/usr/bin/devicectl display savelog
index 0aa2bd2..527356d 100644 (file)
@@ -37,6 +37,7 @@
 #include <fcntl.h>
 #include <vconf-keys.h>
 #include <Ecore.h>
+#include <tzplatform_config.h>
 
 #include "util.h"
 #include "core.h"
@@ -55,8 +56,8 @@
 #include "power/power-handler.h"
 #include "dd-display.h"
 
-#define PM_STATE_LOG_FILE              "/var/log/pm_state.log"
-#define DISPLAY_CONF_FILE              "/etc/deviced/display.conf"
+#define PM_STATE_LOG_FILE    tzplatform_mkpath2(TZ_SYS_ALLLOGS, "pm_state.log")
+#define DISPLAY_CONF_FILE    "/etc/deviced/display.conf"
 
 /**
  * @addtogroup POWER_MANAGER