LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-22-2015, 12:44 PM   #16
WhiteWolf1776
Member
 
Registered: Oct 2010
Location: Bowling Green, KY
Distribution: Slackware
Posts: 288

Rep: Reputation: 95

This started as I was updating the kernel to better support a newer laptop, and bluetooth stopped working. Looking at bluez release notes:

http://www.bluez.org/release-of-bluez-5-22/
http://www.bluez.org/release-of-bluez-5-21/

I realized that, after linux 3.17, bluez was updated and would need to be upgraded.

using this:
http://www.linuxfromscratch.org/blfs...ral/bluez.html

I patched the slackbuild... hoping that the "Requires D-Bus-1.8.16" was more of a 'suggestion', as slackwares dbus is 1.6.12.

After hunting through the log I found the dbus errors, etc, and looked at the kernel source finding the trusted device changes there and in bluez. I don't have those other links anymore and can't seem to find them. Much of this was me looking through code and logfiles.

If somehow this does work, and reconnects after a reboot / restart of the bluetooth device.. please let me know. I had given up on using an updated bluez library on the newer laptop until dbus gets updated in -current.
 
Old 02-22-2015, 12:55 PM   #17
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Original Poster
Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
You weren't able to just build dbus 1.8 and upgradepkg to it?
 
Old 02-22-2015, 12:59 PM   #18
WhiteWolf1776
Member
 
Registered: Oct 2010
Location: Bowling Green, KY
Distribution: Slackware
Posts: 288

Rep: Reputation: 95
To do that... I would need to update dbus-glib, glib.. etc.. etc... got into just more core components than i wanted to mess with at the time.

This should give you some idea of what you'd need to update to get the updated dbus working:
http://www.linuxfromscratch.org/blfs...eral/dbus.html
 
Old 02-22-2015, 01:09 PM   #19
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Original Poster
Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
There's also this:

http://wiki.beyondlogic.org/index.ph..._tools_for_ARM

