OBS User unknown 2008-09-24 15:21:01 +00:00 committed by Git OBS Bridge
parent 6c0cf5a349
commit a407f6ea3d
7 changed files with 167 additions and 10 deletions

23
README.SUSE Normal file
View File

@ -0,0 +1,23 @@
Notes about the SUSE bluez packages:
====================================
How does bluetoothd get started?
--------------------------------
Bluetoothd is started via D-Bus activation. This means: as soon as somebody
is requesting bluez services via D-Bus, bluetoothd is started.
Additionally, there is a udev rule that runs /lib/udev/bluetooth.sh every
time a bluetooth device is plugged into the system. This script sends a
request via dbus-send to start the bluetoothd.
For the case that D-Bus is not yet running during system bootup when the
adapter is detected, the script creates /dev/shm/bluetooth-adapter-present/
which is used in a later init script /etc/init.d/bluetooth-coldplug to
decide if bluetooth services should be started or not.
Of course you can still decide to always start bluetoothd on every boot by
issuing the "insserv bluetooth" command or enabling it with the YaST2 runlevel
editor.
If you want to prevent starting of the bluetooth service, edit
/etc/sysconfig/bluetooth and set START_SERVICES to "no".
Have a lot of fun...

24
bluetooth-coldplug.init Normal file
View File

@ -0,0 +1,24 @@
#! /bin/sh
# Copyright (c) 2008 SuSE Linux Products GmbH, Nuernberg, Germany.
#
# Author: Stefan Seyfried <feedback@suse.de>
# /etc/init.d/bluetooth-coldplug
#
### BEGIN INIT INFO
# Provides: bluetooth-coldplug
# Required-Start: $syslog $remote_fs
# Should-Start: dbus
# Required-Stop: $syslog $remote_fs
# Should-Stop: $null
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Coldplugging of bluetoothd
# Description: Starts bluetooth services on boot if an adapter is present.
### END INIT INFO
STATEFILE=/dev/shm/bluetooth-adapter-present
INITSCRIPT=/etc/init.d/bluetooth
[ -e $STATEFILE ] || exit 0
exec $INITSCRIPT "$@"

47
bluetooth.sh Normal file
View File

@ -0,0 +1,47 @@
#!/bin/bash
# $id$
# Bluetooth hotplug policy agent for Linux 2.6 kernels
#
# Bluetooth hotplug params include:
#
# ACTION=%s [add or remove]
# SUBSYSTEM=bluetooth
#
[ x"$SUBSYSTEM" = xbluetooth ] || {
echo "bad invocation: SUBSYSTEM != bluetooth"
exit 1
}
. /etc/sysconfig/hardware/scripts/functions
BLUETOOTH_CONFIG=/etc/sysconfig/bluetooth
test -r $BLUETOOTH_CONFIG || exit 6
. $BLUETOOTH_CONFIG
case $ACTION in
add)
info_mesg $ACTION $INTERFACE $START_SERVICES
if [ $START_SERVICES = "no" ]; then
exit 0
fi
# for later consumption by the bluetooth-coldplug init script
mkdir /dev/shm/bluetooth-adapter-present
# this is a fake dbus call, which gets the adapter up via DBus activation
/bin/dbus-send --system --type=method_call --print-reply --reply-timeout=1000 --dest=org.bluez / org.bluez.hello
;;
remove)
info_mesg $ACTION $INTERFACE
# Do this only if _all_ bt-devices are finally removed
# Problem: Devices in hid-proxy-mode are not known as /dev/hciX
if [ $ALWAYS_STOP_SERVICES = "yes" ]; then
/etc/init.d/bluetooth stop
fi
;;
*)
info_mesg Bluetooth $ACTION event not supported
exit 1
;;
esac

View File

@ -0,0 +1,9 @@
--- scripts/bluetooth.rules
+++ scripts/bluetooth.rules
@@ -1,3 +1,6 @@
+# bluetooth subsystem
+SUBSYSTEM=="bluetooth", RUN+="/lib/udev/bluetooth.sh"
+
# Brain Boxes BL-620 Bluetooth Adapter
SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Brain Boxes", SYSFS{prod_id2}=="Bluetooth PC Card", ENV{HCIOPTS}="bboxes", RUN+="bluetooth_serial"

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Wed Sep 24 00:12:45 CEST 2008 - seife@suse.de
- use /dev/shm instead of /var/run for the coldplug-marker, since
/var/run is cleaned up later in the boot process
-------------------------------------------------------------------
Tue Sep 23 17:31:19 CEST 2008 - seife@suse.de
- add more useful stuff to bluez-test
- add dbus-activation of bluetoothd
- use dbus-activation to start on adapter hotplug event
- add bluetooth-coldplug init script to make sure that bluetoothd
is started when adapter is plugged in before DBus is started
- add "Provides: bluez-utils" to bluez, to help the solver
-------------------------------------------------------------------
Wed Sep 17 17:16:54 CEST 2008 - dmueller@suse.de

View File

