[Lunar-commits] <moonbase-other> bluez: A few adjustments to BUILD, CONFIGURE and its service file.

stumbles stumbles at lunar-linux.org
Sun Dec 30 16:47:58 CET 2012


commit 636ff6c0b8419203b3ef1ae685489c1de7472e60
Author: stumbles <stumbles at lunar-linux.org>
Date: Sun, 30 Dec 2012 07:47:58 -0800
URL: https://github.com/lunar-linux/moonbase-other/commit/636ff6c0b8419203b3ef1ae685489c1de7472e60

bluez: A few adjustments to BUILD, CONFIGURE and its service file.

Removed the CONFFILES mquery as it would over right existing ones.
Even with --disable-datafiles files in /etc/bluetooth would get over
written.

In the BUILD added some if/thens so further insure any changes you
made to the conf files are not wiped out. Regardless of what I did,
main.conf and rfcomm.conf would always get stomped on so do some
if/thens to move them out of the way and put original ones back.
---
  bluetooth/bluez/BUILD                       | +52/-9    
  bluetooth/bluez/CONFIGURE                   | +0/-1     
  bluetooth/bluez/DETAILS                     | +30/-1    
  bluetooth/bluez/systemd.d/bluetooth.service | +2/-1     
  4 files changed, 84 insertions(+), 12 deletions(-)

--- a/bluetooth/bluez/BUILD
+++ b/bluetooth/bluez/BUILD
@@ -1,16 +1,47 @@
 (  
 
+# It wants to over write main and rfcomm, so if exist move 
+  if [ -f /etc/bluetooth/main.conf ] ; then
+    mv /etc/bluetooth/main.conf /etc/bluetooth/main.conf.orig
+  fi &&
+
+  if [ -f /etc/bluetooth/rfcomm.conf ] ; then
+    mv /etc/bluetooth/rfcomm.conf /etc/bluetooth/rfcomm.conf.orig
+  fi &&
+ 
   OPTS+=" --with-telephony=dummy" &&
 
   default_build  &&
 
-  mkdir -p /etc/bluetooth                    &&
-  install src/main.conf /etc/bluetooth/      &&
-  install audio/audio.conf /etc/bluetooth/   &&
-  install network/*.conf /etc/bluetooth/     &&
-  install input/*.conf /etc/bluetooth/       &&
-  install serial/serial.conf /etc/bluetooth/ &&
-  install tools/rfcomm.conf /etc/bluetooth/  &&
+  mkdir -p /etc/bluetooth &&
+
+  if [ ! -f /etc/bluetooth/main.conf ]; then
+    install src/main.conf /etc/bluetooth/
+  fi &&
+
+  if [ ! -f /etc/bluetooth/audio.conf ] ; then
+    install audio/audio.conf /etc/bluetooth/
+  fi &&
+
+  if [ ! -f /etc/bluetooth/network.conf ] ; then
+    install network/*.conf /etc/bluetooth/
+  fi &&
+
+  if [ ! -f /etc/bluetooth/input.conf ] ; then
+    install input/*.conf /etc/bluetooth/
+  fi &&
+
+  if [ ! -f /etc/blueooth.serial.conf ] ; then
+    install serial/serial.conf /etc/bluetooth/
+  fi &&
+
+  if [ ! -f /etc/bluetooth/rfcomm.conf ] ; then
+  install tools/rfcomm.conf /etc/bluetooth/
+  fi &&
+
+  if [ ! -f /etc/bluetooth/proximity.conf ] ; then
+    install proximity/proximity.conf /etc/bluetooth/
+  fi &&
 
   mkdir -p /etc/alsa  &&
   install audio/bluetooth.conf /etc/alsa  &&
@@ -18,7 +49,19 @@
   echo -e "@hooks [\n\t{\n\t\tfunc load\n\t\tfiles [\n\t\t\t"/etc/alsa/bluetooth.conf"\n\t\t]\n\
           \t\terrors false\n\t}\n]" > $SOURCE_DIRECTORY/asound.conf  &&
 
-  install -m644 asound.conf /etc/  &&
-  install -m755 scripts/bluetooth_serial /etc/init.d/
+  install -m644 asound.conf /etc/ &&
+
+  if module_installed sysvinit ; then
+    install -m755 scripts/bluetooth_serial /etc/init.d/
+  fi &&
+
+# If there were existing main and rfcomm conf files, put them back
+  if [ -f /etc/bluetooth/main.conf.orig ] ; then
+    mv /etc/bluetooth/main.conf.orig /etc/bluetooth/main.conf
+  fi &&
+
+  if [ -f /etc/bluetooth/rfcomm.conf.orig ] ; then
+    mv /etc/bluetooth/rfcomm.conf.orig /etc/bluetooth/rfcomm.conf
+  fi
 
 ) > $C_FIFO 2>&1
--- a/bluetooth/bluez/CONFIGURE
+++ b/bluetooth/bluez/CONFIGURE
@@ -6,7 +6,6 @@ mquery HIDD "Install HID daemon?" y "--enable-hidd" "--disable-hidd"
 mquery PAND "Install PAN daemon?" y "--enable-pand" "--disable-pand"
 mquery DUND "Install DUN daemon?" y "--enable-dund" "--disable-dund"
 mquery TEST "Install test programs?" y "--enable-test" "--disable-test"
-mquery CONFILES "Install Bluetooth configuration files" n "--enable-datafiles" "--disable-datafiles"
 mquery SAP "Enable SAP plugin?" y "--enable-sap" "--disable-sap"
 mquery PNAT "Enable PNAT plugin?" y "--enable-pnat" "--disable-pnat"
 mquery OOB "Compile with D-Bus OOB plugin?" y "--enable-dbusoob" "--disable-dbusoob"
--- a/bluetooth/bluez/DETAILS
+++ b/bluetooth/bluez/DETAILS
@@ -8,8 +8,37 @@
          UPDATED=20120624
            SHORT="support for core Bluetooth layers and protocols"
 
-LUNAR_RESTART_SERVICES=off
 cat << EOF
 BlueZ provides support for core Bluetooth layers and protocols. It is
 flexible, efficient and modular implementation.
+
+The following should go a long way to getting audio via bluetooth headset.
+Tested with Chromium and konqueror using ~/.asoundrc. 
+
+pcm.!default {
+type hw
+card INTEL
+}
+
+ctl.!default {
+type hw
+card INTEL
+}
+
+pcm.pulse { 
+    type pulse 
+} 
+ctl.pulse { 
+    type pulse 
+} 
+pcm.!default { 
+    type pulse 
+} 
+ctl.!default { 
+    type pulse 
+}
+
+The important part is the last 4 sections. AFAICT blueooth audio via a browser
+needs routing through pulseaudio. I could not get it to work routed directly 
+through alsa.
 EOF
--- a/bluetooth/bluez/systemd.d/bluetooth.service
+++ b/bluetooth/bluez/systemd.d/bluetooth.service
@@ -1,10 +1,11 @@
 [Unit]
 Description=Bluetooth Manager
+After=network.target
 
 [Service]
 Type=dbus
 BusName=org.bluez
-ExecStart=/usr/sbin/bluetoothd -n
+ExecStart=/usr/sbin/bluetoothd -nd
 StandardOutput=syslog
 
 [Install]




More information about the Lunar-commits mailing list