I just tried upgrading dbus to 1.8 and libical to 1.0.1, and rebuilding dbus-python and dbus-glib (you don't need to rebuild glib), but you know what? Bluez 5 built just fine with dbus 1.6, it works fine AFAIK (there were no errors in dmesg or /var/log/messages), so I'm going to revert the dbus packages back to Slackware's until I actually get a problem.

Quote:
Originally Posted by WhiteWolf1776 View Post
so while a device will pair and work, it won't pair again automatically as other bits need upgraded as well for this to work..
Quote:
Originally Posted by WhiteWolf1776 View Post
The devices paired fine, but wouldn't reconnect as a trusted device should.
Which is it?

I'm not trying to be a jerk here; I'm trying to get a clear picture of what issues I should be prepared for.

My own tests with PhantomX's SlackBuilds have shown that my Dualshock 4 both stays paired, and reconnects as expected.

Last edited by dugan; 02-22-2015 at 01:33 PM.
 
Old 02-22-2015, 02:49 PM   #20
WhiteWolf1776
Member
 
Registered: Oct 2010
Location: Bowling Green, KY
Distribution: Slackware
Posts: 288

Rep: Reputation: 95
Ok, last bit and i'm sorta done saying the same thing...

Devices will pair..

You are likely to have to repeat the pairing process as the trusted device concept will not work without upgraded kernel, dbus, etc.

So, to put it as simply as I know how...

pair... works... then turn the device off... turn the device on... it won't hook back in without removing and redoing the pair.

Not sure where the disconnect is in those two statements you reference above...

Both of those quotes say "the device will pair" and both say "the device will not reconnect"... if english is a second language, get a better translator.
 
Old 02-22-2015, 03:05 PM   #21
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Original Poster
Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by WhiteWolf1776 View Post
pair... works... then turn the device off... turn the device on... it won't hook back in without removing and redoing the pair.
I have tested this and very clearly found it to not be the case. 14.1 stock kernel, stock dbus, Bluez 5.28.

Maybe PhantomX's SlackBuilds have tweaked things correctly? He applies several patches, and one is a patch to adjust the dbus settings.

The following is bluetoothctl output from doing the following: starting bluetoothctl, holding down my Dualshock 4's PS button, telling my computer to disconnect it, holding down the PS button again, and then telling my computer to disconnect it again:

Code:
dugan@t23 ~> bluetoothctl
[NEW] Controller 00:1F:E2:E3:A4:07 %h-%d [default]
[NEW] Device 84:17:66:DB:AA:57 Wireless Controller
[CHG] Device 84:17:66:DB:AA:57 Connected: yes
[bluetooth]# disconnect 84:17:66:DB:AA:57
Attempting to disconnect from 84:17:66:DB:AA:57
Successful disconnected
[CHG] Device 84:17:66:DB:AA:57 Connected: no
[CHG] Device 84:17:66:DB:AA:57 Connected: yes
[bluetooth]# disconnect 84:17:66:DB:AA:57
Attempting to disconnect from 84:17:66:DB:AA:57
Successful disconnected
[CHG] Device 84:17:66:DB:AA:57 Connected: no
[bluetooth]#
The time between holding down the PS button and getting the connection was roughly one second, each time.

Last edited by dugan; 02-22-2015 at 03:22 PM.
 
Old 06-07-2015, 01:43 PM   #22
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Original Poster
Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
The following SlackBuild works for me. Slackware 14.1, stock dbus-1.6.12, custom 3.18.10-smp kernel.

I tested it as far as being able to pair and use my Dualshock 4 controller.

Disconnecting the device and reconnecting it (see post #21) works fine. I checked. Again. I'm actually starting to think that the reason WhiteWolf1776 got the behavior he reported was because he forgot to enter agent on and default-agent in bluetoothctl before trying to connect the device. That actually does need to be done each boot.

One weird thing is that I can't run hcitool lescan:

Code:
# hcitool lescan
Set scan parameters failed: Input/output error
In any case, this fits my personal standards for "usable":

Code:
#!/bin/sh

# Slackware build script for bluez - http://www.bluez.org

# Copyright 2009, 2010, 2011, 2012, 2013  Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

set -e

PKGNAM=bluez
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) export ARCH=i486 ;;
    arm*) export ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
       *) export ARCH=$( uname -m ) ;;
  esac
fi

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "s390" ]; then
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM

rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
rm -rf $PKGNAM-$VERSION
tar xvf $CWD/${PKGNAM}-${VERSION}.tar.xz 
cd $PKGNAM-$VERSION

chown -R root:root .
find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  -exec chmod 755 {} \; -o \
  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  -exec chmod 644 {} \;

sed -i -e 's|-lreadline|\0 -lncursesw|g' Makefile.{in,tools}

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc \
  --mandir=/usr/man \
  --localstatedir=/var \
  --enable-library \
  --disable-systemd \
  --build=$ARCH-slackware-linux
make 
make install DESTDIR=$PKG || exit 1

# Compress and if needed symlink the man pages:
if [ -d $PKG/usr/man ]; then
  ( cd $PKG/usr/man
    for manpagedir in $(find . -type d -name "man*") ; do
      ( cd $manpagedir
        for eachpage in $( find . -type l -maxdepth 1) ; do
          ln -s $( readlink $eachpage ).gz $eachpage.gz
          rm $eachpage
        done
        gzip -9 *.?
      )
    done
  )
fi

find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null

mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
cp -a \
  AUTHORS COPYING* INSTALL NEWS README* \
  $PKG/usr/doc/$PKGNAM-$VERSION

# If there's a ChangeLog, installing at least part of the recent history
# is useful, but don't let it get totally out of control:
if [ -r ChangeLog ]; then
  DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
  touch -r ChangeLog $DOCSDIR/ChangeLog
fi

cd $PKG
/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz

Last edited by dugan; 06-07-2015 at 04:56 PM.
 
Old 06-07-2015, 02:48 PM   #23
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Original Poster
Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
And here's a working rc.bluetooth file, adapted from blfs:

