From: kh5325.kim Date: Thu, 10 Oct 2013 12:32:23 +0000 (+0900) Subject: cp sdbd.service file & clean up build script files X-Git-Tag: submit/tizen_2.2/20131010.123438^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=88e59dbe2ec1f4f40b6af8e6dad150b57c7d1c83;p=sdk%2Ftarget%2Fsdbd.git cp sdbd.service file & clean up build script files Change-Id: Icfdd8a59092e7dd51a71ab87324a7a4f0726b4b3 Signed-off-by: kh5325.kim --- diff --git a/Makefile b/Makefile index 240e1be..dc0eb36 100644 --- a/Makefile +++ b/Makefile @@ -1,67 +1,8 @@ # # -# Makefile for sdb +# Makefile for sdbd # -# -HOST_OS := $(shell uname -s | tr A-Z a-z) - -# sdb host tool -# ========================================================= - -# Default to a virtual (sockets) usb interface -USB_SRCS := -EXTRA_SRCS := - -ifeq ($(HOST_OS),linux) - USB_SRCS := usb_linux.c - EXTRA_SRCS := get_my_path_linux.c - LOCAL_LDLIBS += -lrt -lncurses -lpthread -endif - -ifeq ($(HOST_OS),darwin) - USB_SRCS := usb_osx.c - EXTRA_SRCS := get_my_path_darwin.c - LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit -framework Carbon - SDB_EXTRA_CFLAGS := -mmacosx-version-min=10.4 -endif - -ifeq ($(HOST_OS),freebsd) - USB_SRCS := usb_libusb.c - EXTRA_SRCS := get_my_path_freebsd.c - LOCAL_LDLIBS += -lpthread -lusb -endif - - - -SDB_SRC_FILES := \ - src/sdb.c \ - src/console.c \ - src/transport.c \ - src/transport_local.c \ - src/transport_usb.c \ - src/commandline.c \ - src/sdb_client.c \ - src/sockets.c \ - src/services.c \ - src/file_sync_client.c \ - src/$(EXTRA_SRCS) \ - src/$(USB_SRCS) \ - src/utils.c \ - src/usb_vendors.c \ - src/fdevent.c \ - src/socket_inaddr_any_server.c \ - src/socket_local_client.c \ - src/socket_local_server.c \ - src/socket_loopback_client.c \ - src/socket_loopback_server.c \ - src/socket_network_client.c - -SDB_CFLAGS := -O2 -g -DSDB_HOST=1 -DSDB_HOST_ON_TARGET=1 -Wall -Wno-unused-parameter -SDB_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE -SDB_CFLAGS += -DHAVE_FORKEXEC -DHAVE_TERMIO_H -DHAVE_SYMLINKS -SDB_LFLAGS := $(LOCAL_LDLIBS) - SDBD_SRC_FILES := \ src/sdb.c \ src/fdevent.c \ @@ -94,36 +35,11 @@ IFLAGS := -Iinclude -Isrc -I/usr/include/system OBJDIR := bin INSTALLDIR := usr/sbin INITSCRIPTDIR := etc/init.d -RCSCRIPTDIR := etc/rc.d/rc3.d -LAUNCH_SCRIPT := sdk_launch - -UNAME := $(shell uname -sm) -ifneq (,$(findstring 86,$(UNAME))) - HOST_ARCH := x86 -endif -TARGET_ARCH = $(HOST_ARCH) -ifeq ($(TARGET_ARCH),) - TARGET_ARCH := arm -endif - -ifeq ($(TARGET_ARCH),arm) - MODULE := sdbd - SDBD_CFLAGS += -DANDROID_GADGET=1 -else -ifeq ($(TARGET_HOST),true) - MODULE := sdb -else - MODULE := sdbd -endif -endif +MODULE := sdbd all : $(MODULE) -sdb : $(SDB_SRC_FILES) - mkdir -p $(OBJDIR) - $(CC) -pthread -o $(OBJDIR)/$(MODULE) $(SDB_CFLAGS) $(SDB_EXTRA_CFLAGS) $(SDB_LFLAGS) $(IFLAGS) $(SDB_SRC_FILES) - sdbd : $(SDBD_SRC_FILES) mkdir -p $(OBJDIR) $(CC) -pthread -o $(OBJDIR)/$(MODULE) $(SDBD_CFLAGS) $(IFLAGS) $(SDBD_SRC_FILES) $(SDBD_LFLAGS) @@ -131,15 +47,8 @@ sdbd : $(SDBD_SRC_FILES) install : mkdir -p $(DESTDIR)/$(INSTALLDIR) install $(OBJDIR)/$(MODULE) $(DESTDIR)/$(INSTALLDIR)/$(MODULE) - install $(LAUNCH_SCRIPT) $(DESTDIR)/$(INSTALLDIR)/$(LAUNCH_SCRIPT) -ifeq ($(MODULE),sdbd) mkdir -p $(DESTDIR)/$(INITSCRIPTDIR) install script/sdbd $(DESTDIR)/$(INITSCRIPTDIR)/sdbd -endif -ifeq ($(TARGET_ARCH),x86) - mkdir -p $(DESTDIR)/$(RCSCRIPTDIR) - install script/S06sdbd $(DESTDIR)/$(RCSCRIPTDIR)/S06sdbd -endif clean : rm -rf $(OBJDIR)/* diff --git a/packaging/sdbd.changes b/packaging/sdbd.changes new file mode 100644 index 0000000..89f04c3 --- /dev/null +++ b/packaging/sdbd.changes @@ -0,0 +1,10 @@ +* Wed Apr 04 2013 Ho Namkoong + - supports platform gdbserver +* Mon Dec 02 2012 Yoonki Park + - supports cs report service using inotify +* Mon Dec 02 2012 Yoonki Park + - sdb code dropped from adb (Ice Cream Samdwich 4.1.1) +* Wed Apr 18 2012 Yoonki Park + - set dir permission to 777 +* Sat Mar 31 2012 Yoonki Park + - let sshd be daemon and create sshd.pid file \ No newline at end of file diff --git a/packaging/sdbd.spec b/packaging/sdbd.spec index 44b3fe4..049e4e9 100644 --- a/packaging/sdbd.spec +++ b/packaging/sdbd.spec @@ -1,10 +1,13 @@ Name: sdbd Summary: SDB daemon -Version: 2.2.8 -Release: 1 -Group: TO_BE/FILLED_IN -License: TO BE FILLED IN +Version: 2.2.13 +Release: 0 +License: Apache-2.0 +Summary: SDB daemon +Group: System/Utilities Source0: %{name}-%{version}.tar.gz +Source1001: sdbd_device.service +Source1002: sdbd_emulator.service BuildRequires: capi-system-info-devel Requires(post): pkgmgr @@ -17,7 +20,7 @@ Requires: debug-launchpad Requires: dbus %description -Description: SDB daemon +Description: SDB daemon. %prep @@ -32,7 +35,17 @@ rm -rf %{buildroot} mkdir -p %{buildroot}/usr/share/license cp LICENSE %{buildroot}/usr/share/license/%{name} + %make_install +mkdir -p %{buildroot}%{_libdir}/systemd/system +%if 0%{?simulator} +install -m 0644 %SOURCE1001 %{buildroot}%{_libdir}/systemd/system/sdbd.service +%else +install -m 0644 %SOURCE1002 %{buildroot}%{_libdir}/systemd/system/sdbd.service +%endif + +mkdir -p %{buildroot}%{_prefix}/sbin +install -m 755 script/sdk_launch %{buildroot}%{_prefix}/sbin/ %post chsmack -a sdbd::home /home/developer @@ -45,19 +58,6 @@ chsmack -t /home/developer %{_prefix}/sbin/sdk_launch %{_sysconfdir}/init.d/sdbd /usr/share/license/%{name} - -%ifarch %{ix86} - %{_sysconfdir}/rc.d/rc3.d -%endif +%{_libdir}/systemd/system/sdbd.service %changelog -* Wed Apr 04 2013 Ho Namkoong - - supports platform gdbserver -* Mon Dec 02 2012 Yoonki Park - - supports cs report service using inotify -* Mon Dec 02 2012 Yoonki Park - - sdb code dropped from adb (Ice Cream Samdwich 4.1.1) -* Wed Apr 18 2012 Yoonki Park - - set dir permission to 777 -* Sat Mar 31 2012 Yoonki Park - - let sshd be daemon and create sshd.pid file diff --git a/packaging/sdbd_device.service b/packaging/sdbd_device.service new file mode 100644 index 0000000..0b92d85 --- /dev/null +++ b/packaging/sdbd_device.service @@ -0,0 +1,10 @@ +[Unit] +Description=sdbd +After=default.target + +[Service] +Type=forking +Environment=DISPLAY=:0 +PIDFile=/tmp/.sdbd.pid +RemainAfterExit=yes +ExecStart=/usr/sbin/sdbd diff --git a/packaging/sdbd_emulator.service b/packaging/sdbd_emulator.service new file mode 100644 index 0000000..274c3e9 --- /dev/null +++ b/packaging/sdbd_emulator.service @@ -0,0 +1,15 @@ +[Unit] +Description=sdbd +Before=sensord.service + +[Service] +Type=forking +Environment=DISPLAY=:0 +PIDFile=/tmp/.sdbd.pid +RemainAfterExit=yes +ExecStartPre=/bin/bash -c "/bin/echo `/bin/sed 's/^.*sdb_port=\([^, ]*\).*$/\1/g' /proc/cmdline` > /opt/home/sdb_port.txt" +ExecStart=/usr/sbin/sdbd + +[Install] +WantedBy=emulator.target + diff --git a/script/sdk_launch b/script/sdk_launch new file mode 100755 index 0000000..2166781 --- /dev/null +++ b/script/sdk_launch @@ -0,0 +1,161 @@ +#!/bin/bash + +# Authors: +# Kangho Kim , Yoonki Park +# +# Description: front hand of app launcher + +APP_PATH_PREFIX=/opt/apps +SDK_TOOLS_PATH=/home/developer/sdk_tools + +print_usage() +{ + echo "usage: $0 -p -e -m [-P ] [-attach ] -t []" +} + +first="true" + +until [ -z "$1" ]; do + case "$1" in + -p) + if [ -z "$2" ] + then + print_usage + exit 1; + fi + pkgid=$2 + shift 2; + ;; + -e) + if [ -z "$2" ] + then + print_usage + exit 1; + fi + exe=${2/%.exe/} + shift 2; + ;; + -m) + if [ "$2" != "run" ] && [ "$2" != "debug" ] && [ "$2" != "da" ] && [ "$2" != "oprofile" ] + then + print_usage + exit 1; + fi + mode=$2 + shift 2; + ;; + -P) + if [ -z "$2" ] + then + print_usage + exit 1; + fi + port=$2 + shift 2; + ;; + -attach) + if [ -z "$2" ] + then + print_usage + exit 1; + fi + attach_id=$2 + shift 2; + ;; + -t) + if [ "$2" = "" ] || [ ${2:0:1} = "-" ] + then + shift 1; + else +# parse -t option + OLD_IFS=$IFS;IFS=,; + for type in $2;do + if [ "$type" = "gtest" ] + then + COV_TEST_PREFIX="export LD_LIBRARY_PATH=%s/gtest/usr/lib && $COV_TEST_PREFIX" + if [ "" != "$result_mode" ] + then + result_mode="$result_mode,UNIT_TEST" + else + launch_app_mode="__LAUNCH_APP_MODE__ SYNC" + result_mode="UNIT_TEST" + fi + fi + if [ "$type" = "gcov" ] + then + COV_TEST_PREFIX="export GCOV_PREFIX=/tmp/%s/data && export GCOV_PREFIX_STRIP=0 && $COV_TEST_PREFIX" + if [ "" != "$result_mode" ] + then + result_mode="$result_mode,CODE_COVERAGE" + else + launch_app_mode="__LAUNCH_APP_MODE__ SYNC" + result_mode="CODE_COVERAGE" + fi + fi + done; + IFS=$OLD_IFS + + shift 2; + fi + ;; + *) + if [ "$first" = "true" ] + then + first="false" + args="__DLP_UNIT_TEST_ARG__ $1" + else + args="$args","$1" + fi + shift 1; + esac +done + +if [ "$mode" = "debug" ] +then + if [ "" != "$attach_id" ] + #debug attach + then + cmd="$COV_TEST_PREFIX /home/developer/sdk_tools/gdbserver/gdbserver :$port --attach $attach_id" + #debug + else + if [ "" != "$result_mode" ] + then + result_mode="DEBUG,$result_mode" + else + result_mode="DEBUG" + fi + cmd="/usr/bin/launch_app $pkgid.$exe __AUL_SDK__ $result_mode __DLP_DEBUG_ARG__ :$port $launch_app_mode" +# cmd="$COV_TEST_PREFIX /home/developer/sdk_tools/gdbserver/gdbserver :$port /opt/apps/$pkgid/bin/$exe" + fi +else + if [ "$mode" = "run" ] + then + if [ "" != "$result_mode" ] + then + cmd="/usr/bin/launch_app $pkgid.$exe __AUL_SDK__ $result_mode $launch_app_mode" + else + cmd="/usr/bin/launch_app $pkgid.$exe" + fi + else + if [ "$mode" = "da" ] + then + if [ "" != "$result_mode" ] + then + result_mode="DYNAMIC_ANALYSIS,$result_mode" + else + result_mode="DYNAMIC_ANALYSIS" + fi + fi + if [ "$mode" = "oprofile" ] + then + if [ "" == "$result_mode" ] + then + result_mode="OPROFILE" + fi + fi + cmd="/usr/bin/launch_app $pkgid.$exe __AUL_SDK__ $result_mode" + fi +fi + +# execute command +$cmd $args diff --git a/sdk_launch b/sdk_launch deleted file mode 100755 index 2166781..0000000 --- a/sdk_launch +++ /dev/null @@ -1,161 +0,0 @@ -#!/bin/bash - -# Authors: -# Kangho Kim , Yoonki Park -# -# Description: front hand of app launcher - -APP_PATH_PREFIX=/opt/apps -SDK_TOOLS_PATH=/home/developer/sdk_tools - -print_usage() -{ - echo "usage: $0 -p -e -m [-P ] [-attach ] -t []" -} - -first="true" - -until [ -z "$1" ]; do - case "$1" in - -p) - if [ -z "$2" ] - then - print_usage - exit 1; - fi - pkgid=$2 - shift 2; - ;; - -e) - if [ -z "$2" ] - then - print_usage - exit 1; - fi - exe=${2/%.exe/} - shift 2; - ;; - -m) - if [ "$2" != "run" ] && [ "$2" != "debug" ] && [ "$2" != "da" ] && [ "$2" != "oprofile" ] - then - print_usage - exit 1; - fi - mode=$2 - shift 2; - ;; - -P) - if [ -z "$2" ] - then - print_usage - exit 1; - fi - port=$2 - shift 2; - ;; - -attach) - if [ -z "$2" ] - then - print_usage - exit 1; - fi - attach_id=$2 - shift 2; - ;; - -t) - if [ "$2" = "" ] || [ ${2:0:1} = "-" ] - then - shift 1; - else -# parse -t option - OLD_IFS=$IFS;IFS=,; - for type in $2;do - if [ "$type" = "gtest" ] - then - COV_TEST_PREFIX="export LD_LIBRARY_PATH=%s/gtest/usr/lib && $COV_TEST_PREFIX" - if [ "" != "$result_mode" ] - then - result_mode="$result_mode,UNIT_TEST" - else - launch_app_mode="__LAUNCH_APP_MODE__ SYNC" - result_mode="UNIT_TEST" - fi - fi - if [ "$type" = "gcov" ] - then - COV_TEST_PREFIX="export GCOV_PREFIX=/tmp/%s/data && export GCOV_PREFIX_STRIP=0 && $COV_TEST_PREFIX" - if [ "" != "$result_mode" ] - then - result_mode="$result_mode,CODE_COVERAGE" - else - launch_app_mode="__LAUNCH_APP_MODE__ SYNC" - result_mode="CODE_COVERAGE" - fi - fi - done; - IFS=$OLD_IFS - - shift 2; - fi - ;; - *) - if [ "$first" = "true" ] - then - first="false" - args="__DLP_UNIT_TEST_ARG__ $1" - else - args="$args","$1" - fi - shift 1; - esac -done - -if [ "$mode" = "debug" ] -then - if [ "" != "$attach_id" ] - #debug attach - then - cmd="$COV_TEST_PREFIX /home/developer/sdk_tools/gdbserver/gdbserver :$port --attach $attach_id" - #debug - else - if [ "" != "$result_mode" ] - then - result_mode="DEBUG,$result_mode" - else - result_mode="DEBUG" - fi - cmd="/usr/bin/launch_app $pkgid.$exe __AUL_SDK__ $result_mode __DLP_DEBUG_ARG__ :$port $launch_app_mode" -# cmd="$COV_TEST_PREFIX /home/developer/sdk_tools/gdbserver/gdbserver :$port /opt/apps/$pkgid/bin/$exe" - fi -else - if [ "$mode" = "run" ] - then - if [ "" != "$result_mode" ] - then - cmd="/usr/bin/launch_app $pkgid.$exe __AUL_SDK__ $result_mode $launch_app_mode" - else - cmd="/usr/bin/launch_app $pkgid.$exe" - fi - else - if [ "$mode" = "da" ] - then - if [ "" != "$result_mode" ] - then - result_mode="DYNAMIC_ANALYSIS,$result_mode" - else - result_mode="DYNAMIC_ANALYSIS" - fi - fi - if [ "$mode" = "oprofile" ] - then - if [ "" == "$result_mode" ] - then - result_mode="OPROFILE" - fi - fi - cmd="/usr/bin/launch_app $pkgid.$exe __AUL_SDK__ $result_mode" - fi -fi - -# execute command -$cmd $args