From e11ee89aed7b5318fc593e32bce85ea1f84ff9f5 Mon Sep 17 00:00:00 2001 From: Bogon Kim Date: Wed, 23 Oct 2013 16:01:20 +0900 Subject: [PATCH 1/1] nativeinfologctrl - native platform info log on/off script Change-Id: Ic35376b51124bdcbdf0b616a9f284fc5ce485425 Signed-off-by: Bogon Kim --- CMakeLists.txt | 1 + osp-appfw.manifest | 1 + packaging/osp-appfw.spec | 1 + res/common/usr/bin/nativeinfologctrl | 57 ++++++++++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+) create mode 100755 res/common/usr/bin/nativeinfologctrl diff --git a/CMakeLists.txt b/CMakeLists.txt index f6f8a74..3ab8193 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,6 +62,7 @@ INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/debug WORLD_EXECUTE WORLD_READ) INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/common/opt/usr/etc DESTINATION ../opt/usr) +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/common/usr/bin DESTINATION ../usr) IF("${ARCH}" MATCHES "arm") INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/arm/usr/etc DESTINATION ../usr) ELSEIF("${ARCH}" MATCHES "x86") diff --git a/osp-appfw.manifest b/osp-appfw.manifest index ec50cdf..6659498 100644 --- a/osp-appfw.manifest +++ b/osp-appfw.manifest @@ -14,5 +14,6 @@ + diff --git a/packaging/osp-appfw.spec b/packaging/osp-appfw.spec index 519c8e6..3a6ee82 100644 --- a/packaging/osp-appfw.spec +++ b/packaging/osp-appfw.spec @@ -190,6 +190,7 @@ chmod 444 /opt/usr/etc/clocale.list %config /opt/usr/etc/* /usr/share/locale/* %config /usr/etc/* +%attr(755,root,app_logging) /usr/bin/nativeinfologctrl %{_libdir}/osp/libosp-appfw.so* %{_libdir}/osp-server/libosp-appfw-server.so* %{_libdir}/osp-server/libosp-system-server.so* diff --git a/res/common/usr/bin/nativeinfologctrl b/res/common/usr/bin/nativeinfologctrl new file mode 100755 index 0000000..13c5b15 --- /dev/null +++ b/res/common/usr/bin/nativeinfologctrl @@ -0,0 +1,57 @@ +#!/bin/sh +MODE=none +OBJ=none +VAL=none +#echo "tizen_platform_dlog_logging_ctrl" +case "$1" in +get) + MODE=get +;; +set) + MODE=set +;; + +*) +echo "Usage: dlogctrl {get|set} {platformlog} {1|0}" +exit 1 +esac + +case "$2" in +platformlog) + OBJ=platformlog +;; +*) + echo "Usage: dlogctrl {get|set} {platformlog} {1|0}" +exit 1 +esac + +if [ "$MODE" = "set" ]; then + case "$3" in + 1) + VAL=1 + ;; + 0) + VAL=0 + ;; + *) + echo "Usage: dlogctrl {get|set} {platformlog} {1|0}" + exit 1 + esac +fi + +if [ "$MODE" = "set" ]; then + if [ "$OBJ" = "platformlog" ] && [ "$VAL" = "1" ] ; then + echo 1 > /opt/etc/platformlog.conf 2>/dev/null + touch /home/developer/.platforminfologgingmode 2>/dev/null + elif [ "$OBJ" = "platformlog" ] && [ "$VAL" = "0" ] ; then + echo 0 > /opt/etc/platformlog.conf 2>/dev/null + rm /home/developer/.platforminfologgingmode 2>/dev/null + fi + echo "You must reboot this target to apply the change!" +else + if [ "$OBJ" = "platformlog" ]; then + cat /opt/etc/platformlog.conf 2>/dev/null + fi +fi + +exit 0 -- 2.7.4