Code:
#!/bin/sh
########################################################################
# Begin bluetooth
#
# Description : BlueZ Boot Script
#
# Authors     : Armin K. <krejzi@email.com>
#
# Version     : BLFS SVN
#
# Notes       : Rewritten May 29, 2014 for bluez-5 by 
#               Bruce Dubbs <bdubbs@linuxfromscratch.org>
#
########################################################################

### BEGIN INIT INFO
# Provides:            bluetooth
# Required-Start:      $local_fs $syslog dbus
# Required-Stop:       $local_fs $syslog
# Default-Start:       2 3 4 5
# Default-Stop:        0 1 6
# Short-Description:   Starts bluetooth daemons
# X-LFS-Provided-By:   BLFS
### END INIT INFO

# A space delimied list of devices to start at boot time
ACTIVE_HCI_DEVICES_ON_BOOT="hci0"

# A semicolon delimited list of SDP (Service Discovery Protocol)
# operations for bluetooth devices.  See the sdptool for more
# details.
SDPTOOL_OPTIONS=""


BLUETOOTH=/usr/libexec/bluetooth/bluetoothd
SDPTOOL=/usr/bin/sdptool
HCIATTACH=/usr/bin/hciattach
RFCOMM=/usr/bin/rfcomm

UART_CONF=/etc/bluetooth/uart.conf
RFCOMM_CONF=/etc/bluetooth/rfcomm.conf

start_hci_dev()
{
   for dev in ${ACTIVE_HCI_DEVICES_ON_BOOT} ; do
      hciconfig $dev up > /dev/null 2>&1 
   done
}

run_sdptool()
{
   # Declaring IFS local in this function, removes the need to
   # save/restore it
   local IFS option

   test -x $SDPTOOL || return 1

   IFS=";"
   for option in ${SDPTOOL_OPTIONS}; do
      IFS=" "
      $SDPTOOL $option > /dev/null 2>&1
   done
}

start_uarts()
{
   [ -x $HCIATTACH ] && [ -f $UART_CONF ] || return

   grep -v '^[[:space:]]*(#|$)' $UART_CONF | while read i; do
      $HCIATTACH $i > /dev/null 2>&1
   done
}

stop_uarts()
{
   [ -x $HCIATTACH ] || return
   killall $HCIATTACH > /dev/null 2>&1 
}

start_rfcomm()
{
   [ -x $RFCOMM ] && [ -f $RFCOMM_CONF ]  || return 

   $RFCOMM -f $RFCOMM_CONF bind all > /dev/null 2>&1 || :
}

stop_rfcomm()
{
   [ -x $RFCOMM ] || return
   $RFCOMM unbind all > /dev/null 2>&1 
}

case "${1}" in
   start)
      echo Starting Bluetooth daemon bluetoothd...

      # Start as background process and assume OK
      $BLUETOOTH &

      start_hci_dev
      run_sdptool
      start_uarts
      start_rfcomm
      ;;

   stop)
      stop_rfcomm
      stop_uarts

      echo Stopping Bluetooth daemon bluetoothd...
	  killall bluetoothd
      ;;

   restart)
      ${0} stop
      sleep 1
      ${0} start
      ;;

   *)
      echo "Usage: ${0} {start|stop|restart|status}"
      exit 1
      ;;
esac

exit 0

# End bluetooth
 
Old 06-07-2015, 04:46 PM   #24
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Original Poster
Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
The following is a serious attempt at a usable Bluez 5 SlackBuild. Tests, feedback and (especially) recommendations are welcome.

On my T400, starting /etc/rc.d/rc.bluetooth for the first time prints out the following:

Code:
D-Bus setup failed: Name already in use
As far as I can tell, that's harmless, and everything works anyway.

As with all my SlackBuilds, you just run it. It will download the source. By the time you read this you might also want to adjust the VERSION. All supporting files (rc.bluetooth, slack-desc, doinst.sh, etc) are in heredocs in the SlackBuild itself.

Code:
#!/bin/sh

# Slackware build script for bluez - http://www.bluez.org

# Copyright 2009, 2010, 2011, 2012, 2013  Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

set -e

