From: jk7744.park Date: Sat, 24 Oct 2015 06:29:12 +0000 (+0900) Subject: tizen 2.4 release X-Git-Tag: accepted/tizen/2.4/mobile/20151029.042204^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_2.4;p=adaptation%2Fbluetooth-tools.git tizen 2.4 release --- diff --git a/packaging/bluetooth-tools.spec b/packaging/bluetooth-tools.spec index 7a4bfe8..11b2303 100644 --- a/packaging/bluetooth-tools.spec +++ b/packaging/bluetooth-tools.spec @@ -24,9 +24,11 @@ export CFLAGS="$CFLAGS -DTIZEN_WEARABLE" %cmake \ %if "%{?tizen_profile_name}" == "wearable" -DTIZEN_WEARABLE=YES \ -%elseif "%{?tizen_profile_name}" == "mobile" +%else +%if "%{?tizen_profile_name}" == "mobile" || "%{?tizen_profile_name}" == "tv" -DTIZEN_WEARABLE=NO \ %endif +%endif cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} make %{?jobs:-j%jobs} @@ -51,4 +53,5 @@ install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-tools %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-mode-on.sh %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-off.sh %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-hci-logdump.sh +%attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-run-hcidump.sh %{_datadir}/license/bluetooth-tools diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 1e81a47..dfa072d 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -16,3 +16,4 @@ INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-edutm-dev-up.sh DESTINATION etc/ INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-edutm-mode-on.sh DESTINATION etc/bluetooth) INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-edutm-off.sh DESTINATION etc/bluetooth) INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-hci-logdump.sh DESTINATION etc/bluetooth) +INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-run-hcidump.sh DESTINATION etc/bluetooth) diff --git a/scripts/bt-edutm-on.sh b/scripts/bt-edutm-on.sh index 2d88453..799d4d0 100755 --- a/scripts/bt-edutm-on.sh +++ b/scripts/bt-edutm-on.sh @@ -5,7 +5,7 @@ # HCIDUMP_ENABLE="true" # Available values : true | false (default : false) -HCIDUMP_DIR="/opt/usr/media/.bluetooth" +HCIDUMP_DIR="/opt/usr/media/.bt_dump" HCIDUMP_FILENAME="bt_hcidump.log" HCIDUMP_PATH="${HCIDUMP_DIR}/${HCIDUMP_FILENAME}" LOGDUMP_DIR="/opt/etc/dump.d/module.d" diff --git a/scripts/bt-hci-logdump.sh b/scripts/bt-hci-logdump.sh index 88e3deb..0b703b5 100755 --- a/scripts/bt-hci-logdump.sh +++ b/scripts/bt-hci-logdump.sh @@ -6,14 +6,14 @@ BLUETOOTH_DEBUG=${1}/bluetooth PREV_PWD=${PWD} -BT_DUMP_DIR=/opt/usr/media/.bluetooth +BT_DUMP_DIR=/opt/usr/media/Others/.bt_dump if [ ! -e ${BT_DUMP_DIR} ] then exit 0 fi -mkdir -p ${BLUETOOTH_DEBUG} +/bin/mkdir -p ${BLUETOOTH_DEBUG} cd ${BT_DUMP_DIR} /bin/tar -cvzf ${BLUETOOTH_DEBUG}/bt_dump.tar.gz * diff --git a/scripts/bt-run-hcidump.sh b/scripts/bt-run-hcidump.sh new file mode 100755 index 0000000..276483c --- /dev/null +++ b/scripts/bt-run-hcidump.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +HCIDUMP_BASEDIR="/opt/usr/media/Others" +HCIDUMP_DIR="${HCIDUMP_BASEDIR}/.bt_dump" +HCIDUMP_FILENAME="bt_hcidump.log" +HCIDUMP_PATH="${HCIDUMP_DIR}/${HCIDUMP_FILENAME}" + +LOGDUMP_DIR="/opt/etc/dump.d/module.d" +LOGDUMP_PATH="${LOGDUMP_DIR}/bt-hci-logdump.sh" + +debug_mode=`/bin/cat /sys/module/sec_debug/parameters/enable` +debug_mode_user=`/bin/cat /sys/module/sec_debug/parameters/enable_user` + +if [ ${debug_mode} = '1' -o ${debug_mode_user} = '1' ] +then + if [ -e /usr/sbin/hcidump ] + then + # When *#9900# is typed, this is executed to archive logs. + /bin/mkdir -p ${LOGDUMP_DIR} + /bin/cp -f /usr/etc/bluetooth/bt-hci-logdump.sh ${LOGDUMP_PATH} + + # Create base directory as proper owner and smack rule + # if it doesn't exist + if [ ! -e ${HCIDUMP_BASEDIR} ] + then + /bin/mkdir - p ${HCIDUMP_BASEDIR} + /bin/chown 5000:5000 ${HCIDUMP_BASEDIR} + /usr/bin/chsmack -t -a 'system::media' ${HCIDUMP_BASEDIR} + fi + /bin/mkdir -p ${HCIDUMP_DIR}/old_hcidump + /bin/rm -f ${HCIDUMP_DIR}/old_hcidump/* + /bin/mv ${HCIDUMP_PATH}* ${HCIDUMP_DIR}/old_hcidump/ + /usr/sbin/hcidump -w ${HCIDUMP_PATH} & + fi +elif [ -e ${HCIDUMP_DIR} ] +then + /bin/rm -rf ${HCIDUMP_DIR} +fi diff --git a/scripts/mobile/bt-reset-env.sh b/scripts/mobile/bt-reset-env.sh index 535aa35..8ac9481 100755 --- a/scripts/mobile/bt-reset-env.sh +++ b/scripts/mobile/bt-reset-env.sh @@ -11,13 +11,13 @@ rm -rf /var/lib/bluetooth/* # Initialize BT vconf values vconftool set -tf int db/bluetooth/status "0" -g 6520 +vconftool set -tf int db/bluetooth/lestatus "0" -g 6520 vconftool set -tf int file/private/bt-core/flight_mode_deactivated "0" -g 6520 -i vconftool set -tf string memory/bluetooth/sco_headset_name "" -g 6520 -i vconftool set -tf int memory/bluetooth/device "0" -g 6520 -i -vconftool set -tf int memory/bluetooth/btsco "0" -g 6520 -i vconftool set -tf int file/private/libug-setting-bluetooth-efl/visibility_time "0" -g 6520 -vconftool set -tf bool memory/private/bluetooth-share/quickpanel_clear_btn_status FALSE -g 6520 -i -vconftool set -tf bool memory/private/bluetooth-share/opp_server_init FALSE -g 6520 -i +#vconftool set -tf bool memory/private/bluetooth-share/quickpanel_clear_btn_status FALSE -g 6520 -i +#vconftool set -tf bool memory/private/bluetooth-share/opp_server_init FALSE -g 6520 -i # Remove BT shared memory list=`ipcs -m | awk '$1==0x0001000 {print $2}'` diff --git a/scripts/mobile/bt-stack-down.sh b/scripts/mobile/bt-stack-down.sh index 322241a..1e9c0d3 100755 --- a/scripts/mobile/bt-stack-down.sh +++ b/scripts/mobile/bt-stack-down.sh @@ -4,17 +4,24 @@ # Script for stopping Bluetooth stack # +PGREP="/usr/bin/pgrep" + # Remove BT device /usr/etc/bluetooth/bt-dev-end.sh # Kill BlueZ bluetooth stack -killall obexd obex-client -killall bt-syspopup -killall bluetooth-share -killall bluetooth-pb-agent -killall bluetooth-map-agent -killall bluetooth-hfp-agent -killall bluetoothd +pid=`${PGREP} obexd` +kill $pid +pid=`${PGREP} bt-syspopup` +kill $pid +pid=`${PGREP} bluetooth-pb` +kill $pid +pid=`${PGREP} bluetooth-map` +kill $pid +pid=`${PGREP} bluetooth-ag` +kill $pid +pid=`${PGREP} bluetoothd` +kill $pid # result exit 0 diff --git a/scripts/wearable/bt-reset-env.sh b/scripts/wearable/bt-reset-env.sh index 535aa35..859e4dc 100755 --- a/scripts/wearable/bt-reset-env.sh +++ b/scripts/wearable/bt-reset-env.sh @@ -14,7 +14,6 @@ vconftool set -tf int db/bluetooth/status "0" -g 6520 vconftool set -tf int file/private/bt-core/flight_mode_deactivated "0" -g 6520 -i vconftool set -tf string memory/bluetooth/sco_headset_name "" -g 6520 -i vconftool set -tf int memory/bluetooth/device "0" -g 6520 -i -vconftool set -tf int memory/bluetooth/btsco "0" -g 6520 -i vconftool set -tf int file/private/libug-setting-bluetooth-efl/visibility_time "0" -g 6520 vconftool set -tf bool memory/private/bluetooth-share/quickpanel_clear_btn_status FALSE -g 6520 -i vconftool set -tf bool memory/private/bluetooth-share/opp_server_init FALSE -g 6520 -i diff --git a/scripts/wearable/bt-stack-down.sh b/scripts/wearable/bt-stack-down.sh index a1ca153..9423662 100755 --- a/scripts/wearable/bt-stack-down.sh +++ b/scripts/wearable/bt-stack-down.sh @@ -4,18 +4,20 @@ # Script for stopping Bluetooth stack # +PGREP="/usr/bin/pgrep" + # Remove BT device /usr/etc/bluetooth/bt-dev-end.sh # Kill BlueZ bluetooth stack -killall bluetooth -killall obexd obex-client -killall bluetooth-share -killall bluetooth-pb-agent -killall bluetooth-map-agent -killall bluetooth-hfp-agent -killall bluetooth-hf-agent -killall bluetoothd +pid=`${PGREP} bt-syspopup` +kill $pid +pid=`${PGREP} bluetooth-hf` +kill $pid +pid=`${PGREP} bluetooth-ag` +kill $pid +pid=`${PGREP} bluetoothd` +kill $pid # result exit 0