[packages_10.03.2] bluez-utils: merge r28956, r29231, r29523
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 5 Feb 2012 16:42:42 +0000 (16:42 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 5 Feb 2012 16:42:42 +0000 (16:42 +0000)
SVN-Revision: 30290

utils/bluez-utils/Makefile
utils/bluez-utils/files/bluetooth.conf [deleted file]
utils/bluez-utils/files/bluetooth.config [new file with mode: 0644]
utils/bluez-utils/files/bluez-utils.init

index 876d7808d3183b95ed387601b8bc44db7bcba453..7da3438cc0328414613a3050281a4420ad67f72b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2011 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bluez-utils
 PKG_VERSION:=3.36
-PKG_RELEASE:=7
+PKG_RELEASE:=10
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://bluez.sourceforge.net/download
@@ -56,18 +56,16 @@ define Build/Compile
                all install
 endef
 
-#copy bluetooth.conf nach /etc/dbus-1/system.d/
-
 define Package/bluez-utils/install
        $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
        $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/etc/bluetooth
-       $(CP) $(PKG_INSTALL_DIR)/../hcid/hcid.conf $(1)/etc/bluetooth/
-       $(CP) $(PKG_INSTALL_DIR)/../rfcomm/rfcomm.conf $(1)/etc/bluetooth/
+       $(CP) $(PKG_INSTALL_DIR)/etc/bluetooth/hcid.conf $(1)/etc/bluetooth/
+       $(CP) $(PKG_INSTALL_DIR)/etc/bluetooth/rfcomm.conf $(1)/etc/bluetooth/
        $(INSTALL_DIR) $(1)/etc/config
-       $(INSTALL_DATA) ./files/bluetooth.conf $(1)/etc/config/bluetooth
+       $(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth
        $(INSTALL_DIR) $(1)/etc/dbus-1/system.d/
        $(INSTALL_DATA) ./files/bluetooth.dbus $(1)/etc/dbus-1/system.d/bluetooth.conf
        $(INSTALL_DIR) $(1)/etc/init.d
diff --git a/utils/bluez-utils/files/bluetooth.conf b/utils/bluez-utils/files/bluetooth.conf
deleted file mode 100644 (file)
index 42f390c..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-config hcid
-#      option config   /etc/bluetooth/hcid.conf
-       option enabled  1
-
-config hciattach
-       option initspeed        115200
-       option tty      ttyS1
-       option type     csr
-       option speed    115200
-       option flow     noflow
-       option enabled  0
-
-config rfcomm
-#      option config   /etc/bluetooth/rfcomm.conf
-       option enabled  0
-
-config dund
-       option listen   true
-       option persist  true
-       option msdun    true
-       option interface dund
-       option unit     1
-       option pppdopts "ktune proxyarp 192.168.1.1:192.168.1.2 ms-dns 192.168.1.1"
-       option enabled  0
-
-config pand
-       option listen   true
-       option autozap  true
-       option role     "NAP"
-       option master   true
-       option persist  true
-       option enabled  0
diff --git a/utils/bluez-utils/files/bluetooth.config b/utils/bluez-utils/files/bluetooth.config
new file mode 100644 (file)
index 0000000..42f390c
--- /dev/null
@@ -0,0 +1,32 @@
+config hcid
+#      option config   /etc/bluetooth/hcid.conf
+       option enabled  1
+
+config hciattach
+       option initspeed        115200
+       option tty      ttyS1
+       option type     csr
+       option speed    115200
+       option flow     noflow
+       option enabled  0
+
+config rfcomm
+#      option config   /etc/bluetooth/rfcomm.conf
+       option enabled  0
+
+config dund
+       option listen   true
+       option persist  true
+       option msdun    true
+       option interface dund
+       option unit     1
+       option pppdopts "ktune proxyarp 192.168.1.1:192.168.1.2 ms-dns 192.168.1.1"
+       option enabled  0
+
+config pand
+       option listen   true
+       option autozap  true
+       option role     "NAP"
+       option master   true
+       option persist  true
+       option enabled  0
index 0b326280bfd694697cbbe04917fc690ba8665dd1..85da5d8e57e43e07f8e3308b75c9ac340944afc5 100644 (file)
@@ -10,7 +10,7 @@ append_bool() {
        local value="$3"
        local _val
        config_get_bool _val "$section" "$option" '0'
-       [ "$_val" -gt 0 ] && append args "$3"
+       [ $_val -gt 0 ] && append args "$3"
 }
 
 append_string() {
@@ -25,35 +25,40 @@ append_string() {
 
 hcid_config() {
        local cfg="$1"
+       config_get_bool enabled "$cfg" "enabled" '1'
+       [ $enabled -gt 0 ] || return 1
        args=""
        append_bool "$cfg" nodaemon "-n"
        append_string "$cfg" config "-f"
-       config_get_bool enabled "$cfg" "enabled" '1'
-       [ "$enabled" -gt 0 ] && /usr/sbin/hcid $args
+       service_start /usr/sbin/hcid $args
 }
 
 hciattach_config() {
        local cfg="$1"
+       config_get_bool enabled "$cfg" "enabled" '1'
+       [ $enabled -gt 0 ] || return 1
        args=""
        append_string "$cfg" initspeed "-s" "115200"
        append_string "$cfg" tty " " "ttyS1"
        append_string "$cfg" type " " "csr"
        append_string "$cfg" speed " " "115200"
        append_string "$cfg" flow " " "noflow"
-       config_get_bool enabled "$cfg" "enabled" '1'
-       [ "$enabled" -gt 0 ] && /usr/sbin/hciattach $args
+       service_start /usr/sbin/hciattach $args
 }
 
 rfcomm_config() {
        local cfg="$1"
+       config_get_bool enabled "$cfg" "enabled" '1'
+       [ $enabled -gt 0 ] || return 1
        args=""
        append_string "$cfg" config "-f"
-       config_get_bool enabled "$cfg" "enabled" '1'
-       [ "$enabled" -gt 0 ] && /usr/bin/rfcomm $args bind all
+       /usr/bin/rfcomm $args bind all
 }
 
 dund_config() {
        local cfg="$1"
+       config_get_bool enabled "$cfg" "enabled" '1'
+       [ $enabled -gt 0 ] || return 1
        args=""
        append_bool "$cfg" listen "--listen"
        append_string "$cfg" connect "--connect"
@@ -80,12 +85,13 @@ dund_config() {
                [ -z "$unit" ] || append args "unit $unit ipparam $ifn linkname $ifn"
        fi
 
-       config_get_bool enabled "$cfg" "enabled" '1'
-       [ "$enabled" -gt 0 ] && /usr/bin/dund $args
+       service_start /usr/bin/dund $args
 }
 
 pand_config() {
        local cfg="$1"
+       config_get_bool enabled "$cfg" "enabled" '1'
+       [ $enabled -gt 0 ] || return 1
        args=""
        append_bool "$cfg" listen "--listen"
        append_string "$cfg" connect "--connect"
@@ -104,8 +110,7 @@ pand_config() {
        append_bool "$cfg" persist "--persist"
        append_bool "$cfg" cache "--cache"
        append_string "$cfg" pidfile "--pidfile"
-       config_get_bool enabled "$cfg" "enabled" '1'
-       [ "$enabled" -gt 0 ] && /usr/bin/pand $args
+       service_start /usr/bin/pand $args
 }
 
 start() {
@@ -121,9 +126,9 @@ start() {
 }
 
 stop() {
-       killall dund
-       killall pand
+       service_stop /usr/bin/dund
+       service_stop /usr/bin/pand
        /usr/bin/rfcomm release all
-       killall hciattach
-       killall hcid
+       service_stop /usr/sbin/hciattach
+       service_stop /usr/sbin/hcid
 }