PKGNAM=bluez
VERSION=${VERSION:-5.30}
BUILD=${BUILD:-1}

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) export ARCH=i486 ;;
    arm*) export ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
       *) export ARCH=$( uname -m ) ;;
  esac
fi

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "s390" ]; then
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM

rm -rf $TMP/$PKGNAM-$VERSION
cd $TMP
wget http://www.kernel.org/pub/linux/bluetooth/${PKGNAM}-${VERSION}.tar.xz

rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
rm -rf $PKGNAM-$VERSION
tar xvf $TMP/${PKGNAM}-${VERSION}.tar.xz 
cd $PKGNAM-$VERSION

chown -R root:root .
find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  -exec chmod 755 {} \; -o \
  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  -exec chmod 644 {} \;

sed -i -e 's|-lreadline|\0 -lncursesw|g' Makefile.{in,tools}

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc \
  --mandir=/usr/man \
  --localstatedir=/var \
  --enable-library \
  --disable-systemd \
  --build=$ARCH-slackware-linux
make 
make install DESTDIR=$PKG || exit 1

# Add bluetoothd to /usr/sbin
mkdir -p $PKG/usr/sbin
(
cd $PKG/usr/sbin
ln -s ../libexec/bluetooth/bluetoothd
)

# Install the main configuration file.
mkdir -p $PKG/etc/bluetooth
install -m644 src/main.conf $PKG/etc/bluetooth/main.conf.new

# Add an init script
mkdir -p $PKG/etc/rc.d
cat << EOF > $PKG/etc/rc.d/rc.bluetooth.new
#!/bin/sh
########################################################################
# Begin bluetooth
#
# Description : BlueZ Boot Script
#
# Authors     : Armin K. <krejzi@email.com>
#
# Version     : BLFS SVN
#
# Notes       : Rewritten May 29, 2014 for bluez-5 by 
#               Bruce Dubbs <bdubbs@linuxfromscratch.org>
#
########################################################################

### BEGIN INIT INFO
# Provides:            bluetooth
# Required-Start:      \$local_fs \$syslog dbus
# Required-Stop:       \$local_fs \$syslog
# Default-Start:       2 3 4 5
# Default-Stop:        0 1 6
# Short-Description:   Starts bluetooth daemons
# X-LFS-Provided-By:   BLFS
### END INIT INFO

# A space delimied list of devices to start at boot time
ACTIVE_HCI_DEVICES_ON_BOOT="hci0"

# A semicolon delimited list of SDP (Service Discovery Protocol)
# operations for bluetooth devices.  See the sdptool for more
# details.
SDPTOOL_OPTIONS=""


BLUETOOTH=/usr/sbin/bluetoothd
SDPTOOL=/usr/bin/sdptool
HCIATTACH=/usr/bin/hciattach
RFCOMM=/usr/bin/rfcomm

UART_CONF=/etc/bluetooth/uart.conf
RFCOMM_CONF=/etc/bluetooth/rfcomm.conf

start_hci_dev()
{
   for dev in \${ACTIVE_HCI_DEVICES_ON_BOOT} ; do
      hciconfig \$dev up > /dev/null 2>&1 
   done
}

run_sdptool()
{
   # Declaring IFS local in this function, removes the need to
   # save/restore it
   local IFS option

   test -x \$SDPTOOL || return 1

   IFS=";"
   for option in \${SDPTOOL_OPTIONS}; do
      IFS=" "
      \$SDPTOOL \$option > /dev/null 2>&1
   done
}

start_uarts()
{
   [ -x \$HCIATTACH ] && [ -f \$UART_CONF ] || return

   grep -v '^[[:space:]]*(#|$)' \$UART_CONF | while read i; do
      \$HCIATTACH \$i > /dev/null 2>&1
   done
}

stop_uarts()
{
   [ -x \$HCIATTACH ] || return
   killall \$HCIATTACH > /dev/null 2>&1 
}

start_rfcomm()
{
   [ -x \$RFCOMM ] && [ -f \$RFCOMM_CONF ]  || return 

   \$RFCOMM -f \$RFCOMM_CONF bind all > /dev/null 2>&1 || :
}