@ -25,7 +25,7 @@ BuildRequires: alsa-devel libsndfile-devel
BuildRequires: gstreamer-0_10-devel gstreamer-0_10-plugins-base-devel
Url: http://www.bluez.org
Version: 4.6
Release: 2
Release: 3
Summary: Bluetooth Stack for Linux
Group: Hardware/Mobile
License: GPL v2 or later
@ -33,7 +33,12 @@ Group: Hardware/Mobile
AutoReqProv: on
Source: bluez-%{version}.tar.bz2
Source1: bluetooth.init
Source2: bluetooth.sysconfig
Source2: bluetooth-coldplug.init
Source3: bluetooth.sysconfig
Source4: bluetooth.sh
Source5: org.bluez.service
Source6: README.SUSE
Patch1: bluez-utils-3.8-bluetooth.rules.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: bluez-utils = 3.36
Obsoletes: bluez-utils <= 3.36
@ -158,7 +163,9 @@ Authors:
%prep
%setup -q
%patch1 -p0
cp %{S:1} scripts/
cp %{S:6} .
%{?suse_update_config:%{suse_update_config -f . }}
%build
@ -190,22 +197,31 @@ CFLAGS="$RPM_OPT_FLAGS -g" \
--enable-configfiles \
--enable-initscripts \
--enable-pcmciarules
make %{?jobs:-j %jobs}
make %{?jobs:-j %jobs} all
%install
make DESTDIR=$RPM_BUILD_ROOT install
# bluez-test
cd test
install --mode=0755 apitest list-devices test-adapter test-device test-discovery test-manager test-serial $RPM_BUILD_ROOT/%{_bindir}/
cd ..
rm -v $RPM_BUILD_ROOT/%{_libdir}/bluetooth/plugins/*.la $RPM_BUILD_ROOT/%{_libdir}/libbluetooth.la
rm -v $RPM_BUILD_ROOT/%{_libdir}/gstreamer-0.10/libgstbluetooth.la
rm -v $RPM_BUILD_ROOT/%{_libdir}/alsa-lib/*.la
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/udev/rules.d
mv -v $RPM_BUILD_ROOT/%{_sysconfdir}/udev/bluetooth.rules $RPM_BUILD_ROOT/%{_sysconfdir}/udev/rules.d/40-bluetooth.rules
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
cp %{S:2} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.bluetooth
install --mode=0755 -D %{S:2} $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/bluetooth-coldplug
install --mode=0644 -D %{S:3} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.bluetooth
install --mode=0755 -D %{S:4} $RPM_BUILD_ROOT/lib/udev/bluetooth.sh
install --mode=0644 -D %{S:5} $RPM_BUILD_ROOT/usr/share/dbus-1/system-services/org.bluez.service
ln -s ../../etc/init.d/bluetooth $RPM_BUILD_ROOT/usr/sbin/rcbluetooth
%clean
rm -rf $RPM_BUILD_ROOT
%post
%{fillup_only -n bluetooth}
/sbin/insserv -f /etc/init.d/bluetooth-coldplug
%preun
%stop_on_removal bluetooth
@ -219,8 +235,9 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
%doc AUTHORS COPYING INSTALL ChangeLog README
%doc AUTHORS COPYING ChangeLog README README.SUSE
/etc/init.d/bluetooth
/etc/init.d/bluetooth-coldplug
%{_bindir}/hcitool
%{_bindir}/l2ping
%{_bindir}/rfcomm
@ -231,9 +248,8 @@ rm -rf $RPM_BUILD_ROOT
%{_sbindir}/hciconfig
%{_sbindir}/bluetoothd
%{_sbindir}/hid2hci
#%{_sbindir}/rcbluetooth
%{_sbindir}/rcbluetooth
%{_sbindir}/bccmd
%{_sbindir}/hciemu
%dir %{_sysconfdir}/udev
%dir /lib/udev
/lib/udev/*
@ -266,6 +282,7 @@ rm -rf $RPM_BUILD_ROOT
/var/adm/fillup-templates/sysconfig.bluetooth
%config %{_sysconfdir}/udev/rules.d
%config %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
%config /usr/share/dbus-1/system-services/org.bluez.service
#%doc %{_defaultdocdir}/bluez-utils/
%dir /var/lib/bluetooth
@ -290,26 +307,43 @@ rm -rf $RPM_BUILD_ROOT
%files test
%defattr(-,root,root)
%{_sbindir}/hciemu
%{_bindir}/l2test
%{_bindir}/rctest
%{_bindir}/apitest
%{_bindir}/list-devices
%{_bindir}/test-adapter
%{_bindir}/test-device
%{_bindir}/test-discovery
%{_bindir}/test-manager
%{_bindir}/test-serial
#%{_bindir}/hsmicro
#%{_bindir}/hsplay
#%{_bindir}/hstest
#%{_bindir}/attest
#%{_bindir}/apitest
#%{_bindir}/passkey-agent
#%{_bindir}/auth-agent
#%doc %{_defaultdocdir}/bluez-test
%files alsa
%defattr(-,root,root)
%{_libdir}/alsa-lib/*
%{_libdir}/alsa-lib/*.so
%files gstreamer
%defattr(-, root, root)
%{_libdir}/gstreamer-*/*.so
%changelog
* Wed Sep 24 2008 seife@suse.de
- use /dev/shm instead of /var/run for the coldplug-marker, since
/var/run is cleaned up later in the boot process
* Tue Sep 23 2008 seife@suse.de
- add more useful stuff to bluez-test
- add dbus-activation of bluetoothd
- use dbus-activation to start on adapter hotplug event
- add bluetooth-coldplug init script to make sure that bluetoothd
is started when adapter is plugged in before DBus is started
- add "Provides: bluez-utils" to bluez, to help the solver
* Wed Sep 17 2008 dmueller@suse.de
- add missing splitprovides
- fix bluez-utils rename

4
org.bluez.service Normal file
View File

@ -0,0 +1,4 @@
[D-BUS Service]
Name=org.bluez
Exec=/etc/init.d/bluetooth start
User=root