stop_rfcomm()
{
   [ -x \$RFCOMM ] || return
   \$RFCOMM unbind all > /dev/null 2>&1 
}

case "\${1}" in
   start)
      echo Starting Bluetooth daemon bluetoothd...

      # Start as background process and assume OK
      \$BLUETOOTH &

      start_hci_dev
      run_sdptool
      start_uarts
      start_rfcomm
      ;;

   stop)
      stop_rfcomm
      stop_uarts

      echo Stopping Bluetooth daemon bluetoothd...
	  killall bluetoothd
      ;;

   restart)
      \${0} stop
      sleep 1
      \${0} start
      ;;

   *)
      echo "Usage: \${0} {start|stop|restart|status}"
      exit 1
      ;;
esac

exit 0

# End bluetooth
EOF

# Compress and if needed symlink the man pages:
if [ -d $PKG/usr/man ]; then
  ( cd $PKG/usr/man
    for manpagedir in $(find . -type d -name "man*") ; do
      ( cd $manpagedir
        for eachpage in $( find . -type l -maxdepth 1) ; do
          ln -s $( readlink $eachpage ).gz $eachpage.gz
          rm $eachpage
        done
        gzip -9 *.?
      )
    done
  )
fi

find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null

mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
cp -a \
  AUTHORS COPYING* INSTALL README* TODO \
  $PKG/usr/doc/$PKGNAM-$VERSION

# If there's a ChangeLog, installing at least part of the recent history
# is useful, but don't let it get totally out of control:
if [ -r ChangeLog ]; then
  DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
  touch -r ChangeLog $DOCSDIR/ChangeLog
fi

mkdir -p $PKG/install

cat << EOF > $PKG/install/doinst.sh
config() {
  NEW="\$1"
  OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r \$OLD ]; then
    mv \$NEW \$OLD
  elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then # toss the redundant copy
    rm \$NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}

# Keep same perms on rc.bluetooth.new:
if [ -e etc/rc.d/rc.bluetooth ]; then
  cp -a etc/rc.d/rc.bluetooth etc/rc.d/rc.bluetooth.new.incoming
  cat etc/rc.d/rc.bluetooth.new > etc/rc.d/rc.bluetooth.new.incoming
  mv etc/rc.d/rc.bluetooth.new.incoming etc/rc.d/rc.bluetooth.new
fi

config etc/rc.d/rc.bluetooth.new
config etc/bluetooth/main.conf.new
EOF

cat << EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.  Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in.  You must
# make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':'.

     |-----handy-ruler------------------------------------------------------|
bluez: bluez (Bluetooth libraries and utilities)
bluez:
bluez: Bluez is the Bluetooth stack for Linux, allowing Bluetooth adaptors
bluez: and devices to be used with Linux.  This package contains the Bluez
bluez: libraries, utilities, and other support files.
bluez: 
bluez: For more info, visit:  http://www.bluez.org
bluez:
bluez:
bluez:
bluez:
EOF

cd $PKG
/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz

Last edited by dugan; 06-07-2015 at 04:48 PM.
 
Old 06-11-2015, 12:52 AM   #25
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Original Poster
Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Work on my Bluez 5 SlackBuild will be continued here.

https://github.com/duganchen/my_slac...e/master/bluez

It's about as good as it's going to be at this point. I've tested it by trying to connect a DualShock 4 and a Wii-U Pro Controller to my T400, and they both work really well. With the DualShock 4, all I had to do was pair it (it then connected), and with the Wii-U Pro controller the sequence was pair, then trust, then connect.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bluez stanley82 Programming 0 11-12-2013 06:45 AM
Rfcomm bluez J_Szucs Linux - Networking 9 05-12-2010 03:18 PM
BlueZ 3 or 4? simopal6 Linux - Software 1 02-03-2009 05:10 PM
How to compile/use bluez-4.1?? fmillion Linux - Software 3 08-29-2008 12:36 PM
Bluez????? abhay7182 Linux - Laptop and Netbook 0 08-20-2004 05:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration