author | Sundeep Mandava <x0073106@ti.com> | |
Fri, 16 Jan 2015 11:43:19 +0000 (17:13 +0530) | ||
committer | Sundeep Mandava <x0073106@ti.com> | |
Fri, 16 Jan 2015 11:43:19 +0000 (17:13 +0530) |
Signed-off-by: Sundeep Mandava <x0073106@ti.com>
27 files changed:
diff --git a/BlueZ_4.98_wl18xx_build_bt_for_SDK7.sh b/BlueZ_4.98_wl18xx_build_bt_for_SDK7.sh
--- /dev/null
@@ -0,0 +1,408 @@
+#!/bin/bash
+
+# \\\//
+# -(o o)-
+#========================oOO==(_)==OOo=======================
+#
+# This file contains the Bluetooth components which should
+# be built and installed on the target filesystem
+#
+
+BUILD_VERSION="r8"
+#declare -A compat_bluetooth["r8"]="https://gforge.ti.com/gf/download/frsrelease/990/6319/compat-bluetooth-ol-r8.a5.01_Nov_12_2012.tar.gz"
+
+function usage()
+{
+ echo
+ echo
+ echo "************************************"
+ echo "* Bluetooth Modules Builder Script *"
+ echo "************************************"
+ echo
+ echo "This script compiles the BT modules components"
+ echo "The script can build each component as standalone by invoking: \"./wl18xx_build_bt.sh <module name> <build/rebuild>\""
+ echo "For example: \"./wl12xx_build_bt.sh bt-modules rebuild\""
+ echo
+ echo "Available components are:"
+ echo "bt-modules, bluez, hcidump, obexd, bt-obex, firmware, wl1271-demo"
+ echo
+ echo "You may also build all components by typing: \"./wl18xx_build_bt.sh all build\""
+ echo
+ echo "Prerequisites"
+ echo "============="
+ echo "The following variables should be exported in order to run the script:"
+ echo "1) ROOTFS - should point to the root filesystem where the BT components will be installed"
+ echo "2) WORK_SPACE - should point to the workspace where the components will be downloaded and compiled"
+ echo "3) KLIB_BUILD - should point to the kernel which the compat bluetooth will be compiled against."
+ echo "4) Path to cross compiler in PATH"
+ echo ""
+}
+
+function all()
+{
+ get_machine_used
+ #bt-modules 1
+ #uim 1
+ expat 1
+ libffi
+ glib 1
+ dbus 1
+ libIConv 1
+ zlib 1
+ gettext 1
+ alsa-lib 1
+ dbus-glib 1
+ check 1
+ python 1
+ pygobject 1
+ dbus-python 1
+ bluez 1
+ hcidump 1
+ ncurses 1
+ readline 1
+ openobex 1
+ libical 1
+ obexd 1
+ bt-obex 1
+ firmware 1
+ wl1271-demo 1
+}
+
+function apply_patches()
+{
+ [ ! -e $LS ] && echo "Please set full path of ls utility in setup-env file." && exit 1
+ files=`$LS *.patch`
+ for f in ${files}; do patch -p1 -i ${f} || exit 1; done
+ return 0
+}
+
+function alsa-lib
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="alsa-lib-1.0.27.2.tar.gz"
+ COMPONENT_DIR="alsa-lib-1.0.27.2"
+ download_component "http://fossies.org/linux/misc/alsa-lib-1.0.27.2.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --prefix=${MY_PREFIX} --host=${BUILD_HOST} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --disable-python || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "alsa-lib built successfully"
+}
+
+#compat
+function bluez()
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="bluez-4.98"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ check
+ dbus
+ glib
+ #uim
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bluez-4.98.tar.gz"
+ #COMPONENT_REV="18a5dc6cdcf0828443c415eaea82b6834a8f9825"
+ COMPONENT_DIR="bluez-4.98"
+ download_component "http://kernel.org/pub/linux/bluetooth/bluez-4.98.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ patch -p1 -i ${old_dir}/patches/0003-socket-enable-for-bluez-4_98.patch || exit 1
+ patch -p1 -i ${old_dir}/patches/0004-bluez-enable-source-interface.patch || exit 1
+
+ LIBS='-liconv' ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --enable-alsa --enable-tools --enable-test --enable-audio --enable-serial --enable-service --enable-gstreamer --enable-usb --enable-tools --enable-bccmd --enable-hid2hci --enable-dfutool --enable-pand --disable-cups --enable-debug --enable-gatt --enable-hid2hci --enable-health
+ make LIBS='-lffi' || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ cp audio/audio.conf input/input.conf ${ROOTFS}${MY_SYSCONFDIR}/bluetooth/ || exit 1
+ cp test/agent ${ROOTFS}${MY_PREFIX}/bin/agent || exit 1
+ mkdir -p ${ROOTFS}/usr/share/bluetooth
+
+ cd test
+ list='simple-agent list-devices simple-service test-adapter test-attrib test-audio test-device test-discovery test-health test-health-sink test-input test-manager test-network test-oob test-proximity test-sap-server test-service test-telephony test-textfile test-thermometer uuidtest rctest monitor-bluetooth mpris-player lmptest gaptest hciemu hsmicro hsplay hstest l2test attest avtest bdaddr btiotest'
+ echo "installing tests in ${ROOTFS}/usr/share/bluetooth"
+ cp ${list} ${ROOTFS}/usr/share/bluetooth
+ cd -
+ add_fingerprint 1
+ fi
+ echo "bluez built successfully"
+}
+
+function hcidump
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bluez-hcidump-2.4.tar.gz"
+ COMPONENT_DIR="bluez-hcidump-2.4"
+ download_component "http://www.kernel.org/pub/linux/bluetooth/bluez-hcidump-2.4.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ patch -p1 -i ${old_dir}/patches/0001-blueti-Add-TI-Logger-dump.patch || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "hcidump built successfully"
+}
+
+function ncurses
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="ncurses-5.9.tar.gz"
+ COMPONENT_DIR="ncurses-5.9"
+ download_component "http://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} -with-shared --without-debug --without-normal || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "ncurses built successfully"
+}
+
+function readline
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="readline-6.2.tar.gz"
+ COMPONENT_DIR="readline-6.2"
+ download_component "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "readline built successfully"
+}
+
+
+function openobex
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="openobex-1.5.tar.gz"
+ COMPONENT_DIR="openobex-1.5"
+ download_component "http://ftp.osuosl.org/pub/linux/bluetooth/openobex-1.5.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ # wget 'http://mirror.anl.gov/pub/linux/bluetooth/openobex-1.5.tar.gz' || exit 1
+ add_fingerprint 0
+ sed -i '11227 i *)\n;;' configure || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --enable-apps --disable-usb || exit 1
+ sed -i 's/^\(libdir=\).*/\1\$\{prefix\}\/lib/g' openobex.pc || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "openobex built successfully"
+}
+
+function libical
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="libical-0.44.tar.gz"
+ COMPONENT_DIR="libical-0.44"
+ download_component "http://downloads.sourceforge.net/project/freeassociation/libical/libical-0.44/libical-0.44.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "libical built successfully"
+}
+
+function obexd
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="obexd-0.34.tar.gz"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ bluez
+ libical
+ readline
+ ncurses
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="obexd-0.34.tar.gz"
+ COMPONENT_DIR="obexd-0.34"
+ download_component "http://www.kernel.org/pub/linux/bluetooth/obexd-0.34.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} || exit 1
+ #wget http://processors.wiki.ti.com/images/4/43/Obexd-patches_v1.tar.gz || exit 1
+ #echo "Openning archive: Obexd-patches_v1.tar.gz" && tar -xzf Obexd-patches_v1.tar.gz || exit 1
+ apply_patches
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ test -d ${ROOTFS}/usr/share/bluetooth || mkdir -p ${ROOTFS}/usr/share/bluetooth
+ list='exchange-business-cards ftp-client list-folders pbap-client send-files'
+ for f in ${list}; do
+ install -c test/$f ${ROOTFS}/usr/share/bluetooth || exit 1
+ done
+ add_fingerprint 1
+ fi
+ echo "obexd built successfully"
+}
+
+function bt-obex
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="bluez-tools"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ dbus-glib
+ readline
+ ncurses
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bluez-tools"
+ COMPONENT_REV="171181b6ef6c94aefc828dc7fd8de136b9f97532"
+ COMPONENT_DIR="bluez-tools"
+ download_component "git://gitorious.org/bluez-tools/bluez-tools.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ #[ ! -e Bt-obex-patches.zip ] && { wget 'http://processors.wiki.ti.com/images/f/f5/Bt-obex-patches.zip' || exit 1; }
+ #unzip -o Bt-obex-patches.zip || exit 1
+ apply_patches
+ #patch -p1 -i ${old_dir}/patches/0001-bt-obex-new-dbus-api-for-obexd.patch
+ #patch -p1 -i ${old_dir}/patches/0001-manager-adoptation-to-new-manager-interface-of-bluez.patch
+
+ /usr/bin/libtoolize || exit 1
+ /usr/bin/aclocal || exit 1
+ /usr/bin/autoheader || exit 1
+ /usr/bin/automake --add-missing || exit 1
+ /usr/bin/autoconf || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} || exit 1
+ make LIBS="-ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0 -liconv -lffi -lz -lncurses" || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "bt-obex built successfully"
+}
+
+function wl1271-demo
+{
+ START_MODULE="wl1271-bluetooth"
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="wl1271-bluetooth"
+ COMPONENT_DIR="wl1271-bluetooth"
+ COMPONENT_REV="ae9a9a961dd9821d30a0b9c32612f3a552c81d4e"
+ download_component "git://github.com/TI-ECS/wl1271-bluetooth.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/gallery || exit 1
+ mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1
+ mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/ftp_folder || exit 1
+
+ if [ x"$MACHINE_TYPE" = "x" ]; then
+ get_machine_used
+ fi
+
+ cp ./gallery/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/gallery || exit 1
+ cp ./script/common/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1
+ cp ./script/${MACHINE_TYPE}/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1
+ cp ./ftp_folder/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/ftp_folder || exit 1
+ add_fingerprint 1
+ fi
+ echo "wl1271-demo built successfully"
+}
+
+function bt-enable
+{
+ cd ${WORK_SPACE} || exit 1
+ if [ x"$KLIB_BUILD" = "x" ]; then
+ echo "Please set KLIB_BUILD variable to point to your Linux kernel"
+ exit 1
+ fi
+ COMPONENT_NAME="bt_enable"
+ COMPONENT_REV="dd75971705ada8fb0e88a0fb3f68833086c5bba4"
+ COMPONENT_DIR="bt_enable"
+ download_component "git://github.com/TI-ECS/bt_enable.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ [ ! -e Bt-enable-standalone-makefile.zip ] && { wget 'http://processors.wiki.ti.com/images/8/8f/Bt-enable-standalone-makefile.zip' || exit 1; }
+ unzip -o Bt-enable-standalone-makefile.zip || exit 1
+ apply_patches
+
+ if [ x"$MACHINE_TYPE" = "x" ]; then
+ get_machine_used
+ fi
+ cp ./gpio_en_${MACHINE_TYPE}.c ./gpio_en.c
+ make DEST_DIR=${ROOTFS} KERNEL_DIR=${KLIB_BUILD} || exit 1
+ make DEST_DIR=${ROOTFS} KERNEL_DIR=${KLIB_BUILD} install || exit 1
+ add_fingerprint 1
+ fi
+ echo "bt-enable built successfully"
+}
+
+#==================================================================================
+# Main
+#==================================================================================
+old_dir=`pwd`
+MACHINE_TYPE=""
+
+source setup-env || exit 1
+source ./functions/common-functions
+# if there are no sufficient arguments...
+if [ $# -lt 2 ]; then
+ usage
+ exit 0
+fi
+
+if [ x"$CROSS_COMPILE" = "x" ]; then
+ echo "define CROSS_COMPILE variable"
+ exit 1
+fi
+
+which ${CROSS_COMPILE}gcc > /dev/null
+
+if [ $? -ne 0 ]; then
+ echo "No toolchain in path"
+ exit 1
+fi
+
+
+if [ x"$ROOTFS" = "x" ]; then
+ echo "Please set ROOTFS variable to point to your root filesystem"
+ exit 1
+fi
+
+if [ x"$WORK_SPACE" = "x" ]; then
+ echo "Please set WORK_SPACE variable to point to your preferred work space"
+ exit 1
+fi
+
+FINGURE_PRINT_DIR="${WORK_SPACE}/.FingurePrint"
+mkdir -p ${FINGURE_PRINT_DIR} || exit 1
+
+USER_OPTION=0
+CURRENT_OPTION=0
+
+case "$2" in
+ build)
+ USER_OPTION=1
+ ;;
+ rebuild)
+ USER_OPTION=2
+ ;;
+ *)
+ echo "Unknown option $2"
+ exit 1
+ ;;
+esac
+
+CURRENT_OPTION=${USER_OPTION}
+
+MODULE_TO_INVOKE=$1
+$MODULE_TO_INVOKE 1
+
+cd ${old_dir}
diff --git a/BlueZ_5.19_wl18xx_build_bt_for_SDK7.sh b/BlueZ_5.19_wl18xx_build_bt_for_SDK7.sh
--- /dev/null
@@ -0,0 +1,413 @@
+#!/bin/bash
+
+# \\\//
+# -(o o)-
+#========================oOO==(_)==OOo=======================
+#
+# This file contains the Bluetooth components which should
+# be built and installed on the target filesystem
+#
+
+BUILD_VERSION="r8"
+#declare -A compat_bluetooth["r8"]="https://gforge.ti.com/gf/download/frsrelease/990/6319/compat-bluetooth-ol-r8.a5.01_Nov_12_2012.tar.gz"
+
+function usage()
+{
+ echo
+ echo
+ echo "************************************"
+ echo "* Bluetooth Modules Builder Script *"
+ echo "************************************"
+ echo
+ echo "This script compiles the BT modules components"
+ echo "The script can build each component as standalone by invoking: \"./wl18xx_build_bt.sh <module name> <build/rebuild>\""
+ echo "For example: \"./wl12xx_build_bt.sh bt-modules rebuild\""
+ echo
+ echo "Available components are:"
+ echo "bt-modules, bluez, hcidump, obexd, bt-obex, firmware, wl1271-demo"
+ echo
+ echo "You may also build all components by typing: \"./wl18xx_build_bt.sh all build\""
+ echo
+ echo "Prerequisites"
+ echo "============="
+ echo "The following variables should be exported in order to run the script:"
+ echo "1) ROOTFS - should point to the root filesystem where the BT components will be installed"
+ echo "2) WORK_SPACE - should point to the workspace where the components will be downloaded and compiled"
+ echo "3) KLIB_BUILD - should point to the kernel which the compat bluetooth will be compiled against."
+ echo "4) Path to cross compiler in PATH"
+ echo ""
+}
+
+function all()
+{
+ get_machine_used
+ #bt-modules 1
+ #uim 1
+ expat 1
+ libffi
+ glib 1
+ dbus 1
+ libIConv 1
+ zlib 1
+ gettext 1
+ alsa-lib 1
+ dbus-glib 1
+ check 1
+ python 1
+ pygobject 1
+ dbus-python 1
+ bluez 1
+ hcidump 1
+ ncurses 1
+ readline 1
+ openobex 1
+ udev 1
+ libical 1
+ obexd 1
+ bt-obex 1
+ firmware 1
+ wl1271-demo 1
+}
+
+function apply_patches()
+{
+ [ ! -e $LS ] && echo "Please set full path of ls utility in setup-env file." && exit 1
+ files=`$LS *.patch`
+ for f in ${files}; do patch -p1 -i ${f} || exit 1; done
+ return 0
+}
+
+function alsa-lib
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="alsa-lib-1.0.27.2.tar.gz"
+ COMPONENT_DIR="alsa-lib-1.0.27.2"
+ download_component "http://fossies.org/linux/misc/alsa-lib-1.0.27.2.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --prefix=${MY_PREFIX} --host=${BUILD_HOST} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --disable-python || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "alsa-lib built successfully"
+}
+
+#compat
+function bluez()
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="bluez-5.19"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ check
+ dbus
+ glib
+ libical
+ #uim
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bluez-5.19.tar.gz"
+ #COMPONENT_REV="18a5dc6cdcf0828443c415eaea82b6834a8f9825"
+ COMPONENT_DIR="bluez-5.19"
+ download_component "http://kernel.org/pub/linux/bluetooth/bluez-5.19.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ /usr/bin/libtoolize || exit 1
+ LIBS='-liconv' ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --enable-alsa --enable-tools --enable-test --enable-audio --enable-serial --enable-service --enable-gstreamer --enable-usb --enable-tools --enable-bccmd --enable-hid2hci --enable-dfutool --enable-pand --disable-cups --enable-debug --enable-gatt --enable-hid2hci --enable-health --disable-udev --disable-systemd --disable-obex --enable-library
+ make LIBS='-lffi' LIBS='-lncurses'|| exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+
+ #make || exit 1
+ #make install DESTDIR=${ROOTFS} || exit 1
+ #rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ #cp audio/audio.conf input/input.conf ${ROOTFS}${MY_SYSCONFDIR}/bluetooth/ || exit 1
+ #cp test/agent ${ROOTFS}${MY_PREFIX}/bin/agent || exit 1
+ mkdir -p ${ROOTFS}/usr/share/bluetooth
+
+ cd test
+ list='ftp-client list-devices map-client monitor-bluetooth opp-client pbap-client simple-agent simple-endpoint simple-player test-adapter test-alert test-cyclingspeed test-device test-discovery test-health test-health-sink test-heartrate test-hfp test-manager test-nap test-network test-profile test-proximity test-sap-server test-thermometer'
+ echo "installing tests in ${ROOTFS}/usr/share/bluetooth"
+ cp ${list} ${ROOTFS}/usr/share/bluetooth
+ cd -
+ add_fingerprint 1
+ fi
+ echo "bluez built successfully"
+}
+
+function hcidump
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bluez-hcidump-2.4.tar.gz"
+ COMPONENT_DIR="bluez-hcidump-2.4"
+ download_component "http://www.kernel.org/pub/linux/bluetooth/bluez-hcidump-2.4.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ patch -p1 -i ${old_dir}/patches/0001-blueti-Add-TI-Logger-dump.patch || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "hcidump built successfully"
+}
+
+function ncurses
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="ncurses-5.9.tar.gz"
+ COMPONENT_DIR="ncurses-5.9"
+ download_component "http://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} -with-shared --without-debug --without-normal || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "ncurses built successfully"
+}
+
+function readline
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="readline-6.2.tar.gz"
+ COMPONENT_DIR="readline-6.2"
+ download_component "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "readline built successfully"
+}
+
+
+function openobex
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="openobex-1.5.tar.gz"
+ COMPONENT_DIR="openobex-1.5"
+ download_component "http://pkgs.fedoraproject.org/repo/pkgs/openobex/openobex-1.5.tar.gz/0d83dc86445a46a1b9750107ba7ab65c/openobex-1.5.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ # wget 'http://mirror.anl.gov/pub/linux/bluetooth/openobex-1.5.tar.gz' || exit 1
+ add_fingerprint 0
+ sed -i '11227 i *)\n;;' configure || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --enable-apps --disable-usb || exit 1
+ sed -i 's/^\(libdir=\).*/\1\$\{prefix\}\/lib/g' openobex.pc || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "openobex built successfully"
+}
+
+function libical
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="libical-1.0.tar.gz"
+ COMPONENT_DIR="libical-1.0"
+ download_component "http://sourceforge.net/projects/freeassociation/files/libical/libical-1.0/libical-1.0.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ /usr/bin/libtoolize || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "libical built successfully"
+}
+
+function obexd
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="obexd-0.34.tar.gz"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ bluez
+ libical
+ readline
+ ncurses
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="obexd-0.34.tar.gz"
+ COMPONENT_DIR="obexd-0.34"
+ download_component "http://www.kernel.org/pub/linux/bluetooth/obexd-0.34.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} || exit 1
+ #wget http://processors.wiki.ti.com/images/4/43/Obexd-patches_v1.tar.gz || exit 1
+ #echo "Openning archive: Obexd-patches_v1.tar.gz" && tar -xzf Obexd-patches_v1.tar.gz || exit 1
+ #apply_patches
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ test -d ${ROOTFS}/usr/share/bluetooth || mkdir -p ${ROOTFS}/usr/share/bluetooth
+ list='exchange-business-cards ftp-client list-folders pbap-client send-files'
+ for f in ${list}; do
+ install -c test/$f ${ROOTFS}/usr/share/bluetooth || exit 1
+ done
+ add_fingerprint 1
+ fi
+ echo "obexd built successfully"
+}
+
+function bt-obex
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="bluez-tools"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ dbus-glib
+ readline
+ ncurses
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bluez-tools"
+ COMPONENT_REV="171181b6ef6c94aefc828dc7fd8de136b9f97532"
+ COMPONENT_DIR="bluez-tools"
+ download_component "git://gitorious.org/bluez-tools/bluez-tools.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ #[ ! -e Bt-obex-patches.zip ] && { wget 'http://processors.wiki.ti.com/images/f/f5/Bt-obex-patches.zip' || exit 1; }
+ #unzip -o Bt-obex-patches.zip || exit 1
+ #apply_patches
+ #patch -p1 -i ${old_dir}/patches/0001-bt-obex-new-dbus-api-for-obexd.patch
+ #patch -p1 -i ${old_dir}/patches/0001-manager-adoptation-to-new-manager-interface-of-bluez.patch
+
+ /usr/bin/libtoolize || exit 1
+ /usr/bin/aclocal || exit 1
+ /usr/bin/autoheader || exit 1
+ /usr/bin/automake --add-missing || exit 1
+ /usr/bin/autoconf || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} || exit 1
+ make LIBS="-ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0 -liconv -lffi -lz -lncurses" || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "bt-obex built successfully"
+}
+
+function wl1271-demo
+{
+ START_MODULE="wl1271-bluetooth"
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="wl1271-bluetooth"
+ COMPONENT_DIR="wl1271-bluetooth"
+ COMPONENT_REV="ae9a9a961dd9821d30a0b9c32612f3a552c81d4e"
+ download_component "git://github.com/TI-ECS/wl1271-bluetooth.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/gallery || exit 1
+ mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1
+ mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/ftp_folder || exit 1
+
+ if [ x"$MACHINE_TYPE" = "x" ]; then
+ get_machine_used
+ fi
+
+ cp ./gallery/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/gallery || exit 1
+ cp ./script/common/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1
+ cp ./script/${MACHINE_TYPE}/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1
+ cp ./ftp_folder/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/ftp_folder || exit 1
+ add_fingerprint 1
+ fi
+ echo "wl1271-demo built successfully"
+}
+
+function bt-enable
+{
+ cd ${WORK_SPACE} || exit 1
+ if [ x"$KLIB_BUILD" = "x" ]; then
+ echo "Please set KLIB_BUILD variable to point to your Linux kernel"
+ exit 1
+ fi
+ COMPONENT_NAME="bt_enable"
+ COMPONENT_REV="dd75971705ada8fb0e88a0fb3f68833086c5bba4"
+ COMPONENT_DIR="bt_enable"
+ download_component "git://github.com/TI-ECS/bt_enable.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ [ ! -e Bt-enable-standalone-makefile.zip ] && { wget 'http://processors.wiki.ti.com/images/8/8f/Bt-enable-standalone-makefile.zip' || exit 1; }
+ unzip -o Bt-enable-standalone-makefile.zip || exit 1
+ apply_patches
+
+ if [ x"$MACHINE_TYPE" = "x" ]; then
+ get_machine_used
+ fi
+ cp ./gpio_en_${MACHINE_TYPE}.c ./gpio_en.c
+ make DEST_DIR=${ROOTFS} KERNEL_DIR=${KLIB_BUILD} || exit 1
+ make DEST_DIR=${ROOTFS} KERNEL_DIR=${KLIB_BUILD} install || exit 1
+ add_fingerprint 1
+ fi
+ echo "bt-enable built successfully"
+}
+
+#==================================================================================
+# Main
+#==================================================================================
+old_dir=`pwd`
+MACHINE_TYPE=""
+
+source setup-env || exit 1
+source ./functions/common-functions
+# if there are no sufficient arguments...
+if [ $# -lt 2 ]; then
+ usage
+ exit 0
+fi
+
+if [ x"$CROSS_COMPILE" = "x" ]; then
+ echo "define CROSS_COMPILE variable"
+ exit 1
+fi
+
+which ${CROSS_COMPILE}gcc > /dev/null
+
+if [ $? -ne 0 ]; then
+ echo "No toolchain in path"
+ exit 1
+fi
+
+
+if [ x"$ROOTFS" = "x" ]; then
+ echo "Please set ROOTFS variable to point to your root filesystem"
+ exit 1
+fi
+
+if [ x"$WORK_SPACE" = "x" ]; then
+ echo "Please set WORK_SPACE variable to point to your preferred work space"
+ exit 1
+fi
+
+FINGURE_PRINT_DIR="${WORK_SPACE}/.FingurePrint"
+mkdir -p ${FINGURE_PRINT_DIR} || exit 1
+
+USER_OPTION=0
+CURRENT_OPTION=0
+
+case "$2" in
+ build)
+ USER_OPTION=1
+ ;;
+ rebuild)
+ USER_OPTION=2
+ ;;
+ *)
+ echo "Unknown option $2"
+ exit 1
+ ;;
+esac
+
+CURRENT_OPTION=${USER_OPTION}
+
+MODULE_TO_INVOKE=$1
+$MODULE_TO_INVOKE 1
+
+cd ${old_dir}
diff --git a/README b/README
--- /dev/null
+++ b/README
@@ -0,0 +1,51 @@
+This repository holds small usefull utilities to ease such tasks as build of WLAN packages
+
+wl12xx_build.sh: build WLAN components
+======================================
+This script compiles one of following utilities: libnl, openssl, hostapd, wpa_supplicant,wl12xx_modules,firmware,crda,callibrator
+by calling specific utility name and action.
+
+Usage: wl12xx_build.sh target <
+ libnl
+ openssl
+ hostap
+ wpa_supplicant
+ wl12xx_modules
+ firmware
+ crda
+ callibrator > action <download|build|install>
+ all
+ clean-all
+
+In case the options is 'all' all utilities will be downloaded and installed on root file system.
+Option clean-all uninstalls all components and removes their sources from computer.
+
+File setup-env contains all required environment variables:
+ ROOTFS=<path to target root file system>
+Cross compiler to be used to compile all components:
+ CROSS_COMPILER=arm-none-linux-gnueabi-
+Path to tool chain used to compile sources:
+ PATH=$PATH:<toolchain path>
+Path where kernel sources can be found
+ KLIB_BUILD=< path to kernel build>
+Working directory where all necessary sources will be downloaded and compiled
+ WORK_SPACE=<path>
+Type of target board, used during build of bluetooth, currently supported: "am1808", "omap3evm", "am335x"
+ MACHINE_TYPE=
+Path where pkg-config utility looks for configuration files (.pc) of libraries
+ PKG_CONFIG_PATH=${ROOTFS}/lib/pkgconfig:${ROOTFS}/usr/lib/pkgconfig
+ PKG_CONFIG_DEBUG_SPEW
+ PKG_CONFIG_LIBDIR=${PKG_CONFIG_PATH}
+
+Path to root file system where new kernel modules will be installed
+ KLIB=$ROOTFS
+Compiler
+ CC=${CROSS_COMPILE}gcc
+Linker
+ LD=${CROSS_COMPILE}ldd
+Ranlib utility
+ RANLIB=${CROSS_COMPILE}ranlib
+Archiver for libraries
+ AR=${CROSS_COMPILE}ar
+'ls' utility, to ensure no alias is used
+LS=/bin/ls
diff --git a/functions/common-functions b/functions/common-functions
--- /dev/null
@@ -0,0 +1,440 @@
+BUILD_HOST=`echo $CROSS_COMPILE | sed s/-$//`
+function check()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="check-0.9.8.tar.gz"
+ COMPONENT_DIR="check-0.9.8"
+ download_component "http://downloads.sourceforge.net/check/check-0.9.8.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "check built successfully"
+}
+
+function expat()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="expat-2.1.0.tar.gz"
+ COMPONENT_DIR="expat-2.1.0"
+
+ download_component "http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "expat built successfully"
+}
+
+function libIConv()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="libiconv-1.14.tar.gz"
+ COMPONENT_DIR="libiconv-1.14"
+ download_component "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "libIConv built successfully"
+}
+
+function zlib()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="zlib-1.2.7.tar.gz"
+ COMPONENT_DIR="zlib-1.2.7"
+ download_component "http://zlib.net/zlib-1.2.7.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "zlib built successfully"
+}
+
+function gettext()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="gettext-0.18.tar.gz"
+ COMPONENT_DIR="gettext-0.18"
+ download_component "http://ftp.gnu.org/gnu/gettext/gettext-0.18.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "ac_cv_func_unsetenv=no" > arm-linux.cache || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "gettext built successfully"
+}
+
+function glib()
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="glib-2.34.0.tar.xz"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ libIConv
+ zlib
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="glib-2.34.0.tar.xz"
+ COMPONENT_DIR="glib-2.34.0"
+ download_component "http://ftp.gnome.org/pub/GNOME/sources/glib/2.34/glib-2.34.0.tar.xz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "glib_cv_stack_grows=no
+ glib_cv_have_qsort_r=no
+ glib_cv_uscore=yes
+ ac_cv_func_posix_getpwuid_r=yes
+ ac_cv_func_posix_getgrgid_r=yes
+ ac_cv_func_pipe2=no" > arm-linux.cache || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache --with-libiconv=gnu || exit 1
+ sed -i 's/\(^Libs: .*\)/\1 -liconv/g' glib-2.0.pc || exit 1
+ sed -i 's/\(^Libs: .*\)/\1 -lgmodule-2.0/g' gio-2.0.pc || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "glib built successfully"
+}
+
+function dbus()
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="dbus-1.6.8.tar.gz"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ expat
+ libffi
+ glib
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="dbus-1.6.8.tar.gz"
+ COMPONENT_DIR="dbus-1.6.8"
+ download_component "http://dbus.freedesktop.org/releases/dbus/dbus-1.6.8.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "ac_cv_func_pipe2=no" > arm-linux.cache || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache --disable-inotify --without-x || exit 1
+ make LIBS="-lgio-2.0 -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -liconv -lffi -lz" || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ echo "messagebus:x:102:105::${MY_LOCALSTATEDIR}/run/dbus:/bin/false" >> ${ROOTFS}${MY_SYSCONFDIR}/passwd || exit 1
+ add_fingerprint 1
+ fi
+ echo "dbus built successfully"
+}
+
+function dbus-glib()
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="dbus-glib-0.86.tar.gz"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ dbus
+ glib
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="dbus-glib-0.86.tar.gz"
+ COMPONENT_DIR="dbus-glib-0.86"
+ download_component "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-0.86.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "ac_cv_have_abstract_sockets=yes" > arm-linux.cache || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache || exit 1
+ sed -i 's/examples//g' dbus/Makefile || exit 1
+ sed -i 's/tools test/test/g' Makefile || exit 1
+ make LIBS="-lffi -lgthread-2.0 -lgobject-2.0 -lglib-2.0 -liconv" || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "dbus-glib built successfully"
+}
+
+function python()
+{
+ cd ${WORK_SPACE} || exit 1
+ #dependency section
+ glib
+
+ COMPONENT_NAME="Python-2.7.3.tgz"
+ COMPONENT_DIR="Python-2.7.3"
+ download_component "http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz"
+ echo "CURRENT_OPTION=$CURRENT_OPTION"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ CC=gcc CXX=g++ AR=ar RANLIB=ranlib ./configure || exit 1
+ make python Parser/pgen || exit 1
+ mv python hostpython || exit 1
+ mv Parser/pgen Parser/hostpgen || exit 1
+ make distclean || exit 1
+ patch -p1 < ${old_dir}/patches/0001-Python-2.7.3-xcompile.patch || exit 1
+ ./configure --host=${BUILD_HOST} --build=x86_64-linux-gnu --prefix=${MY_PREFIX} --with-system-expat --enable-unicode=ucs2 --without-wctype-functions || exit 1
+ make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="${CROSS_COMPILE}gcc -shared" CROSS_COMPILE_TARGET=yes HOSTARCH=arm-linux BUILDARCH=x86_64-linux-gnu || exit 1
+ make install DESTDIR=${ROOTFS} HOSTPYTHON=./hostpython BLDSHARED="${CROSS_COMPILE}gcc -shared" CROSS_COMPILE_TARGET=y || exit 1
+ add_fingerprint 1
+ fi
+ echo "python built successfully"
+}
+
+function dbus-python()
+{
+ cd ${WORK_SPACE} || exit 1
+ #dependency section
+ glib
+ dbus
+ python
+
+ COMPONENT_NAME="dbus-python-0.84.0.tar.gz"
+ COMPONENT_DIR="dbus-python-0.84.0"
+ download_component "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-0.84.0.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "am_cv_python_pythondir=${MY_PREFIX}/lib/python2.7/site-packages
+ am_cv_python_pyexecdir=${MY_PREFIX}/lib/python2.7/site-packages" > arm-linux.cache || exit 1
+ PYTHON_INCLUDES="-I${ROOTFS}${MY_PREFIX}/include/python2.7/" PYTHON_LIBS="-L${ROOTFS}/${MY_PREFIX}/lib/python2.7" ./configure --host=${BUILD_HOST} --build=x86_64-linux-gnu --prefix=${MY_PREFIX} --cache-file=arm-linux.cache || exit 1
+ make PYTHON_INCLUDES="-I${ROOTFS}${MY_PREFIX}/include/python2.7/" || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "dbus-python built successfully"
+}
+
+function pygobject()
+{
+ cd ${WORK_SPACE} || exit 1
+
+ #dependency section
+ glib
+ python
+
+ COMPONENT_NAME="pygobject-2.21.1.tar.bz2"
+ COMPONENT_DIR="pygobject-2.21.1"
+ download_component "http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.21/pygobject-2.21.1.tar.bz2"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "am_cv_python_pyexecdir=${MY_PREFIX}/lib/python2.7/site-packages" > arm-linux.cache || exit 1
+ CC=gcc CXX=g++ AR=ar RANLIB=ranlib ./configure --disable-glibtest --without-ffi || exit 1
+ cd ./gobject
+ make generate-constants || exit 1
+ cd ..
+ cp gobject/generate-constants host-generate-constants || exit 1
+ patch -p1 -i ${old_dir}/patches/0001-pygobject-python-includes.patch
+ /usr/bin/libtoolize || exit 1
+ /usr/bin/aclocal -I m4 || exit 1
+ /usr/bin/autoheader || exit 1
+ /usr/bin/automake --add-missing || exit 1
+ /usr/bin/autoconf || exit 1
+ PYTHON_INCLUDES="-I${ROOTFS}${MY_PREFIX}/include/python2.7/" NM=nm ./configure --host=${BUILD_HOST} --build=x86_64-linux-gnu --prefix=${MY_PREFIX} --cache-file=arm-linux.cache || exit 1
+ cp host-generate-constants gobject/generate-constants || exit 1
+ make PYTHON_INCLUDES="-I${ROOTFS}${MY_PREFIX}/include/python2.7/" || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "pygobject built successfully"
+}
+
+
+function firmware
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bt-firmware"
+ COMPONENT_REV="c17a13b64e7b1bfb1d44658b2473bcbff763befd"
+ COMPONENT_DIR="bt-firmware"
+ download_component "git://github.com/TI-ECS/bt-firmware.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ mkdir -p ${ROOTFS}/lib/firmware || exit 1
+
+ if [ x"$MACHINE_TYPE" = "x" ]; then
+ get_machine_used
+ fi
+
+ PRINT_STR="Invoking: cp ${MACHINE_TYPE}/TIInit_12.8.32.bts ${ROOTFS}/lib/firmware/"
+ echo ${PRINT_STR}
+ cp ./${MACHINE_TYPE}/TIInit_12.8.32.bts ${ROOTFS}/lib/firmware/ || exit 1
+ add_fingerprint 1
+ fi
+ echo "firmware built successfully"
+}
+
+function uim
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="uim"
+ COMPONENT_REV="c73894456df5def97111cb33d2106b684b8b7959"
+ COMPONENT_DIR="uim"
+ download_component "git://gitorious.org/uim/uim.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ if [ x"$MACHINE_TYPE" = "x" ]; then
+ get_machine_used
+ fi
+ install -d ${ROOTFS}${MY_PREFIX}/sbin ${ROOTFS}/etc/init.d
+ install -d ${ROOTFS}/etc/rcS.d
+ make DESTDIR=${ROOTFS} install
+ install -c -m 755 ${old_dir}/scripts/uim/uim-sysfs.sh ${ROOTFS}/etc/init.d/ || exit 1
+ cd ${ROOTFS}/etc/init.d/ || exit 1
+ ln -s -f ../init.d/uim-sysfs.sh ../rcS.d/S04uim-sysfs || exit 1
+ add_fingerprint 1
+ fi
+ echo "uim built successfully"
+}
+
+function libffi()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_REV="70084e70ddb13b29dd05c751b1904de206bbe790"
+ COMPONENT_NAME="libffi"
+ COMPONENT_DIR="libffi"
+
+ download_component "https://github.com/atgreen/libffi.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --prefix=${MY_PREFIX} CC=${CROSS_COMPILE}gcc LD=${CROSS_COMPILE}ld RANLIB=${CROSS_COMPILE}ranlib --host=${BUILD_HOST} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "libffi built successfully"
+}
+function add_fingerprint()
+{
+ if [ x"$1" = "x" ]; then
+ echo "Function add_fingerprint() called with no parameters!!!"
+ exit 1
+ fi
+ local FILENAME="${FINGURE_PRINT_DIR}/${COMPONENT_NAME##*/}"
+ touch ${FILENAME} || exit 1
+ echo $1 > ${FILENAME} || exit
+}
+
+function fingerprint()
+{
+ local FILENAME="${FINGURE_PRINT_DIR}/${COMPONENT_NAME##*/}"
+ # if no file exists
+ if [ ! -e ${FILENAME} ]; then
+ return 0
+ fi
+ read MAX < ${FILENAME}
+ return ${MAX}
+}
+
+function download_component()
+{
+ if [ x"$1" = "x" ]; then
+ echo "Function called with no parameters!!!"
+ exit 1
+ fi
+
+ if [ ! x"${START_MODULE}" = "x" ]; then # if the START_MODULE is not empty
+ if [ ${START_MODULE} = ${COMPONENT_NAME} ]; then # if we are building the start module
+ CURRENT_OPTION=${USER_OPTION} # take the user option as is
+ else
+ CURRENT_OPTION="1" # else, we are building dependency, so we should only build not rebuild
+ fi
+ else
+ CURRENT_OPTION=${USER_OPTION} # take the user option as is
+ fi
+ # get the extension of the file
+ local EXT=${1/*./}
+
+ # check the fingerprint value
+ fingerprint
+ case "$?" in
+ 0) # 0 - File not compiled nor installed
+ CURRENT_OPTION="2" # override to "rebuild" option
+ ;;
+ 1) # 1 - File was installed properly
+ # if the option is build and fingerprint OK, nothing to do
+ if [ ${CURRENT_OPTION} = "1" ]; then
+ return
+ fi
+ ;;
+ *)
+ echo "Corrupted fingerprint for component ${COMPONENT_NAME}"
+ exit 1
+ ;;
+ esac
+# echo "Decided to rebuild for ${COMPONENT_NAME}"
+# read
+ # I get here in one situation : USER_OPTION = 2
+ case "${EXT}" in
+ git)
+ # if git directory exist, do not clone it again
+ if [ ! -d ${COMPONENT_DIR} ]; then
+ git clone $1 || exit 1
+ fi
+ cd ${COMPONENT_DIR} || exit 1
+ git reset --hard ${COMPONENT_REV} || exit 1
+ ;;
+
+ tgz|gz|bz2|xz|tar)
+ # delete the working directory if exists
+ if [ ! x"${COMPONENT_DIR}" = "x" ]; then
+ rm -rf ${COMPONENT_DIR} || exit 1
+ fi
+
+ local TAR_FLAGS="-xavf"
+
+ # if component doesn't exist, bring it
+ if [ ! -e ${COMPONENT_NAME} ]; then
+ wget $1 || exit 1
+ fi
+ tar ${TAR_FLAGS} ${COMPONENT_NAME} || exit 1
+ # move to the directory if not empty
+ if [ ! x"${COMPONENT_DIR}" = "x" ]; then
+ cd ${COMPONENT_DIR} || exit 1
+ fi;
+ ;;
+
+ *)
+ echo "Unknown extension of remote package"
+ exit 1
+ ;;
+ esac
+}
+
+function get_machine_used()
+{
+ # check if the machine type is already defined
+ if [ ! x"${MACHINE_TYPE}" = "x" ]; then
+ return;
+ fi
+ echo ""
+ echo "Please select the machine you use:"
+ echo "==================================="
+ echo "3. am335x-evm (am335x)"
+ read choice
+ case $choice in
+ 1) MACHINE_TYPE="am335x" ;;
+ *)
+ echo "This is not a valid choice... Exitiing script"
+ exit 1
+ ;;
+ esac
+}
diff --git a/functions/common-functions_for_SDK7 b/functions/common-functions_for_SDK7
--- /dev/null
@@ -0,0 +1,419 @@
+BUILD_HOST=`echo $CROSS_COMPILE | sed s/-$//`
+function check()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="check-0.9.8.tar.gz"
+ COMPONENT_DIR="check-0.9.8"
+ download_component "http://downloads.sourceforge.net/check/check-0.9.8.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "check built successfully"
+}
+
+function expat()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="expat-2.1.0.tar.gz"
+ COMPONENT_DIR="expat-2.1.0"
+
+ download_component "http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "expat built successfully"
+}
+
+function libIConv()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="libiconv-1.14.tar.gz"
+ COMPONENT_DIR="libiconv-1.14"
+ download_component "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "libIConv built successfully"
+}
+
+
+function zlib()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="zlib-1.2.8.tar.gz"
+ COMPONENT_DIR="zlib-1.2.8"
+ download_component "http://zlib.net/zlib-1.2.8.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "zlib built successfully"
+}
+
+function gettext()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="gettext-0.18.tar.gz"
+ COMPONENT_DIR="gettext-0.18"
+ download_component "http://ftp.gnu.org/gnu/gettext/gettext-0.18.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "ac_cv_func_unsetenv=no" > arm-linux.cache || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "gettext built successfully"
+}
+
+function glib()
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="glib-2.34.0.tar.xz"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ libIConv
+ zlib
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="glib-2.41.0.tar.xz"
+ COMPONENT_DIR="glib-2.41.0"
+ download_component "http://ftp.gnome.org/pub/GNOME/sources/glib/2.41/glib-2.41.0.tar.xz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "glib_cv_stack_grows=no
+ glib_cv_have_qsort_r=no
+ glib_cv_uscore=yes
+ ac_cv_func_posix_getpwuid_r=yes
+ ac_cv_func_posix_getgrgid_r=yes
+ ac_cv_func_pipe2=no" > arm-linux.cache || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache --with-libiconv=gnu || exit 1
+ sed -i 's/\(^Libs: .*\)/\1 -liconv/g' glib-2.0.pc || exit 1
+ sed -i 's/\(^Libs: .*\)/\1 -lgmodule-2.0/g' gio-2.0.pc || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "glib built successfully"
+}
+
+function dbus()
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="dbus-1.6.8.tar.gz"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ expat
+ libffi
+ glib
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="dbus-1.6.8.tar.gz"
+ COMPONENT_DIR="dbus-1.6.8"
+ download_component "http://dbus.freedesktop.org/releases/dbus/dbus-1.6.8.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "ac_cv_func_pipe2=no" > arm-linux.cache || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache --disable-inotify --without-x || exit 1
+ make LIBS="-lgio-2.0 -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -liconv -lffi -lz" || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ echo "messagebus:x:102:105::${MY_LOCALSTATEDIR}/run/dbus:/bin/false" >> ${ROOTFS}${MY_SYSCONFDIR}/passwd || exit 1
+ add_fingerprint 1
+ fi
+ echo "dbus built successfully"
+}
+
+function dbus-glib()
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="dbus-glib-0.86.tar.gz"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ dbus
+ glib
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="dbus-glib-0.86.tar.gz"
+ COMPONENT_DIR="dbus-glib-0.86"
+ download_component "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-0.86.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "ac_cv_have_abstract_sockets=yes" > arm-linux.cache || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache || exit 1
+ sed -i 's/examples//g' dbus/Makefile || exit 1
+ sed -i 's/tools test/test/g' Makefile || exit 1
+ make LIBS="-lffi -lgthread-2.0 -lgobject-2.0 -lglib-2.0 -liconv" || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "dbus-glib built successfully"
+}
+
+function python()
+{
+ cd ${WORK_SPACE} || exit 1
+ #dependency section
+ glib
+
+ COMPONENT_NAME="Python-2.7.3.tgz"
+ COMPONENT_DIR="Python-2.7.3"
+ download_component "http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz"
+ echo "CURRENT_OPTION=$CURRENT_OPTION"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ CC=gcc CXX=g++ AR=ar RANLIB=ranlib ./configure || exit 1
+ make python Parser/pgen || exit 1
+ mv python hostpython || exit 1
+ mv Parser/pgen Parser/hostpgen || exit 1
+ make distclean || exit 1
+ patch -p1 < ${old_dir}/patches/0001-Python-2.7.3-xcompile.patch || exit 1
+ ./configure --host=${BUILD_HOST} --build=x86_64-linux-gnu --prefix=${MY_PREFIX} --with-system-expat --enable-unicode=ucs2 --without-wctype-functions || exit 1
+ make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="${CROSS_COMPILE}gcc -shared" CROSS_COMPILE_TARGET=yes HOSTARCH=arm-linux BUILDARCH=x86_64-linux-gnu || exit 1
+ make install DESTDIR=${ROOTFS} HOSTPYTHON=./hostpython BLDSHARED="${CROSS_COMPILE}gcc -shared" CROSS_COMPILE_TARGET=y || exit 1
+ add_fingerprint 1
+ fi
+ echo "python built successfully"
+}
+
+function dbus-python()
+{
+ cd ${WORK_SPACE} || exit 1
+ #dependency section
+ glib
+ dbus
+ python
+
+ COMPONENT_NAME="dbus-python-0.84.0.tar.gz"
+ COMPONENT_DIR="dbus-python-0.84.0"
+ download_component "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-0.84.0.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "am_cv_python_pythondir=${MY_PREFIX}/lib/python2.7/site-packages
+ am_cv_python_pyexecdir=${MY_PREFIX}/lib/python2.7/site-packages" > arm-linux.cache || exit 1
+ PYTHON_INCLUDES="-I${ROOTFS}${MY_PREFIX}/include/python2.7/" PYTHON_LIBS="-L${ROOTFS}/${MY_PREFIX}/lib/python2.7" ./configure --host=${BUILD_HOST} --build=x86_64-linux-gnu --prefix=${MY_PREFIX} --cache-file=arm-linux.cache || exit 1
+ make PYTHON_INCLUDES="-I${ROOTFS}${MY_PREFIX}/include/python2.7/" || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "dbus-python built successfully"
+}
+
+function pygobject()
+{
+ cd ${WORK_SPACE} || exit 1
+
+ #dependency section
+ glib
+ python
+
+ COMPONENT_NAME="pygobject-2.21.1.tar.bz2"
+ COMPONENT_DIR="pygobject-2.21.1"
+ download_component "http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.21/pygobject-2.21.1.tar.bz2"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "am_cv_python_pyexecdir=${MY_PREFIX}/lib/python2.7/site-packages" > arm-linux.cache || exit 1
+ CC=gcc CXX=g++ AR=ar RANLIB=ranlib ./configure --disable-glibtest --without-ffi || exit 1
+ cd ./gobject
+ make generate-constants || exit 1
+ cd ..
+ cp gobject/generate-constants host-generate-constants || exit 1
+ patch -p1 -i ${old_dir}/patches/0001-pygobject-python-includes.patch
+ /usr/bin/libtoolize || exit 1
+ /usr/bin/aclocal -I m4 || exit 1
+ /usr/bin/autoheader || exit 1
+ /usr/bin/automake --add-missing || exit 1
+ /usr/bin/autoconf || exit 1
+ PYTHON_INCLUDES="-I${ROOTFS}${MY_PREFIX}/include/python2.7/" NM=nm ./configure --host=${BUILD_HOST} --build=x86_64-linux-gnu --prefix=${MY_PREFIX} --cache-file=arm-linux.cache || exit 1
+ cp host-generate-constants gobject/generate-constants || exit 1
+ make PYTHON_INCLUDES="-I${ROOTFS}${MY_PREFIX}/include/python2.7/" || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "pygobject built successfully"
+}
+
+
+function firmware
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bt-firmware"
+ COMPONENT_REV="c17a13b64e7b1bfb1d44658b2473bcbff763befd"
+ COMPONENT_DIR="bt-firmware"
+ download_component "git://github.com/TI-ECS/bt-firmware.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ mkdir -p ${ROOTFS}/lib/firmware || exit 1
+
+ if [ x"$MACHINE_TYPE" = "x" ]; then
+ get_machine_used
+ fi
+
+ PRINT_STR="Invoking: cp ${MACHINE_TYPE}/TIInit_12.8.32.bts ${ROOTFS}/lib/firmware/"
+ echo ${PRINT_STR}
+ cp ./${MACHINE_TYPE}/TIInit_12.8.32.bts ${ROOTFS}/lib/firmware/ || exit 1
+ add_fingerprint 1
+ fi
+ echo "firmware built successfully"
+}
+
+
+function libffi()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_REV="70084e70ddb13b29dd05c751b1904de206bbe790"
+ COMPONENT_NAME="libffi"
+ COMPONENT_DIR="libffi"
+
+ download_component "https://github.com/atgreen/libffi.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --prefix=${MY_PREFIX} CC=${CROSS_COMPILE}gcc LD=${CROSS_COMPILE}ld RANLIB=${CROSS_COMPILE}ranlib --host=${BUILD_HOST} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "libffi built successfully"
+}
+function add_fingerprint()
+{
+ if [ x"$1" = "x" ]; then
+ echo "Function add_fingerprint() called with no parameters!!!"
+ exit 1
+ fi
+ local FILENAME="${FINGURE_PRINT_DIR}/${COMPONENT_NAME##*/}"
+ touch ${FILENAME} || exit 1
+ echo $1 > ${FILENAME} || exit
+}
+
+function fingerprint()
+{
+ local FILENAME="${FINGURE_PRINT_DIR}/${COMPONENT_NAME##*/}"
+ # if no file exists
+ if [ ! -e ${FILENAME} ]; then
+ return 0
+ fi
+ read MAX < ${FILENAME}
+ return ${MAX}
+}
+
+function download_component()
+{
+ if [ x"$1" = "x" ]; then
+ echo "Function called with no parameters!!!"
+ exit 1
+ fi
+
+ if [ ! x"${START_MODULE}" = "x" ]; then # if the START_MODULE is not empty
+ if [ ${START_MODULE} = ${COMPONENT_NAME} ]; then # if we are building the start module
+ CURRENT_OPTION=${USER_OPTION} # take the user option as is
+ else
+ CURRENT_OPTION="1" # else, we are building dependency, so we should only build not rebuild
+ fi
+ else
+ CURRENT_OPTION=${USER_OPTION} # take the user option as is
+ fi
+ # get the extension of the file
+ local EXT=${1/*./}
+
+ # check the fingerprint value
+ fingerprint
+ case "$?" in
+ 0) # 0 - File not compiled nor installed
+ CURRENT_OPTION="2" # override to "rebuild" option
+ ;;
+ 1) # 1 - File was installed properly
+ # if the option is build and fingerprint OK, nothing to do
+ if [ ${CURRENT_OPTION} = "1" ]; then
+ return
+ fi
+ ;;
+ *)
+ echo "Corrupted fingerprint for component ${COMPONENT_NAME}"
+ exit 1
+ ;;
+ esac
+# echo "Decided to rebuild for ${COMPONENT_NAME}"
+# read
+ # I get here in one situation : USER_OPTION = 2
+ case "${EXT}" in
+ git)
+ # if git directory exist, do not clone it again
+ if [ ! -d ${COMPONENT_DIR} ]; then
+ git clone $1 || exit 1
+ fi
+ cd ${COMPONENT_DIR} || exit 1
+ git reset --hard ${COMPONENT_REV} || exit 1
+ ;;
+
+ tgz|gz|bz2|xz|tar)
+ # delete the working directory if exists
+ if [ ! x"${COMPONENT_DIR}" = "x" ]; then
+ rm -rf ${COMPONENT_DIR} || exit 1
+ fi
+
+ local TAR_FLAGS="-xavf"
+
+ # if component doesn't exist, bring it
+ if [ ! -e ${COMPONENT_NAME} ]; then
+ wget $1 || exit 1
+ fi
+ tar ${TAR_FLAGS} ${COMPONENT_NAME} || exit 1
+ # move to the directory if not empty
+ if [ ! x"${COMPONENT_DIR}" = "x" ]; then
+ cd ${COMPONENT_DIR} || exit 1
+ fi;
+ ;;
+
+ *)
+ echo "Unknown extension of remote package"
+ exit 1
+ ;;
+ esac
+}
+
+function get_machine_used()
+{
+ # check if the machine type is already defined
+ if [ ! x"${MACHINE_TYPE}" = "x" ]; then
+ return;
+ fi
+ echo ""
+ echo "Please select the machine you use:"
+ echo "==================================="
+ echo "3. am335x-evm (am335x)"
+ read choice
+ case $choice in
+ 1) MACHINE_TYPE="am335x" ;;
+ *)
+ echo "This is not a valid choice... Exitiing script"
+ exit 1
+ ;;
+ esac
+}
diff --git a/patches/0001-Enable-auto-reconnection.patch b/patches/0001-Enable-auto-reconnection.patch
--- /dev/null
@@ -0,0 +1,55 @@
+From d621729a4659e42fe92f528c170797168e788183 Mon Sep 17 00:00:00 2001\r
+From: Chen Ganir <chen.ganir@ti.com>\r
+Date: Wed, 7 Nov 2012 10:33:21 +0200\r
+Subject: [PATCH] Enable auto-reconnection\r
+\r
+Enable auto-reconnection for proximity, heartrate and thermometer\r
+---\r
+ profiles/heartrate/heartrate.c | 2 ++\r
+ profiles/proximity/monitor.c | 2 ++\r
+ profiles/thermometer/thermometer.c | 3 +++\r
+ 3 files changed, 7 insertions(+)\r
+\r
+diff --git a/profiles/heartrate/heartrate.c b/profiles/heartrate/heartrate.c\r
+index f0eb7a4..01c254c 100644\r
+--- a/profiles/heartrate/heartrate.c\r
++++ b/profiles/heartrate/heartrate.c\r
+@@ -800,6 +800,8 @@ int heartrate_device_register(struct btd_device *device,\r
+ hr->attioid = btd_device_add_attio_callback(device, attio_connected_cb,\r
+ attio_disconnected_cb, hr);\r
+ \r
++ device_set_auto_connect(device, TRUE);\r
++\r
+ return 0;\r
+ }\r
+ \r
+diff --git a/profiles/proximity/monitor.c b/profiles/proximity/monitor.c\r
+index 1a14265..e45fa4a 100644\r
+--- a/profiles/proximity/monitor.c\r
++++ b/profiles/proximity/monitor.c\r
+@@ -652,6 +652,8 @@ int monitor_register(struct btd_device *device,\r
+ attio_disconnected_cb,\r
+ monitor);\r
+ \r
++ device_set_auto_connect(device, TRUE);\r
++\r
+ return 0;\r
+ }\r
+ \r
+diff --git a/profiles/thermometer/thermometer.c b/profiles/thermometer/thermometer.c\r
+index 4d1df1d..041e18f 100644\r
+--- a/profiles/thermometer/thermometer.c\r
++++ b/profiles/thermometer/thermometer.c\r
+@@ -1255,6 +1255,9 @@ int thermometer_register(struct btd_device *device, struct gatt_primary *tattr)\r
+ \r
+ t->attioid = btd_device_add_attio_callback(device, attio_connected_cb,\r
+ attio_disconnected_cb, t);\r
++\r
++ device_set_auto_connect(device, TRUE);\r
++\r
+ return 0;\r
+ }\r
+ \r
+-- \r
+1.7.9.5\r
+\r
diff --git a/patches/0001-Python-2.7.3-xcompile.patch b/patches/0001-Python-2.7.3-xcompile.patch
--- /dev/null
@@ -0,0 +1,228 @@
+From 846cdf11adb55e88f311bf5ff3ec4173cbe073d9 Mon Sep 17 00:00:00 2001
+From: Eyal Reizer <eyalr@ti.com>
+Date: Mon, 22 Oct 2012 18:57:22 +0300
+Subject: [PATCH] Python-2.7.3-xcompile
+
+Signed-off-by: Eyal Reizer <eyalr@ti.com>
+---
+ Lib/plat-linux3/regen | 8 ++++++++
+ Makefile.pre.in | 27 ++++++++++++++++-----------
+ configure | 4 ++--
+ setup.py | 43 ++++++++++++++++++++++++++++++++-----------
+ 4 files changed, 58 insertions(+), 24 deletions(-)
+ create mode 100644 Lib/plat-linux3/regen
+
+diff --git a/Lib/plat-linux3/regen b/Lib/plat-linux3/regen
+new file mode 100644
+index 0000000..7a78072
+--- /dev/null
++++ b/Lib/plat-linux3/regen
+@@ -0,0 +1,8 @@
++#! /bin/sh
++case `uname` in
++Linux*) ;;
++*) echo Probably not on a Linux system 1>&2
++ exit 1;;
++esac
++set -v
++h2py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/dlfcn.h
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index e2237a9..fc6b2d7 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -182,6 +182,7 @@ UNICODE_OBJS= @UNICODE_OBJS@
+
+ PYTHON= python$(EXE)
+ BUILDPYTHON= python$(BUILDEXE)
++HOSTPYTHON= ./$(BUILDPYTHON)
+
+ # The task to run while instrument when building the profile-opt target
+ PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
+@@ -215,6 +216,8 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
+ # Parser
+ PGEN= Parser/pgen$(EXE)
+
++HOSTPGEN= $(PGEN)
++
+ POBJS= \
+ Parser/acceler.o \
+ Parser/grammar1.o \
+@@ -408,8 +411,8 @@ platform: $(BUILDPYTHON)
+ # Build the shared modules
+ sharedmods: $(BUILDPYTHON)
+ @case $$MAKEFLAGS in \
+- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
+- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
++ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
++ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
+ esac
+
+ # Build static library
+@@ -543,7 +546,7 @@ Modules/python.o: $(srcdir)/Modules/python.c
+ $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp
+ Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
+ -@$(INSTALL) -d Include
+- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
++ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ -touch Parser/pgen.stamp
+
+ $(PGEN): $(PGENOBJS)
+@@ -938,26 +941,26 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
+ $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ fi
+- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
++ $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
+
+ # Create the PLATDIR source directory, if one wasn't distributed..
+ $(srcdir)/Lib/$(PLATDIR):
+@@ -1062,7 +1065,9 @@ libainstall: all python-config
+ # Install the dynamically loadable modules
+ # This goes into $(exec_prefix)
+ sharedinstall: sharedmods
+- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
++ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
++ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
++ --skip-build \
+ --prefix=$(prefix) \
+ --install-scripts=$(BINDIR) \
+ --install-platlib=$(DESTSHARED) \
+diff --git a/configure b/configure
+index 3948080..acf3c8a 100755
+--- a/configure
++++ b/configure
+@@ -13697,7 +13697,7 @@ $as_echo_n "checking for %lld and %llu printf() format support... " >&6; }
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+- ac_cv_have_long_long_format=no
++ ac_cv_have_long_long_format="cross -- assuming yes"
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+@@ -13749,7 +13749,7 @@ fi
+ $as_echo "$ac_cv_have_long_long_format" >&6; }
+ fi
+
+-if test "$ac_cv_have_long_long_format" = yes
++if test "$ac_cv_have_long_long_format" != no
+ then
+
+ $as_echo "#define PY_FORMAT_LONG_LONG \"ll\"" >>confdefs.h
+diff --git a/setup.py b/setup.py
+index 6b47451..ed56aed 100644
+--- a/setup.py
++++ b/setup.py
+@@ -145,6 +145,7 @@ class PyBuildExt(build_ext):
+ def __init__(self, dist):
+ build_ext.__init__(self, dist)
+ self.failed = []
++ self.cross_compile = os.environ.get('CROSS_COMPILE_TARGET') == 'yes'
+
+ def build_extensions(self):
+
+@@ -278,6 +279,14 @@ class PyBuildExt(build_ext):
+ (ext.name, sys.exc_info()[1]))
+ self.failed.append(ext.name)
+ return
++
++ # Import check will not work when cross-compiling.
++ if os.environ.has_key('PYTHONXCPREFIX'):
++ self.announce(
++ 'WARNING: skipping import check for cross-compiled: "%s"' %
++ ext.name)
++ return
++
+ # Workaround for Mac OS X: The Carbon-based modules cannot be
+ # reliably imported into a command-line Python
+ if 'Carbon' in ext.extra_link_args:
+@@ -369,9 +378,10 @@ class PyBuildExt(build_ext):
+
+ def detect_modules(self):
+ # Ensure that /usr/local is always used
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+- self.add_multiarch_paths()
++ if not self.cross_compile:
++ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
++ self.add_multiarch_paths()
+
+ # Add paths specified in the environment variables LDFLAGS and
+ # CPPFLAGS for header and library files.
+@@ -408,7 +418,8 @@ class PyBuildExt(build_ext):
+ add_dir_to_list(dir_list, directory)
+
+ if os.path.normpath(sys.prefix) != '/usr' \
+- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++ and not sysconfig.get_config_var('PYTHONFRAMEWORK') \
++ and not self.cross_compile:
+ # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+ # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+ # building a framework with different architectures than
+@@ -426,11 +437,14 @@ class PyBuildExt(build_ext):
+ # lib_dirs and inc_dirs are used to search for files;
+ # if a file is found in one of those directories, it can
+ # be assumed that no additional -I,-L directives are needed.
+- lib_dirs = self.compiler.library_dirs + [
+- '/lib64', '/usr/lib64',
+- '/lib', '/usr/lib',
+- ]
+- inc_dirs = self.compiler.include_dirs + ['/usr/include']
++ lib_dirs = self.compiler.library_dirs
++ inc_dirs = self.compiler.include_dirs
++ if not self.cross_compile:
++ lib_dirs += [
++ '/lib64', '/usr/lib64',
++ '/lib', '/usr/lib',
++ ]
++ inc_dirs += ['/usr/include']
+ exts = []
+ missing = []
+
+@@ -1864,8 +1878,15 @@ class PyBuildExt(build_ext):
+
+ # Pass empty CFLAGS because we'll just append the resulting
+ # CFLAGS to Python's; -g or -O2 is to be avoided.
+- cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
+- % (ffi_builddir, ffi_srcdir, " ".join(config_args))
++ if self.cross_compile:
++ cmd = "cd %s && env CFLAGS='' %s/configure --host=%s --build=%s %s" \
++ % (ffi_builddir, ffi_srcdir,
++ os.environ.get('HOSTARCH'),
++ os.environ.get('BUILDARCH'),
++ " ".join(config_args))
++ else:
++ cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
++ % (ffi_builddir, ffi_srcdir, " ".join(config_args))
+
+ res = os.system(cmd)
+ if res or not os.path.exists(ffi_configfile):
+--
+1.7.9.5
+
diff --git a/patches/0001-blueti-Add-TI-Logger-dump.patch b/patches/0001-blueti-Add-TI-Logger-dump.patch
--- /dev/null
@@ -0,0 +1,251 @@
+From a5b2ddf6c5f5abe7739d4d37193d9a7afe4a5acf Mon Sep 17 00:00:00 2001\r
+From: Chen Ganir <chen.ganir@ti.com>\r
+Date: Tue, 5 Jun 2012 16:21:00 +0300\r
+Subject: [PATCH] blueti: Add TI Logger dump\r
+\r
+Read HCI vendor events of TI chip logger, and dump to file.\r
+---\r
+ parser/parser.c | 15 +++++++++\r
+ parser/parser.h | 4 +++\r
+ src/hcidump.c | 98 ++++++++++++++++++++++++++++++++++++++++---------------\r
+ 3 files changed, 91 insertions(+), 26 deletions(-)\r
+\r
+diff --git a/parser/parser.c b/parser/parser.c\r
+index 0f36ee7..fcf3ef0 100644\r
+--- a/parser/parser.c\r
++++ b/parser/parser.c\r
+@@ -317,6 +317,21 @@ void ext_dump(int level, struct frame *frm, int num)\r
+ }\r
+ }\r
+ \r
++void tilogger_dump(int level, struct frame *frm)\r
++{\r
++ unsigned char *buf = frm->ptr;\r
++ int num = frm->len;\r
++ uint8_t type = buf[0];\r
++ uint8_t vendor = buf[1];\r
++ uint8_t siz = buf[2];\r
++ uint16_t opc = buf[3]+(buf[4]<<8);\r
++ uint8_t* dat = buf[5];\r
++\r
++ printf ("%2.2X %2.2X %2.2X %2.2X %2.2X \n",type, vendor, siz, opc, dat);\r
++\r
++}\r
++\r
++\r
+ void raw_ndump(int level, struct frame *frm, int num)\r
+ {\r
+ if (!frm->len)\r
+diff --git a/parser/parser.h b/parser/parser.h\r
+index 1130a5f..9ba3380 100644\r
+--- a/parser/parser.h\r
++++ b/parser/parser.h\r
+@@ -63,6 +63,7 @@ struct frame {\r
+ #define DUMP_BTSNOOP 0x1000\r
+ #define DUMP_PKTLOG 0x2000\r
+ #define DUMP_NOVENDOR 0x4000\r
++#define DUMP_TILOGGER 0x8000\r
+ #define DUMP_TYPE_MASK (DUMP_ASCII | DUMP_HEX | DUMP_EXT)\r
+ \r
+ /* Parser filter */\r
+@@ -225,6 +226,7 @@ void raw_ndump(int level, struct frame *frm, int num);\r
+ \r
+ void lmp_dump(int level, struct frame *frm);\r
+ void hci_dump(int level, struct frame *frm);\r
++void tilogger_dump(int level, struct frame *frm);\r
+ void l2cap_dump(int level, struct frame *frm);\r
+ void rfcomm_dump(int level, struct frame *frm);\r
+ void sdp_dump(int level, struct frame *frm);\r
+@@ -253,6 +255,8 @@ static inline void parse(struct frame *frm)\r
+ p_indent(-1, NULL);\r
+ if (parser.flags & DUMP_RAW)\r
+ raw_dump(0, frm);\r
++ else if (parser.flags & DUMP_TILOGGER)\r
++ tilogger_dump(0,frm);\r
+ else\r
+ hci_dump(0, frm);\r
+ fflush(stdout);\r
+diff --git a/src/hcidump.c b/src/hcidump.c\r
+index 089d444..2a7e32a 100644\r
+--- a/src/hcidump.c\r
++++ b/src/hcidump.c\r
+@@ -110,6 +110,14 @@ struct pktlog_hdr {\r
+ } __attribute__ ((packed));\r
+ #define PKTLOG_HDR_SIZE (sizeof(struct pktlog_hdr))\r
+ \r
++struct tilogger_pkt {\r
++ uint8_t type;\r
++ uint8_t vendor;\r
++ uint8_t size;\r
++ uint16_t opcode;\r
++ uint8_t data[0]; /* Packet Data */\r
++} __attribute__ ((packed));\r
++\r
+ static inline int read_n(int fd, char *buf, int len)\r
+ {\r
+ int t = 0, w;\r
+@@ -156,6 +164,7 @@ static int process_frames(int dev, int sock, int fd, unsigned long flags)\r
+ int nfds = 0;\r
+ char *buf, *ctrl;\r
+ int len, hdr_size = HCIDUMP_HDR_SIZE;\r
++ struct tilogger_pkt *tp;\r
+ \r
+ if (sock < 0)\r
+ return -1;\r
+@@ -193,33 +202,35 @@ static int process_frames(int dev, int sock, int fd, unsigned long flags)\r
+ memset(&msg, 0, sizeof(msg));\r
+ \r
+ if (mode == SERVER) {\r
+- struct btsnoop_hdr *hdr = (void *) buf;\r
++ if (flags & DUMP_BTSNOOP) {\r
++ struct btsnoop_hdr *hdr = (void *) buf;\r
+ \r
+- btsnoop_version = 1;\r
+- btsnoop_type = 1002;\r
++ btsnoop_version = 1;\r
++ btsnoop_type = 1002;\r
+ \r
+- memcpy(hdr->id, btsnoop_id, sizeof(btsnoop_id));\r
+- hdr->version = htonl(btsnoop_version);\r
+- hdr->type = htonl(btsnoop_type);\r
++ memcpy(hdr->id, btsnoop_id, sizeof(btsnoop_id));\r
++ hdr->version = htonl(btsnoop_version);\r
++ hdr->type = htonl(btsnoop_type);\r
+ \r
+- printf("btsnoop version: %d datalink type: %d\n",\r
+- btsnoop_version, btsnoop_type);\r
++ printf("btsnoop version: %d datalink type: %d\n",\r
++ btsnoop_version, btsnoop_type);\r
+ \r
+- len = write(fd, buf, BTSNOOP_HDR_SIZE);\r
+- if (len < 0) {\r
+- perror("Can't create dump header");\r
+- return -1;\r
+- }\r
++ len = write(fd, buf, BTSNOOP_HDR_SIZE);\r
++ if (len < 0) {\r
++ perror("Can't create dump header");\r
++ return -1;\r
++ }\r
+ \r
+- if (len != BTSNOOP_HDR_SIZE) {\r
+- fprintf(stderr, "Header size mismatch\n");\r
+- return -1;\r
+- }\r
++ if (len != BTSNOOP_HDR_SIZE) {\r
++ fprintf(stderr, "Header size mismatch\n");\r
++ return -1;\r
++ }\r
+ \r
+- fds[nfds].fd = fd;\r
+- fds[nfds].events = POLLIN;\r
+- fds[nfds].revents = 0;\r
+- nfds++;\r
++ fds[nfds].fd = fd;\r
++ fds[nfds].events = POLLIN;\r
++ fds[nfds].revents = 0;\r
++ nfds++;\r
++ }\r
+ }\r
+ \r
+ fds[nfds].fd = sock;\r
+@@ -312,13 +323,39 @@ static int process_frames(int dev, int sock, int fd, unsigned long flags)\r
+ if (pkt_type == HCI_COMMAND_PKT ||\r
+ pkt_type == HCI_EVENT_PKT)\r
+ dp->flags |= ntohl(0x02);\r
++ } else if (flags & DUMP_TILOGGER) {\r
++ tp = (void *)frm.ptr;\r
++ if (tp->type == HCI_EVENT_PKT && tp->vendor == 0xFF && tp->opcode == 0x0400) {\r
++ uint8_t* data=frm.ptr;\r
++ printf ("frm.len=%2.2X pkt_type=%2.2X vendor=%2.2X opcode=%2.2X size=%2.2X \n",frm.len, tp->type, tp->vendor, tp->opcode, tp->size);\r
++ for (i = 0;i<tp->size && i<10;i++) {\r
++ printf("%2.2X ", data[i]);\r
++ }\r
++ printf("\n");\r
++ if (flags & DUMP_HEX) {\r
++ unsigned char out[2];\r
++ int i;\r
++ for(i=0;i<tp->size-2;i++) {\r
++ sprintf(out,"%02X",tp->data[i]);\r
++ if (write_n(fd, out, 2) < 0) {\r
++ perror("Write error");\r
++ return -1;\r
++ }\r
++ }\r
++ } else { /* if no flags, dump raw */\r
++ if (write_n(fd, &tp->data[0], tp->size-2) < 0) {\r
++ perror("Write error");\r
++ return -1;\r
++ }\r
++ }\r
++ }\r
++ continue;\r
+ } else {\r
+ dh->len = htobs(frm.data_len);\r
+ dh->in = frm.in;\r
+ dh->ts_sec = htobl(frm.ts.tv_sec);\r
+ dh->ts_usec = htobl(frm.ts.tv_usec);\r
+ }\r
+-\r
+ if (write_n(fd, buf, frm.data_len + hdr_size) < 0) {\r
+ perror("Write error");\r
+ return -1;\r
+@@ -854,6 +891,7 @@ static void usage(void)\r
+ " -a, --ascii Dump data in ascii\n"\r
+ " -x, --hex Dump data in hex\n"\r
+ " -X, --ext Dump data in hex and ascii\n"\r
++ " -T, --tilogger Dump tilogger data\n"\r
+ " -R, --raw Dump raw data\n"\r
+ " -C, --cmtp=psm PSM for CMTP\n"\r
+ " -H, --hcrp=psm PSM for HCRP\n"\r
+@@ -895,6 +933,7 @@ static struct option main_options[] = {\r
+ { "nopermcheck", 0, 0, 'Z' },\r
+ { "ipv4", 0, 0, '4' },\r
+ { "ipv6", 0, 0, '6' },\r
++ { "tilogger", 0, 0, 'T' },\r
+ { "help", 0, 0, 'h' },\r
+ { "version", 0, 0, 'v' },\r
+ { 0 }\r
+@@ -911,7 +950,7 @@ int main(int argc, char *argv[])\r
+ uint16_t obex_port;\r
+ \r
+ while ((opt = getopt_long(argc, argv,\r
+- "i:l:p:m:w:r:d:taxXRC:H:O:P:S:D:A:YZ46hv",\r
++ "i:l:p:m:w:r:d:taxTXRC:H:O:P:S:D:A:YZ46hv",\r
+ main_options, NULL)) != -1) {\r
+ switch(opt) {\r
+ case 'i':\r
+@@ -968,6 +1007,10 @@ int main(int argc, char *argv[])\r
+ flags |= DUMP_RAW;\r
+ break;\r
+ \r
++ case 'T':\r
++ flags |= DUMP_TILOGGER;\r
++ break;\r
++\r
+ case 'C': \r
+ set_proto(0, atoi(optarg), 0, SDP_UUID_CMTP);\r
+ break;\r
+@@ -1060,13 +1103,16 @@ int main(int argc, char *argv[])\r
+ break;\r
+ \r
+ case WRITE:\r
+- flags |= DUMP_BTSNOOP;\r
++ if ((flags & DUMP_TILOGGER) == 0)\r
++ flags |= DUMP_BTSNOOP;\r
+ process_frames(device, open_socket(device, flags),\r
+- open_file(dump_file, mode, flags), flags);\r
++ open_file(dump_file, mode, flags), flags);\r
+ break;\r
+ \r
+ case SERVER:\r
+- flags |= DUMP_BTSNOOP;\r
++ if ((flags & DUMP_TILOGGER) == 0)\r
++ flags |= DUMP_BTSNOOP;\r
++\r
+ init_parser(flags, filter, defpsm, defcompid, pppdump_fd, audio_fd);\r
+ run_server(device, dump_addr, dump_port, flags);\r
+ break;\r
+-- \r
+1.7.9.5\r
+\r
diff --git a/patches/0001-bluez-define-_GNU_SOURCE-macro.patch b/patches/0001-bluez-define-_GNU_SOURCE-macro.patch
--- /dev/null
@@ -0,0 +1,29 @@
+From 1b09d640c1781e9b28f803c3dc20cea1a1a653a8 Mon Sep 17 00:00:00 2001
+From: Vita Preskovsky <vitap@ti.com>
+Date: Tue, 30 Oct 2012 09:54:58 +0200
+Subject: [PATCH] bluez: define _GNU_SOURCE macro
+
+ * O_CLOEXEC flag used in bluez requires _GNU_SOURCE macro to be defined.
+
+
+Signed-off-by: Vita Preskovsky <vitap@ti.com>
+---
+ profiles/input/hog_device.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/profiles/input/hog_device.c b/profiles/input/hog_device.c
+index f6e945e..576fb3e 100644
+--- a/profiles/input/hog_device.c
++++ b/profiles/input/hog_device.c
+@@ -26,7 +26,7 @@
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+ #endif
+-
++#define _GNU_SOURCE
+ #include <stdlib.h>
+ #include <stdbool.h>
+ #include <errno.h>
+--
+1.7.9.5
+
diff --git a/patches/0001-bt-obex-new-dbus-api-for-obexd.patch b/patches/0001-bt-obex-new-dbus-api-for-obexd.patch
--- /dev/null
@@ -0,0 +1,287 @@
+From 0d60f8a9da3f0e77d8703da96d4f9e954f3c7c04 Mon Sep 17 00:00:00 2001
+From: Vita Preskovsky <vitap@ti.com>
+Date: Tue, 30 Oct 2012 18:37:39 +0200
+Subject: [PATCH] bt-obex: new dbus api for obexd
+
+ * obexd's dbus APIs are changed from "org.openobex" to "org.bluez.obex"
+
+
+Signed-off-by: Vita Preskovsky <vitap@ti.com>
+
+diff --git a/src/lib/obexd-api.h b/src/lib/obexd-api.h
+index 09695f6..7716df4 100644
+--- a/src/lib/obexd-api.h
++++ b/src/lib/obexd-api.h
+@@ -33,8 +33,8 @@
+ #include <dbus/dbus-glib.h>
+
+ #ifdef OBEX_SUPPORT
+-#define OBEXS_DBUS_NAME "org.openobex"
+-#define OBEXC_DBUS_NAME "org.openobex.client"
++#define OBEXS_DBUS_NAME "org.bluez.obex"
++#define OBEXC_DBUS_NAME "org.bluez.obex.client"
+
+ /* OBEXD DBus API */
+ #include "obexd/obexagent.h"
+diff --git a/src/lib/obexd/obexagent.h b/src/lib/obexd/obexagent.h
+index b94fb2c..5bc5f9c 100644
+--- a/src/lib/obexd/obexagent.h
++++ b/src/lib/obexd/obexagent.h
+@@ -89,7 +89,7 @@ static const DBusGObjectInfo dbus_glib_obexagent_object_info = {
+ 0,
+ dbus_glib_obexagent_methods,
+ 7,
+- "org.openobex.Agent\0Authorize\0S\0transfer\0I\0o\0bt_address\0I\0s\0name\0I\0s\0type\0I\0s\0length\0I\0i\0time\0I\0i\0arg6\0O\0F\0N\0s\0\0org.openobex.Agent\0Cancel\0S\0\0org.openobex.Agent\0Release\0S\0\0org.openobex.Agent\0Request\0S\0transfer\0I\0o\0arg1\0O\0F\0N\0s\0\0org.openobex.Agent\0Progress\0S\0transfer\0I\0o\0transferred\0I\0t\0\0org.openobex.Agent\0Complete\0S\0transfer\0I\0o\0\0org.openobex.Agent\0Error\0S\0transfer\0I\0o\0message\0I\0s\0\0\0",
++ "org.bluez.obex.Agent\0Authorize\0S\0transfer\0I\0o\0bt_address\0I\0s\0name\0I\0s\0type\0I\0s\0length\0I\0i\0time\0I\0i\0arg6\0O\0F\0N\0s\0\0org.bluez.obex.Agent\0Cancel\0S\0\0org.bluez.obex.Agent\0Release\0S\0\0org.bluez.obex.Agent\0Request\0S\0transfer\0I\0o\0arg1\0O\0F\0N\0s\0\0org.bluez.obex.Agent\0Progress\0S\0transfer\0I\0o\0transferred\0I\0t\0\0org.bluez.obex.Agent\0Complete\0S\0transfer\0I\0o\0\0org.bluez.obex.Agent\0Error\0S\0transfer\0I\0o\0message\0I\0s\0\0\0",
+ "\0",
+ "\0"
+ };
+diff --git a/src/lib/obexd/obexclient.c b/src/lib/obexd/obexclient.c
+index d8cfa78..b8ac43e 100644
+--- a/src/lib/obexd/obexclient.c
++++ b/src/lib/obexd/obexclient.c
+@@ -83,7 +83,7 @@ static void obexclient_init(OBEXClient *self)
+ GError *error = NULL;
+
+ /* Getting introspection XML */
+- self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", OBEXCLIENT_DBUS_PATH, "org.freedesktop.DBus.Introspectable");
++ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", OBEXCLIENT_DBUS_PATH, "org.freedesktop.DBus.Introspectable");
+ self->priv->introspection_xml = NULL;
+ if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) {
+ g_critical("%s", error->message);
+@@ -97,7 +97,7 @@ static void obexclient_init(OBEXClient *self)
+ }
+ g_free(check_intf_regex_str);
+
+- self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", OBEXCLIENT_DBUS_PATH, OBEXCLIENT_DBUS_INTERFACE);
++ self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", OBEXCLIENT_DBUS_PATH, OBEXCLIENT_DBUS_INTERFACE);
+ }
+
+ /* Methods */
+diff --git a/src/lib/obexd/obexclient.h b/src/lib/obexd/obexclient.h
+index d999b76..59799db 100644
+--- a/src/lib/obexd/obexclient.h
++++ b/src/lib/obexd/obexclient.h
+@@ -27,7 +27,7 @@
+ #include <glib-object.h>
+
+ #define OBEXCLIENT_DBUS_PATH "/"
+-#define OBEXCLIENT_DBUS_INTERFACE "org.openobex.Client"
++#define OBEXCLIENT_DBUS_INTERFACE "org.bluez.obex.Client"
+
+ /*
+ * Type macros
+diff --git a/src/lib/obexd/obexclient_file_transfer.c b/src/lib/obexd/obexclient_file_transfer.c
+index 05fa36d..683cdfa 100644
+--- a/src/lib/obexd/obexclient_file_transfer.c
++++ b/src/lib/obexd/obexclient_file_transfer.c
+@@ -109,7 +109,7 @@ static void obexclient_file_transfer_post_init(OBEXClientFileTransfer *self, con
+ GError *error = NULL;
+
+ /* Getting introspection XML */
+- self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, "org.freedesktop.DBus.Introspectable");
++ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", dbus_object_path, "org.freedesktop.DBus.Introspectable");
+ self->priv->introspection_xml = NULL;
+ if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) {
+ g_critical("%s", error->message);
+@@ -122,7 +122,7 @@ static void obexclient_file_transfer_post_init(OBEXClientFileTransfer *self, con
+ g_assert(FALSE);
+ }
+ g_free(check_intf_regex_str);
+- self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, OBEXCLIENT_FILE_TRANSFER_DBUS_INTERFACE);
++ self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", dbus_object_path, OBEXCLIENT_FILE_TRANSFER_DBUS_INTERFACE);
+ }
+
+ static void _obexclient_file_transfer_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
+diff --git a/src/lib/obexd/obexclient_file_transfer.h b/src/lib/obexd/obexclient_file_transfer.h
+index 5e796b2..750d411 100644
+--- a/src/lib/obexd/obexclient_file_transfer.h
++++ b/src/lib/obexd/obexclient_file_transfer.h
+@@ -26,7 +26,7 @@
+
+ #include <glib-object.h>
+
+-#define OBEXCLIENT_FILE_TRANSFER_DBUS_INTERFACE "org.openobex.FileTransfer"
++#define OBEXCLIENT_FILE_TRANSFER_DBUS_INTERFACE "org.bluez.obex.FileTransfer"
+
+ /*
+ * Type macros
+diff --git a/src/lib/obexd/obexclient_session.c b/src/lib/obexd/obexclient_session.c
+index a5b52f8..3b882d1 100644
+--- a/src/lib/obexd/obexclient_session.c
++++ b/src/lib/obexd/obexclient_session.c
+@@ -133,7 +133,7 @@ static void obexclient_session_post_init(OBEXClientSession *self, const gchar *d
+ GError *error = NULL;
+
+ /* Getting introspection XML */
+- self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, "org.freedesktop.DBus.Introspectable");
++ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", dbus_object_path, "org.freedesktop.DBus.Introspectable");
+ self->priv->introspection_xml = NULL;
+ if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) {
+ g_critical("%s", error->message);
+@@ -146,7 +146,7 @@ static void obexclient_session_post_init(OBEXClientSession *self, const gchar *d
+ g_assert(FALSE);
+ }
+ g_free(check_intf_regex_str);
+- self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, OBEXCLIENT_SESSION_DBUS_INTERFACE);
++ self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", dbus_object_path, OBEXCLIENT_SESSION_DBUS_INTERFACE);
+
+ /* Properties init */
+ GHashTable *properties = obexclient_session_get_properties(self, &error);
+diff --git a/src/lib/obexd/obexclient_session.h b/src/lib/obexd/obexclient_session.h
+index 87af06d..bffd844 100644
+--- a/src/lib/obexd/obexclient_session.h
++++ b/src/lib/obexd/obexclient_session.h
+@@ -26,7 +26,7 @@
+
+ #include <glib-object.h>
+
+-#define OBEXCLIENT_SESSION_DBUS_INTERFACE "org.openobex.Session"
++#define OBEXCLIENT_SESSION_DBUS_INTERFACE "org.bluez.obex.Session"
+
+ /*
+ * Type macros
+diff --git a/src/lib/obexd/obexclient_transfer.c b/src/lib/obexd/obexclient_transfer.c
+index 68c4bf3..e11e2d4 100644
+--- a/src/lib/obexd/obexclient_transfer.c
++++ b/src/lib/obexd/obexclient_transfer.c
+@@ -133,7 +133,7 @@ static void obexclient_transfer_post_init(OBEXClientTransfer *self, const gchar
+ GError *error = NULL;
+
+ /* Getting introspection XML */
+- self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, "org.freedesktop.DBus.Introspectable");
++ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", dbus_object_path, "org.freedesktop.DBus.Introspectable");
+ self->priv->introspection_xml = NULL;
+ if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) {
+ g_critical("%s", error->message);
+@@ -146,7 +146,7 @@ static void obexclient_transfer_post_init(OBEXClientTransfer *self, const gchar
+ g_assert(FALSE);
+ }
+ g_free(check_intf_regex_str);
+- self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, OBEXCLIENT_TRANSFER_DBUS_INTERFACE);
++ self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", dbus_object_path, OBEXCLIENT_TRANSFER_DBUS_INTERFACE);
+
+ /* Properties init */
+ GHashTable *properties = obexclient_transfer_get_properties(self, &error);
+diff --git a/src/lib/obexd/obexclient_transfer.h b/src/lib/obexd/obexclient_transfer.h
+index f84fd69..f92e790 100644
+--- a/src/lib/obexd/obexclient_transfer.h
++++ b/src/lib/obexd/obexclient_transfer.h
+@@ -26,7 +26,7 @@
+
+ #include <glib-object.h>
+
+-#define OBEXCLIENT_TRANSFER_DBUS_INTERFACE "org.openobex.Transfer"
++#define OBEXCLIENT_TRANSFER_DBUS_INTERFACE "org.bluez.obex.Transfer"
+
+ /*
+ * Type macros
+diff --git a/src/lib/obexd/obexmanager.c b/src/lib/obexd/obexmanager.c
+index 1e3e0d4..c77daad 100644
+--- a/src/lib/obexd/obexmanager.c
++++ b/src/lib/obexd/obexmanager.c
+@@ -134,7 +134,7 @@ static void obexmanager_init(OBEXManager *self)
+ GError *error = NULL;
+
+ /* Getting introspection XML */
+- self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", OBEXMANAGER_DBUS_PATH, "org.freedesktop.DBus.Introspectable");
++ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex", OBEXMANAGER_DBUS_PATH, "org.freedesktop.DBus.Introspectable");
+ self->priv->introspection_xml = NULL;
+ if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) {
+ g_critical("%s", error->message);
+@@ -148,7 +148,7 @@ static void obexmanager_init(OBEXManager *self)
+ }
+ g_free(check_intf_regex_str);
+
+- self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", OBEXMANAGER_DBUS_PATH, OBEXMANAGER_DBUS_INTERFACE);
++ self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex", OBEXMANAGER_DBUS_PATH, OBEXMANAGER_DBUS_INTERFACE);
+
+ /* DBus signals connection */
+
+diff --git a/src/lib/obexd/obexmanager.h b/src/lib/obexd/obexmanager.h
+index 203fe59..c0fe168 100644
+--- a/src/lib/obexd/obexmanager.h
++++ b/src/lib/obexd/obexmanager.h
+@@ -27,7 +27,7 @@
+ #include <glib-object.h>
+
+ #define OBEXMANAGER_DBUS_PATH "/"
+-#define OBEXMANAGER_DBUS_INTERFACE "org.openobex.Manager"
++#define OBEXMANAGER_DBUS_INTERFACE "org.bluez.obex.Manager"
+
+ /*
+ * Type macros
+diff --git a/src/lib/obexd/obexsession.c b/src/lib/obexd/obexsession.c
+index 48380cf..49cbeed 100644
+--- a/src/lib/obexd/obexsession.c
++++ b/src/lib/obexd/obexsession.c
+@@ -120,7 +120,7 @@ static void obexsession_post_init(OBEXSession *self, const gchar *dbus_object_pa
+ GError *error = NULL;
+
+ /* Getting introspection XML */
+- self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", dbus_object_path, "org.freedesktop.DBus.Introspectable");
++ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex", dbus_object_path, "org.freedesktop.DBus.Introspectable");
+ self->priv->introspection_xml = NULL;
+ if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) {
+ g_critical("%s", error->message);
+@@ -133,7 +133,7 @@ static void obexsession_post_init(OBEXSession *self, const gchar *dbus_object_pa
+ g_assert(FALSE);
+ }
+ g_free(check_intf_regex_str);
+- self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", dbus_object_path, OBEXSESSION_DBUS_INTERFACE);
++ self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex", dbus_object_path, OBEXSESSION_DBUS_INTERFACE);
+
+ /* Properties init */
+ GHashTable *properties = obexsession_get_properties(self, &error);
+diff --git a/src/lib/obexd/obexsession.h b/src/lib/obexd/obexsession.h
+index d39e15f..c045859 100644
+--- a/src/lib/obexd/obexsession.h
++++ b/src/lib/obexd/obexsession.h
+@@ -26,7 +26,8 @@
+
+ #include <glib-object.h>
+
+-#define OBEXSESSION_DBUS_INTERFACE "org.openobex.Session"
++#define OBEXSESSION_DBUS_INTERFACE "org.bluez.obex.Session"
++
+
+ /*
+ * Type macros
+diff --git a/src/lib/obexd/obextransfer.c b/src/lib/obexd/obextransfer.c
+index 78dcf52..94c5979 100644
+--- a/src/lib/obexd/obextransfer.c
++++ b/src/lib/obexd/obextransfer.c
+@@ -130,7 +130,7 @@ static void obextransfer_post_init(OBEXTransfer *self, const gchar *dbus_object_
+ GError *error = NULL;
+
+ /* Getting introspection XML */
+- self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", dbus_object_path, "org.freedesktop.DBus.Introspectable");
++ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex", dbus_object_path, "org.freedesktop.DBus.Introspectable");
+ self->priv->introspection_xml = NULL;
+ if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) {
+ g_critical("%s", error->message);
+@@ -143,7 +143,7 @@ static void obextransfer_post_init(OBEXTransfer *self, const gchar *dbus_object_
+ g_assert(FALSE);
+ }
+ g_free(check_intf_regex_str);
+- self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", dbus_object_path, OBEXTRANSFER_DBUS_INTERFACE);
++ self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex", dbus_object_path, OBEXTRANSFER_DBUS_INTERFACE);
+
+ /* DBus signals connection */
+
+diff --git a/src/lib/obexd/obextransfer.h b/src/lib/obexd/obextransfer.h
+index 99f3084..3ccdcbd 100644
+--- a/src/lib/obexd/obextransfer.h
++++ b/src/lib/obexd/obextransfer.h
+@@ -26,7 +26,7 @@
+
+ #include <glib-object.h>
+
+-#define OBEXTRANSFER_DBUS_INTERFACE "org.openobex.Transfer"
++#define OBEXTRANSFER_DBUS_INTERFACE "org.bluez.obex.Transfer"
+
+ /*
+ * Type macros
+--
+1.7.9.5
+
diff --git a/patches/0001-compat-wireless-usb-missing-macro.patch b/patches/0001-compat-wireless-usb-missing-macro.patch
--- /dev/null
@@ -0,0 +1,30 @@
+--- a/drivers/bluetooth/btusb.c 2012-10-29 17:00:17.000000000 +0200
++++ b/drivers/bluetooth/btusb.c 2012-10-31 15:32:19.000000000 +0200
+@@ -29,6 +29,27 @@
+
+ #define VERSION "0.6"
+
++/**
++ * USB_VENDOR_AND_INTERFACE_INFO - describe a specific usb vendor with a class of usb interfaces
++ * @vend: the 16 bit USB Vendor ID
++ * @cl: bInterfaceClass value
++ * @sc: bInterfaceSubClass value
++ * @pr: bInterfaceProtocol value
++ *
++ * This macro is used to create a struct usb_device_id that matches a
++ * specific vendor with a specific class of interfaces.
++ *
++ * This is especially useful when explicitly matching devices that have
++ * vendor specific bDeviceClass values, but standards-compliant interfaces.
++ */
++#define USB_VENDOR_AND_INTERFACE_INFO(vend, cl, sc, pr) \
++ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
++ | USB_DEVICE_ID_MATCH_VENDOR, \
++ .idVendor = (vend), \
++ .bInterfaceClass = (cl), \
++ .bInterfaceSubClass = (sc), \
++ .bInterfaceProtocol = (pr)
++
+ static bool ignore_dga;
+ static bool ignore_csr;
+ static bool ignore_sniffer;
diff --git a/patches/0001-libnl-add-lnl-genl-to-default-configuration.patch b/patches/0001-libnl-add-lnl-genl-to-default-configuration.patch
--- /dev/null
@@ -0,0 +1,24 @@
+From 395c60c2bc00f9f2685d662c006736e2fa562808 Mon Sep 17 00:00:00 2001
+From: Eyal Reizer <eyalr@ti.com>
+Date: Mon, 24 Sep 2012 16:39:19 +0300
+Subject: [PATCH] libnl: add lnl-genl to default configuration
+
+Signed-off-by: Eyal Reizer <eyalr@ti.com>
+---
+ libnl-2.0.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libnl-2.0.pc.in b/libnl-2.0.pc.in
+index e44f0fb..0bca566 100644
+--- a/libnl-2.0.pc.in
++++ b/libnl-2.0.pc.in
+@@ -6,5 +6,5 @@ includedir=@includedir@
+ Name: libnl
+ Description: Convenience library for netlink sockets
+ Version: @PACKAGE_VERSION@
+-Libs: -L${libdir} -lnl
++Libs: -L${libdir} -lnl -lnl-genl
+ Cflags: -I${includedir}
+--
+1.7.9.5
+
diff --git a/patches/0001-obexd-ftp-and-opp-cancel-security.patch b/patches/0001-obexd-ftp-and-opp-cancel-security.patch
--- /dev/null
@@ -0,0 +1,40 @@
+From c3ed238ea7767dd7b8c1e17ce8b3db987f282d7a Mon Sep 17 00:00:00 2001
+From: Vita Preskovsky <vitap@ti.com>
+Date: Sun, 11 Nov 2012 17:31:42 +0200
+Subject: [PATCH] obexd: ftp and opp cancel security
+
+---
+ plugins/ftp.c | 2 +-
+ plugins/opp.c | 3 ++-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/plugins/ftp.c b/plugins/ftp.c
+index ff4b761..1358b9f 100644
+--- a/plugins/ftp.c
++++ b/plugins/ftp.c
+@@ -521,7 +521,7 @@ static struct obex_service_driver ftp = {
+ .service = OBEX_FTP,
+ .channel = FTP_CHANNEL,
+ .port = OBEX_PORT_RANDOM,
+- .secure = TRUE,
++ .secure = FALSE,
+ .record = FTP_RECORD,
+ .target = FTP_TARGET,
+ .target_size = TARGET_SIZE,
+diff --git a/plugins/opp.c b/plugins/opp.c
+index c7ddc63..4b5b8ab 100644
+--- a/plugins/opp.c
++++ b/plugins/opp.c
+@@ -228,7 +228,8 @@ static struct obex_service_driver driver = {
+ .get = opp_get,
+ .put = opp_put,
+ .chkput = opp_chkput,
+- .reset = opp_reset
++ .reset = opp_reset,
++ .secure = FALSE
+ };
+
+ static int opp_init(void)
+--
+1.7.9.5
+
diff --git a/patches/0001-openssl-1.0.0d-new-target-os-for-configure.patch b/patches/0001-openssl-1.0.0d-new-target-os-for-configure.patch
--- /dev/null
@@ -0,0 +1,28 @@
+From 43944030bd0396fa2a2d30921dfd03569aff31c5 Mon Sep 17 00:00:00 2001
+From: Vita Preskovsky <vitap@ti.com>
+Date: Mon, 5 Mar 2012 23:20:35 +0200
+Subject: [PATCH] openssl-1.0.0d: new target os for configure
+
+* linux-elf-arm target to configure
+
+
+Signed-off-by: Vita Preskovsky <vitap@ti.com>
+---
+ Configure | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/Configure b/Configure
+index 429ab2e..17fe31e 100755
+--- a/Configure
++++ b/Configure
+@@ -341,6 +341,7 @@ my %table=(
+ # It's believed that majority of ARM toolchains predefine appropriate -march.
+ # If you compiler does not, do complement config command line with one!
+ "linux-armv4", "gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-elf-arm","$ENV{'CC'}:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ #### IA-32 targets...
+ "linux-ia32-icc", "icc:-DL_ENDIAN -DTERMIO -O2 -no_cpprt::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ "linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+--
+1.7.0.4
+
diff --git a/patches/0001-pygobject-python-includes.patch b/patches/0001-pygobject-python-includes.patch
--- /dev/null
@@ -0,0 +1,53 @@
+--- a/configure.ac 2009-12-25 19:06:22.000000000 +0200
++++ b/configure.ac 2012-10-30 16:59:12.000000000 +0200
+@@ -77,10 +77,12 @@
+
+ AC_MSG_CHECKING([for PySignal_SetWakeupFd in Python.h])
+ py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`
+-if test -x "$PYTHON-config"; then
+-PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
+-else
+-PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
++if test -z $PYTHON_INCLUDES; then
++ if test -x "$PYTHON-config"; then
++ PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
++ else
++ PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
++ fi
+ fi
+ old_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="-Wall -Werror $PYTHON_INCLUDES"
+--- a/m4/python.m4 2009-12-18 11:03:34.000000000 +0200
++++ b/m4/python.m4 2012-10-30 17:41:19.000000000 +0200
+@@ -45,6 +45,7 @@
+ dnl deduce PYTHON_INCLUDES
+ py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`
+ py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"`
++if test -z "$PYTHON_INCLUDES"; then
+ if test -x "$PYTHON-config"; then
+ PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
+ else
+@@ -53,6 +54,7 @@
+ PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+ >fi
+ fi
++fi
+ AC_SUBST(PYTHON_INCLUDES)
+ dnl check if the headers exist:
+ save_CPPFLAGS="$CPPFLAGS"
+@@ -236,6 +238,7 @@
+ dnl deduce PYTHON_INCLUDES
+ py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`
+ py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"`
++if test -z "$PYTHON_INCLUDES"; then
+ if test -x "$PYTHON-config"; then
+ PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
+ else
+@@ -244,6 +247,7 @@
+ PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+ fi
+ fi
++fi
+ AC_SUBST(PYTHON_INCLUDES)
+ dnl check if the headers exist:
+ save_CPPFLAGS="$CPPFLAGS"
diff --git a/patches/0001-wl12xx-additional-two-members-for-wl12xx_platform_da.patch b/patches/0001-wl12xx-additional-two-members-for-wl12xx_platform_da.patch
--- /dev/null
@@ -0,0 +1,30 @@
+From 351a513dabfb55c3aab448613c2b10b7b5788d93 Mon Sep 17 00:00:00 2001
+From: Vita Preskovsky <vitap@ti.com>
+Date: Sun, 1 Jul 2012 11:49:30 +0300
+Subject: [PATCH] wl12xx: additional two members for wl12xx_platform_data
+
+ * Adding bt_enable_gpio and wlan_enable_gpio to wl12xx_platform_data.
+ This is needed in order to align this structure
+ with the one which is part of the linux kernel
+
+
+Signed-off-by: Vita Preskovsky <vitap@ti.com>
+---
+ include/linux/wl12xx.h | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
+index 0d63731..535058e 100644
+--- a/include/linux/wl12xx.h
++++ b/include/linux/wl12xx.h
+@@ -54,6 +54,8 @@ struct wl12xx_platform_data {
+ int board_ref_clock;
+ int board_tcxo_clock;
+ unsigned long platform_quirks;
++ int bt_enable_gpio;
++ int wlan_enable_gpio;
+ bool pwr_in_suspend;
+
+ struct wl1271_if_operations *ops;
+--
+1.7.0.4
diff --git a/patches/0002-bluez-define-macro-lacking-in-compiler.patch b/patches/0002-bluez-define-macro-lacking-in-compiler.patch
--- /dev/null
@@ -0,0 +1,34 @@
+From 9c87b79edd1e92ba969eb43e7b8dcc1f3bd7c419 Mon Sep 17 00:00:00 2001
+From: Vita Preskovsky <vitap@ti.com>
+Date: Tue, 30 Oct 2012 10:12:43 +0200
+Subject: [PATCH] bluez: define macro lacking in compiler
+
+ * SO_DOMAIN and SO_PROTOCOL macros are lacking in arago
+ cross compiler.
+
+
+Signed-off-by: Vita Preskovsky <vitap@ti.com>
+---
+ btio/btio.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/btio/btio.c b/btio/btio.c
+index 9557503..e3b7088 100644
+--- a/btio/btio.c
++++ b/btio/btio.c
+@@ -38,6 +38,12 @@
+
+ #include "btio.h"
+
++#ifndef SO_PROTOCOL
++#define SO_PROTOCOL 38
++#endif
++#ifndef SO_DOMAIN
++#define SO_DOMAIN 39
++#endif
+ #ifndef BT_FLUSHABLE
+ #define BT_FLUSHABLE 8
+ #endif
+--
+1.7.9.5
+
diff --git a/patches/0003-socket-enable-for-bluez-4_98.patch b/patches/0003-socket-enable-for-bluez-4_98.patch
--- /dev/null
@@ -0,0 +1,25 @@
+From e142a28897c0b0fe9e61259a96dad6fb9f818ecd Mon Sep 17 00:00:00 2001
+From: Moosa <moosa.baransi@babcomsoftware.com>
+Date: Wed, 22 Feb 2012 10:06:37 +0200
+Subject: [PATCH] socket enable for bluez 0_98
+
+* This is necessary for working with A2DP
+---
+ audio/audio.conf | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/audio/audio.conf b/audio/audio.conf
+index 302e046..9533ada 100644
+--- a/audio/audio.conf
++++ b/audio/audio.conf
+@@ -3,6 +3,7 @@
+ # This section contains options which are not specific to any
+ # particular interface
+ [General]
++Enable=Socket
+
+ # Switch to master role for incoming connections (defaults to true)
+ #Master=true
+--
+1.7.1
+
diff --git a/patches/0004-bluez-enable-source-interface.patch b/patches/0004-bluez-enable-source-interface.patch
--- /dev/null
@@ -0,0 +1,31 @@
+From 87bcf52a6e9f2ec018bab9dd0da2a2b844b37108 Mon Sep 17 00:00:00 2001
+From: Moosa <moosab@ti.com>
+Date: Wed, 14 Mar 2012 16:43:57 +0200
+Subject: [PATCH] bluez: enable source interface
+
+Enable Source interface on D-Bus that can be used to access
+the Sink functionality
+
+Upstream-Status: Inappropriate [enable feature]
+
+Signed-off-by: Moosa Baransi <moosab@ti.com>
+---
+ audio/audio.conf | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/audio/audio.conf b/audio/audio.conf
+index 9533ada..b554936 100644
+--- a/audio/audio.conf
++++ b/audio/audio.conf
+@@ -3,7 +3,7 @@
+ # This section contains options which are not specific to any
+ # particular interface
+ [General]
+-Enable=Socket
++Enable=Socket,Source
+
+ # Switch to master role for incoming connections (defaults to true)
+ #Master=true
+--
+1.7.1
+
diff --git a/patches/0005-bluez-enable-gatt.patch b/patches/0005-bluez-enable-gatt.patch
--- /dev/null
@@ -0,0 +1,22 @@
+From 49ffdb67be763d92e4c103ebece9dd38605f50cf Mon Sep 17 00:00:00 2001\r
+From: Chen Ganir <chen.ganir@ti.com>\r
+Date: Tue, 30 Oct 2012 10:04:45 +0200\r
+Subject: [PATCH 2/3] enable gatt\r
+\r
+---\r
+ src/main.conf | 2 +-\r
+ 1 file changed, 1 insertion(+), 1 deletion(-)\r
+\r
+diff --git a/src/main.conf b/src/main.conf\r
+index 787ef4f..dfe4471 100644\r
+--- a/src/main.conf\r
++++ b/src/main.conf\r
+@@ -61,4 +61,4 @@ NameResolving = true\r
+ DebugKeys = false\r
+ \r
+ # Enable the GATT functionality. Default is false\r
+-EnableGatt = false\r
++EnableGatt = true\r
+-- \r
+1.7.9.5\r
+\r
diff --git a/patches/0006-bluez-fix-missing-include-directive.patch b/patches/0006-bluez-fix-missing-include-directive.patch
--- /dev/null
@@ -0,0 +1,32 @@
+From c95a7cfb60e8601a238d4568dc9f20699aa64a70 Mon Sep 17 00:00:00 2001\r
+From: Chen Ganir <chen.ganir@ti.com>\r
+Date: Tue, 30 Oct 2012 10:05:08 +0200\r
+Subject: [PATCH 3/3] fix missing include directive\r
+\r
+---\r
+ test/rctest.c | 2 +-\r
+ 1 file changed, 1 insertion(+), 1 deletion(-)\r
+\r
+diff --git a/test/rctest.c b/test/rctest.c\r
+index ac341b0..4a306b5 100644\r
+--- a/test/rctest.c\r
++++ b/test/rctest.c\r
+@@ -38,6 +38,7 @@\r
+ #include <sys/time.h>\r
+ #include <sys/ioctl.h>\r
+ #include <sys/socket.h>\r
++#include <sys/stat.h>\r
+ \r
+ #include <bluetooth/bluetooth.h>\r
+ #include <bluetooth/hci.h>\r
+@@ -45,7 +46,6 @@\r
+ #include <bluetooth/rfcomm.h>\r
+ #include <bluetooth/sdp.h>\r
+ #include <bluetooth/sdp_lib.h>\r
+-\r
+ /* Test modes */\r
+ enum {\r
+ SEND,\r
+-- \r
+1.7.9.5\r
+\r
diff --git a/scripts/uim/uim-sysfs.sh b/scripts/uim/uim-sysfs.sh
--- /dev/null
+++ b/scripts/uim/uim-sysfs.sh
@@ -0,0 +1,24 @@
+#! /bin/sh
+
+uim=/usr/sbin/uim
+
+test -x "$uim" || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting uim-sysfs daemon"
+ start-stop-daemon --start --quiet --exec $uim &
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping uim-sysfs daemon"
+ start-stop-daemon --stop --quiet --pidfile /var/run/uim.pid
+ echo "."
+ ;;
+ *)
+ echo "Usage: /etc/init.d/uim-sysfs.sh {start|stop}"
+ exit 1
+esac
+
+exit 0
+
diff --git a/scripts/uim/uim-sysfs_for_SDK_7.sh b/scripts/uim/uim-sysfs_for_SDK_7.sh
--- /dev/null
@@ -0,0 +1,33 @@
+#! /bin/sh
+
+NODE=`cd /sys; find . | grep kim | grep install`
+if [ $NODE ]
+then
+ echo UIM SYSFS Node Found at /sys/$NODE
+else
+ echo UIM SYSFS Node Not Found
+ exit 0
+fi
+
+uim="/usr/bin/uim"
+uim_args="-f `dirname /sys/$NODE`"
+
+test -x "$uim" || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting uim-sysfs daemon"
+ start-stop-daemon --start --quiet --pidfile /var/run/uim.pid --make-pidfile --exec $uim -- $uim_args &
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping uim-sysfs daemon"
+ start-stop-daemon --stop --quiet --pidfile /var/run/uim.pid
+ echo "."
+ ;;
+ *)
+ echo "Usage: /etc/init.d/uim-sysfs.sh {start|stop}"
+ exit 1
+esac
+
+exit 0
\ No newline at end of file
diff --git a/setup-env.sample b/setup-env.sample
--- /dev/null
+++ b/setup-env.sample
@@ -0,0 +1,41 @@
+# \\\//
+# -(o o)-
+#========================oOO==(_)==OOo=======================
+#
+# This file contains the exports needed for automating the
+# build process of WLAN/Bluetooth components.
+# Place this file in the same directory with wl12xx_build.sh/wl12xx_build_bt.sh
+# build scripts. No need to run 'source setup-env', the build
+# scripts will perfom it internaly.
+#
+#===========================================================
+# User specific environment settings
+export CROSS_COMPILE="arm-none-linux-gnueabi-"
+export PATH="$PATH:<toolchain path>"
+export ROOTFS=<path to root filesystem>
+export WORK_SPACE=<working directory>
+export KLIB_BUILD=<linux-kernel>
+export BUILD_VERSION="r8"
+# MACHINE_TYPE - The target machine type. Can have one of the following values: "am1808" , "omap3evm" , "am335x"
+# This is needed to build bluetooth components.
+# This parameter is not relevant for ti814x board.
+export MACHINE_TYPE="am335x"
+
+#===========================================================
+export ARCH="arm"
+export MY_PREFIX="/usr"
+export MY_SYSCONFDIR="/etc"
+export MY_LOCALSTATEDIR="/var"
+export CC="${CROSS_COMPILE}gcc"
+export CXX="${CROSS_COMPILE}g++"
+export AR="${CROSS_COMPILE}ar"
+export RANLIB="${CROSS_COMPILE}ranlib"
+export CFLAGS="${CFLAGS} -I${ROOTFS}${MY_PREFIX}/include"
+export CPPFLAGS="${CFLAGS}"
+export LDFLAGS="${LDFLAGS} -L${ROOTFS}${MY_PREFIX}/lib"
+export PKG_CONFIG_SYSROOT_DIR=${ROOTFS}
+export PKG_CONFIG_PATH="${ROOTFS}${MY_PREFIX}/lib/pkgconfig:${ROOTFS}/lib/pkgconfig"
+export PKG_CONFIG_LIBDIR=""
+export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=""
+export PKG_CONFIG_ALLOW_SYSTEM_LIBS=""
+LS=/bin/ls
diff --git a/wl12xx_build_bt.sh b/wl12xx_build_bt.sh
--- /dev/null
+++ b/wl12xx_build_bt.sh
@@ -0,0 +1,747 @@
+#!/bin/bash
+
+# \\\//
+# -(o o)-
+#========================oOO==(_)==OOo=======================
+#
+# This file contains the Bluetooth components which should
+# be built and installed on the target filesystem
+#
+
+
+function usage()
+{
+ echo
+ echo
+ echo "************************************"
+ echo "* Bluetooth Modules Builder Script *"
+ echo "************************************"
+ echo
+ echo "This script compiles the BT modules components"
+ echo "The script can build each component as standalone by invoking: \"./wl12xx_build_bt.sh <module name> <build/rebuild>\""
+ echo "For example: \"./wl12xx_build_bt.sh bt-modules rebuild\""
+ echo
+ echo "Available components are:"
+ echo "bt-modules, expat, dbus, libIConv, zlib, gettext, glib, dbus-glib, check, bluez, hcidump, ncurses"
+ echo "readline, alsa-lib, openobex, libical, obexd, bt-obex, firmware, wl1271-demo, bt-enable"
+ echo
+ echo "You may also build all components by typing: \"./wl12xx_build_bt.sh all build\""
+ echo
+ echo "Prerequisites"
+ echo "============="
+ echo "The following variables should be exported in order to run the script:"
+ echo "1) ROOTFS - should point to the root filesystem where the BT components will be installed"
+ echo "2) WORK_SPACE - should point to the workspace where the components will be downloaded and compiled"
+ echo "3) KLIB_BUILD - should point to the kernel which the compat bluetooth will be compiled against."
+ echo "4) Path to cross compiler in PATH"
+ echo ""
+}
+
+function all()
+{
+ get_machine_used
+ bt-modules 1
+ expat 1
+ dbus 1
+ libIConv 1
+ zlib 1
+ gettext 1
+ glib 1
+ dbus-glib 1
+ check 1
+ bluez 1
+ hcidump 1
+ ncurses 1
+ readline 1
+ alsa-lib 1
+ openobex 1
+ libical 1
+ obexd 1
+ bt-obex 1
+ firmware 1
+ wl1271-demo 1
+ bt-enable 1
+}
+
+function apply_patches()
+{
+ [ ! -e $LS ] && echo "Please set full path of ls utility in setup-env file." && exit 1
+ files=`$LS *.patch`
+ for f in ${files}; do patch -p1 -i ${f} || exit 1; done
+ return 0
+}
+function bt-modules()
+{
+ if [ x"$KLIB_BUILD" = "x" ]; then
+ echo "Please set KLIB_BUILD variable to point to your Linux kernel"
+ exit 1
+ fi
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="ti-compat-bluetooth-2012-02-20.tar.gz"
+ COMPONENT_DIR="compat-bluetooth"
+ download_component "https://gforge.ti.com/gf/download/frsrelease/802/5435/ti-compat-bluetooth-2012-02-20.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ [ ! -e Compat-patch-zip-v1.zip ] && { wget http://processors.wiki.ti.com/images/9/99/Compat-patch-zip-v1.zip || exit 1; }
+ unzip -o Compat-patch-zip-v1.zip || exit 1
+ apply_patches
+
+ ./scripts/driver-select bt || exit 1
+ make KLIB=${ROOTFS} INSTALL_MOD_PATH=${ROOTFS} "install-modules" || exit 1
+ add_fingerprint 1
+ fi
+ echo "bt-modules built successfully"
+}
+
+function expat()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="expat-2.0.1.tar.gz"
+ COMPONENT_DIR="expat-2.0.1"
+
+ download_component "http://downloads.sourceforge.net/project/expat/expat/2.0.1/expat-2.0.1.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} 2>&1>${BUILD_LOG_FILE} || exit 1
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "expat built successfully"
+}
+
+
+function dbus()
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="dbus-1.4.1.tar.gz"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ expat
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="dbus-1.4.1.tar.gz"
+ COMPONENT_DIR="dbus-1.4.1"
+ download_component "http://dbus.freedesktop.org/releases/dbus/dbus-1.4.1.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "ac_cv_func_pipe2=no" > arm-linux.cache || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache --disable-inotify --without-x 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ echo "messagebus:x:102:105::${MY_LOCALSTATEDIR}/run/dbus:/bin/false" >> ${ROOTFS}${MY_SYSCONFDIR}/passwd || exit 1
+ add_fingerprint 1
+ fi
+ echo "dbus built successfully"
+}
+
+
+function libIConv()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="libiconv-1.13.1.tar.gz"
+ COMPONENT_DIR="libiconv-1.13.1"
+ download_component "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "libIConv built successfully"
+}
+
+function zlib()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="zlib-1.2.7.tar.gz"
+ COMPONENT_DIR="zlib-1.2.7"
+ download_component "http://zlib.net/zlib-1.2.7.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "zlib built successfully"
+}
+
+function gettext()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="gettext-0.18.tar.gz"
+ COMPONENT_DIR="gettext-0.18"
+ download_component "http://ftp.gnu.org/gnu/gettext/gettext-0.18.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "ac_cv_func_unsetenv=no" > arm-linux.cache || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "gettext built successfully"
+}
+
+function glib()
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="glib-2.24.1.tar.bz2"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ libIConv
+ zlib
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="glib-2.24.1.tar.bz2"
+ COMPONENT_DIR="glib-2.24.1"
+ download_component "http://ftp.gnome.org/pub/GNOME/sources/glib/2.24/glib-2.24.1.tar.bz2"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "glib_cv_stack_grows=no
+ glib_cv_uscore=yes
+ ac_cv_func_posix_getpwuid_r=yes
+ ac_cv_func_posix_getgrgid_r=yes
+ ac_cv_func_pipe2=no" > arm-linux.cache || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache --with-libiconv=gnu 2>&1>>${BUILD_LOG_FILE} || exit 1
+ sed -i 's/\(^Libs: .*\)/\1 -liconv/g' glib-2.0.pc || exit 1
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "glib built successfully"
+}
+
+function dbus-glib()
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="dbus-glib-0.84.tar.gz"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ dbus
+ glib
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="dbus-glib-0.84.tar.gz"
+ COMPONENT_DIR="dbus-glib-0.84"
+ download_component "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-0.84.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ echo "ac_cv_have_abstract_sockets=yes" > arm-linux.cache || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache 2>&1>>${BUILD_LOG_FILE} || exit 1
+ sed -i 's/examples//g' dbus/Makefile || exit 1
+ sed -i 's/tools test/test/g' Makefile || exit 1
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "dbus-glib built successfully"
+}
+
+
+function check()
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="check-0.9.6.tar.gz"
+ COMPONENT_DIR="check-0.9.6"
+ download_component "http://downloads.sourceforge.net/check/check-0.9.6.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "check built successfully"
+}
+
+function bluez()
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="bluez-4.98.tar.gz"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ check
+ dbus
+ glib
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bluez-4.98.tar.gz"
+ COMPONENT_DIR="bluez-4.98"
+ download_component "http://kernel.org/pub/linux/bluetooth/bluez-4.98.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ [ ! -e BlueZ_patches-v2.zip ] && { wget http://processors.wiki.ti.com/images/7/7e/BlueZ_patches-v2.zip || exit 1; }
+ unzip -o BlueZ_patches-v2.zip || exit 1
+ apply_patches
+
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --enable-tools --enable-dund --enable-alsa --enable-test --enable-audio --enable-serial --enable-service --enable-hidd --enable-gstreamer --enable-usb --enable-tools --enable-bccmd --enable-hid2hci --enable-dfutool --enable-pand --disable-cups 2>&1>>${BUILD_LOG_FILE}
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ cp audio/audio.conf tools/rfcomm.conf input/input.conf ${ROOTFS}${MY_SYSCONFDIR}/bluetooth/ || exit 1
+ cp test/agent ${ROOTFS}${MY_PREFIX}/bin/agent || exit 1
+ add_fingerprint 1
+ fi
+ echo "bluez built successfully"
+}
+
+function hcidump
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bluez-hcidump-2.2.tar.gz"
+ COMPONENT_DIR="bluez-hcidump-2.2"
+ download_component "http://pkgs.fedoraproject.org/repo/pkgs/bluez-hcidump/bluez-hcidump-2.2.tar.gz/3c298a8be67099fe227f3e4d9de539d5/bluez-hcidump-2.2.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "hcidump built successfully"
+}
+
+function ncurses
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="ncurses-5.9.tar.gz"
+ COMPONENT_DIR="ncurses-5.9"
+ download_component "http://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} -with-shared --without-debug --without-normal 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "ncurses built successfully"
+}
+
+function readline
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="readline-6.2.tar.gz"
+ COMPONENT_DIR="readline-6.2"
+ download_component " http://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "readline built successfully"
+}
+
+
+function alsa-lib
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="alsa-lib-1.0.24.1.tar.gz"
+ COMPONENT_DIR="alsa-lib-1.0.26"
+ download_component "http://fossies.org/linux/misc/alsa-lib-1.0.24.1.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --prefix=${MY_PREFIX} --host=${BUILD_HOST} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "alsa-lib built successfully"
+}
+
+function openobex
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="openobex-1.5.tar.gz"
+ COMPONENT_DIR="openobex-1.5"
+ download_component "http://ftp.osuosl.org/pub/linux/bluetooth/openobex-1.5.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ # wget 'http://mirror.anl.gov/pub/linux/bluetooth/openobex-1.5.tar.gz' || exit 1
+ add_fingerprint 0
+ sed -i '11227 i *)\n;;' configure 2>&1>>${BUILD_LOG_FILE} || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --enable-apps --disable-usb 2>&1>>${BUILD_LOG_FILE} || exit 1
+ sed -i 's/^\(libdir=\).*/\1\$\{prefix\}\/lib/g' openobex.pc || exit 1
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "openobex built successfully"
+}
+
+function libical
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="libical-0.44.tar.gz"
+ COMPONENT_DIR="libical-0.44"
+ download_component "http://downloads.sourceforge.net/project/freeassociation/libical/libical-0.44/libical-0.44.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "libical built successfully"
+}
+
+function obexd
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="obexd-0.34.tar.gz"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ bluez
+ openobex
+ libical
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="obexd-0.34.tar.gz"
+ COMPONENT_DIR="obexd-0.34"
+ download_component "http://www.kernel.org/pub/linux/bluetooth/obexd-0.34.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} 2>&1>>${BUILD_LOG_FILE} || exit 1
+ wget http://processors.wiki.ti.com/images/4/43/Obexd-patches_v1.tar.gz || exit 1
+ echo "Openning archive: Obexd-patches_v1.tar.gz" && tar -xzf Obexd-patches_v1.tar.gz || exit 1
+ apply_patches
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "obexd built successfully"
+}
+
+function bt-obex
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="171181b6ef6c94aefc828dc7fd8de136b9f97532"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ dbus-glib
+ readline
+ ncurses
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="171181b6ef6c94aefc828dc7fd8de136b9f97532"
+ COMPONENT_DIR="bluez-tools"
+ download_component "git://gitorious.org/bluez-tools/bluez-tools.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ [ ! -e Bt-obex-patches.zip ] && { wget 'http://processors.wiki.ti.com/images/f/f5/Bt-obex-patches.zip' || exit 1; }
+ unzip -o Bt-obex-patches.zip || exit 1
+ apply_patches
+
+ /usr/bin/libtoolize || exit 1
+ /usr/bin/aclocal || exit 1
+ /usr/bin/autoheader || exit 1
+ /usr/bin/automake --add-missing || exit 1
+ /usr/bin/autoconf || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make 2>&1>>${BUILD_LOG_FILE} || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "bt-obex built successfully"
+}
+
+function firmware
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="db43d1f05efda9777d7ac1ac366637e29e21f77f"
+ COMPONENT_DIR="bt-firmware"
+ download_component "git://github.com/TI-ECS/bt-firmware.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ mkdir -p ${ROOTFS}/lib/firmware || exit 1
+
+ if [ x"$MACHINE_TYPE" = "x" ]; then
+ get_machine_used
+ fi
+
+ PRINT_STR="Invoking: cp ${MACHINE_TYPE}/TIInit_7.2.31.bts ${ROOTFS}/lib/firmware/"
+ echo ${PRINT_STR}
+ cp ./${MACHINE_TYPE}/TIInit_7.2.31.bts ${ROOTFS}/lib/firmware/ || exit 1
+ add_fingerprint 1
+ fi
+ echo "firmware built successfully"
+}
+
+function wl1271-demo
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="wl1271-bluetooth-2012-03-26.tar.gz"
+ COMPONENT_DIR="wl1271-bluetooth"
+ download_component "https://gforge.ti.com/gf/download/frsrelease/827/5494/wl1271-bluetooth-2012-03-26.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/gallery || exit 1
+ mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1
+ mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/ftp_folder || exit 1
+
+ if [ x"$MACHINE_TYPE" = "x" ]; then
+ get_machine_used
+ fi
+
+ cp ./gallery/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/gallery || exit 1
+ cp ./script/common/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1
+ cp ./script/${MACHINE_TYPE}/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1
+ cp ./ftp_folder/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/ftp_folder || exit 1
+ add_fingerprint 1
+ fi
+ echo "wl1271-demo built successfully"
+}
+
+function bt-enable
+{
+ cd ${WORK_SPACE} || exit 1
+ if [ x"$KLIB_BUILD" = "x" ]; then
+ echo "Please set KLIB_BUILD variable to point to your Linux kernel"
+ exit 1
+ fi
+ COMPONENT_NAME="dd75971705ada8fb0e88a0fb3f68833086c5bba4"
+ COMPONENT_DIR="bt_enable"
+ download_component "git://github.com/TI-ECS/bt_enable.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ [ ! -e Bt-enable-standalone-makefile.zip ] && { wget 'http://processors.wiki.ti.com/images/8/8f/Bt-enable-standalone-makefile.zip' || exit 1; }
+ unzip -o Bt-enable-standalone-makefile.zip || exit 1
+ apply_patches
+
+ if [ x"$MACHINE_TYPE" = "x" ]; then
+ get_machine_used
+ fi
+ cp ./gpio_en_${MACHINE_TYPE}.c ./gpio_en.c
+ make DEST_DIR=${ROOTFS} KERNEL_DIR=${KLIB_BUILD} || exit 1
+ make DEST_DIR=${ROOTFS} KERNEL_DIR=${KLIB_BUILD} install || exit 1
+ add_fingerprint 1
+ fi
+ echo "bt-enable built successfully"
+}
+
+function add_fingerprint()
+{
+ if [ x"$1" = "x" ]; then
+ echo "Function add_fingerprint() called with no parameters!!!"
+ exit 1
+ fi
+ local FILENAME="${FINGURE_PRINT_DIR}/${COMPONENT_NAME##*/}"
+ touch ${FILENAME} || exit 1
+ echo $1 > ${FILENAME} || exit
+}
+
+function fingerprint()
+{
+ local FILENAME="${FINGURE_PRINT_DIR}/${COMPONENT_NAME##*/}"
+ # if no file exists
+ if [ ! -e ${FILENAME} ]; then
+ return 0
+ fi
+ read MAX < ${FILENAME}
+ return ${MAX}
+}
+
+function download_component()
+{
+ if [ x"$1" = "x" ]; then
+ echo "Function called with no parameters!!!"
+ exit 1
+ fi
+
+ if [ ! x"${START_MODULE}" = "x" ]; then # if the START_MODULE is not empty
+ if [ ${START_MODULE} = ${COMPONENT_NAME} ]; then # if we are building the start module
+ CURRENT_OPTION=${USER_OPTION} # take the user option as is
+ else
+ CURRENT_OPTION="1" # else, we are building dependency, so we should only build not rebuild
+ fi
+ else
+ CURRENT_OPTION=${USER_OPTION} # take the user option as is
+ fi
+ # get the extension of the file
+ local EXT=${1/*./}
+
+ # check the fingerprint value
+ fingerprint
+ case "$?" in
+ 0) # 0 - File not compiled nor installed
+ CURRENT_OPTION="2" # override to "rebuild" option
+ ;;
+ 1) # 1 - File was installed properly
+ # if the option is build and fingerprint OK, nothing to do
+ if [ ${CURRENT_OPTION} = "1" ]; then
+ return
+ fi
+ ;;
+ *)
+ echo "Corrupted fingerprint for component ${COMPONENT_NAME}"
+ exit 1
+ ;;
+ esac
+# echo "Decided to rebuild for ${COMPONENT_NAME}"
+# read
+ # I get here in one situation : USER_OPTION = 2
+ case "${EXT}" in
+ git)
+ # if git directory exist, do not clone it again
+ if [ ! -d ${COMPONENT_DIR} ]; then
+ git clone $1 || exit 1
+ fi
+ cd ${COMPONENT_DIR} || exit 1
+ git reset --hard ${COMPONENT_NAME} || exit 1
+ ;;
+
+ gz|bz2)
+ # delete the working directory if exists
+ if [ ! x"${COMPONENT_DIR}" = "x" ]; then
+ rm -rf ${COMPONENT_DIR} || exit 1
+ fi
+
+ local TAR_FLAGS="-xzf"
+
+ if [ ${EXT} = "bz2" ]; then
+ TAR_FLAGS="-xjf"
+ fi
+ # if component doesn't exist, bring it
+ if [ ! -e ${COMPONENT_NAME} ]; then
+ wget $1 || exit 1
+ fi
+ echo "Openning archive: ${COMPONENT_NAME}"
+ tar ${TAR_FLAGS} ${COMPONENT_NAME} || exit 1
+ # move to the directory if not empty
+ if [ ! x"${COMPONENT_DIR}" = "x" ]; then
+ cd ${COMPONENT_DIR} || exit 1
+ fi;
+ ;;
+
+ *)
+ echo "Unknown extension of remote package"
+ exit 1
+ ;;
+ esac
+}
+
+function get_machine_used()
+{
+ # check if the machine type is already defined
+ if [ ! x"${MACHINE_TYPE}" = "x" ]; then
+ return;
+ fi
+ echo ""
+ echo "Please select the machine you use:"
+ echo "==================================="
+ echo "1. am180x-evm (am1808)"
+ echo "2. am37x-evm (omap3evm)"
+ echo "3. am335x-evm (am335x)"
+ read choice
+ case $choice in
+ 1) MACHINE_TYPE="am1808" ;;
+ 2) MACHINE_TYPE="omap3evm" ;;
+ 3) MACHINE_TYPE="am335x" ;;
+ *)
+ echo "This is not a valid choice... Exitiing script"
+ exit 1
+ ;;
+ esac
+}
+
+function check_env()
+{
+ [ -e ${WORK_SPACE}/.check_env.stamp ] && return 0
+ which dpkg
+ if [ $? -ne 0 ]
+ then
+ echo "The following packages should be installed on the system:"
+ echo "bash bison flex perl bc python python-m2crypto corkscrew"
+ echo "git autoconf automake libtool gettext patch libglib2.0-dev"
+ echo "Please check before to continue."
+ return 0
+ fi
+ err=0
+ ret=0
+ packages="bash bison flex perl bc python python-m2crypto corkscrew git autoconf automake libtool gettext patch libglib2.0-dev"
+ for p in ${packages}
+ do
+ echo -n "Checking ${p}..."
+ present=`dpkg-query -W ${p} 2>/dev/null | awk '{print $1}'`
+ [ x"${present}" != x"${p}" ] && echo "Package ${p} is not found. Please run 'apt-get install ${p}' to install it." && err=1 && ret=1
+ [ ${err} -ne 1 ] && echo "OK"
+ err=0
+ done
+ return ${ret}
+}
+############################################# MAIN ###############################################
+old_dir=`pwd`
+MACHINE_TYPE=""
+
+source setup-env || exit 1
+# if there are no sufficient arguments...
+if [ $# -lt 2 ]; then
+ usage
+ exit 0
+fi
+
+if [ x"$CROSS_COMPILE" = "x" ]; then
+ echo "define CROSS_COMPILE variable"
+ exit 1
+fi
+
+which ${CROSS_COMPILE}gcc > /dev/null
+
+if [ $? -ne 0 ]; then
+ echo "No toolchain in path"
+ exit 1
+fi
+
+BUILD_HOST=`echo $CROSS_COMPILE | sed s/-$//`
+
+if [ x"$ROOTFS" = "x" ]; then
+ echo "Please set ROOTFS variable to point to your root filesystem"
+ exit 1
+fi
+
+if [ x"$WORK_SPACE" = "x" ]; then
+ echo "Please set WORK_SPACE variable to point to your preferred work space"
+ exit 1
+fi
+
+FINGURE_PRINT_DIR="${WORK_SPACE}/.FingurePrint"
+mkdir -p ${FINGURE_PRINT_DIR} || exit 1
+check_env || exit 1
+touch ${WORK_SPACE}/.check_env.stamp
+BUILD_LOG_FILE=${FINGURE_PRINT_DIR}/build.log
+USER_OPTION=0
+CURRENT_OPTION=0
+
+case "$2" in
+ build)
+ USER_OPTION=1
+ ;;
+ rebuild)
+ USER_OPTION=2
+ ;;
+ *)
+ echo "Unknown option $2"
+ exit 1
+ ;;
+esac
+
+CURRENT_OPTION=${USER_OPTION}
+
+MODULE_TO_INVOKE=$1
+$MODULE_TO_INVOKE 1
+
+cd ${old_dir}
diff --git a/wl18xx_build_ble.sh b/wl18xx_build_ble.sh
--- /dev/null
+++ b/wl18xx_build_ble.sh
@@ -0,0 +1,450 @@
+#!/bin/bash
+
+# \\\//
+# -(o o)-
+#========================oOO==(_)==OOo=======================
+#
+# This file contains the Bluetooth components which should
+# be built and installed on the target filesystem
+#
+
+BUILD_VERSION="r8"
+declare -A compat_bluetooth["r8"]="https://gforge.ti.com/gf/download/frsrelease/990/6319/compat-bluetooth-ol-r8.a5.01_Nov_12_2012.tar.gz"
+
+function usage()
+{
+ echo
+ echo
+ echo "************************************"
+ echo "* Bluetooth Modules Builder Script *"
+ echo "************************************"
+ echo
+ echo "This script compiles the BT modules components"
+ echo "The script can build each component as standalone by invoking: \"./wl18xx_build_bt.sh <module name> <build/rebuild>\""
+ echo "For example: \"./wl12xx_build_bt.sh bt-modules rebuild\""
+ echo
+ echo "Available components are:"
+ echo "bt-modules, bluez, hcidump, obexd, bt-obex, firmware, wl1271-demo"
+ echo
+ echo "You may also build all components by typing: \"./wl18xx_build_bt.sh all build\""
+ echo
+ echo "Prerequisites"
+ echo "============="
+ echo "The following variables should be exported in order to run the script:"
+ echo "1) ROOTFS - should point to the root filesystem where the BT components will be installed"
+ echo "2) WORK_SPACE - should point to the workspace where the components will be downloaded and compiled"
+ echo "3) KLIB_BUILD - should point to the kernel which the compat bluetooth will be compiled against."
+ echo "4) Path to cross compiler in PATH"
+ echo ""
+}
+
+function all()
+{
+ get_machine_used
+ bt-modules 1
+ uim 1
+ expat 1
+ libffi
+ glib 1
+ dbus 1
+ libIConv 1
+ zlib 1
+ gettext 1
+ dbus-glib 1
+ check 1
+ python 1
+ pygobject 1
+ dbus-python 1
+ bluez 1
+ hcidump 1
+ ncurses 1
+ readline 1
+ openobex 1
+ libical 1
+ obexd 1
+ bt-obex 1
+ firmware 1
+ wl1271-demo 1
+}
+
+function apply_patches()
+{
+ [ ! -e $LS ] && echo "Please set full path of ls utility in setup-env file." && exit 1
+ files=`$LS *.patch`
+ for f in ${files}; do patch -p1 -i ${f} || exit 1; done
+ return 0
+}
+function bt-modules()
+{
+ if [ x"$KLIB_BUILD" = "x" ]; then
+ echo "Please set KLIB_BUILD variable to point to your Linux kernel"
+ exit 1
+ fi
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME=`basename ${compat_bluetooth[$BUILD_VERSION]}`
+ COMPONENT_DIR="compat-bluetooth"
+ download_component "${compat_bluetooth[$BUILD_VERSION]}"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ patch -p1 -i ${old_dir}/patches/0001-compat-wireless-usb-missing-macro.patch
+
+ ./scripts/driver-select bt || exit 1
+ make KLIB=${ROOTFS} bt || exit 1
+
+ make KLIB=${ROOTFS} "install-modules" || exit 1
+ add_fingerprint 1
+ fi
+ echo "bt-modules built successfully"
+}
+
+function alsa-lib
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="alsa-lib-1.0.26.tar.gz"
+ COMPONENT_DIR="alsa-lib-1.0.26"
+ download_component "http://fossies.org/linux/misc/alsa-lib-1.0.26.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --prefix=${MY_PREFIX} --host=${BUILD_HOST} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --disable-python || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "alsa-lib built successfully"
+}
+
+function bluez()
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="bluez"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ check
+ dbus
+ glib
+ uim
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bluez"
+ #COMPONENT_REV="18a5dc6cdcf0828443c415eaea82b6834a8f9825"
+ COMPONENT_REV="70a609bb3a7401b56377de77586e09a56d631468"
+ COMPONENT_DIR="bluez"
+ download_component "git://git.kernel.org/pub/scm/bluetooth/bluez.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ patch -p1 -i ${old_dir}/patches/0001-bluez-define-_GNU_SOURCE-macro.patch || exit 1
+ patch -p1 -i ${old_dir}/patches/0002-bluez-define-macro-lacking-in-compiler.patch || exit 1
+ patch -p1 -i ${old_dir}/patches/0003-socket-enable-for-bluez-4_98.patch || exit 1
+ patch -p1 -i ${old_dir}/patches/0004-bluez-enable-source-interface.patch || exit 1
+ patch -p1 -i ${old_dir}/patches/0005-bluez-enable-gatt.patch || exit 1
+ patch -p1 -i ${old_dir}/patches/0006-bluez-fix-missing-include-directive.patch || exit 1
+ patch -p1 -i ${old_dir}/patches/0001-Enable-auto-reconnection.patch || exit 1
+
+ /usr/bin/libtoolize || exit 1
+ /usr/bin/aclocal || exit 1
+ /usr/bin/autoheader || exit 1
+ /usr/bin/automake --add-missing || exit 1
+ /usr/bin/autoconf || exit 1
+
+ LIBS='-liconv' ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --enable-alsa --enable-tools --enable-test --enable-audio --enable-serial --enable-service --enable-gstreamer --enable-usb --enable-tools --enable-bccmd --enable-hid2hci --enable-dfutool --enable-pand --disable-cups --enable-debug --enable-gatt --enable-hid2hci --enable-health
+ make LIBS='-lffi' || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ cp audio/audio.conf profiles/input/input.conf ${ROOTFS}${MY_SYSCONFDIR}/bluetooth/ || exit 1
+ cp test/agent ${ROOTFS}${MY_PREFIX}/bin/agent || exit 1
+ mkdir -p ${ROOTFS}/usr/share/bluetooth
+ list='simple-agent test-device test-discovery test-manager'
+
+ cd test
+ for i in ${list}; do sed -i -e 's/from gi\.repository //' -e 's/GObject/gobject/' $i; done
+ list='simple-agent list-devices simple-player simple-service test-adapter test-alert test-attrib test-audio test-device test-discovery test-health test-health-sink test-heartrate test-input test-manager test-nap test-network test-oob test-profile test-proximity test-sap-server test-service test-telephony test-textfile test-thermometer uuidtest rctest monitor-bluetooth mpris-player lmptest gaptest hciemu hsmicro hsplay hstest l2test attest avtest bdaddr btiotest'
+ echo "installing tests in ${ROOTFS}/usr/share/bluetooth"
+ cp ${list} ${ROOTFS}/usr/share/bluetooth
+ cd -
+ add_fingerprint 1
+ fi
+ echo "bluez built successfully"
+}
+
+function hcidump
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bluez-hcidump-2.4.tar.gz"
+ COMPONENT_DIR="bluez-hcidump-2.4"
+ download_component "http://www.kernel.org/pub/linux/bluetooth/bluez-hcidump-2.4.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ patch -p1 -i ${old_dir}/patches/0001-blueti-Add-TI-Logger-dump.patch || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "hcidump built successfully"
+}
+
+function ncurses
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="ncurses-5.9.tar.gz"
+ COMPONENT_DIR="ncurses-5.9"
+ download_component "http://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} -with-shared --without-debug --without-normal || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "ncurses built successfully"
+}
+
+function readline
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="readline-6.2.tar.gz"
+ COMPONENT_DIR="readline-6.2"
+ download_component "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "readline built successfully"
+}
+
+
+function openobex
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="openobex-1.5.tar.gz"
+ COMPONENT_DIR="openobex-1.5"
+ download_component "http://ftp.osuosl.org/pub/linux/bluetooth/openobex-1.5.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ # wget 'http://mirror.anl.gov/pub/linux/bluetooth/openobex-1.5.tar.gz' || exit 1
+ add_fingerprint 0
+ sed -i '11227 i *)\n;;' configure || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --enable-apps --disable-usb || exit 1
+ sed -i 's/^\(libdir=\).*/\1\$\{prefix\}\/lib/g' openobex.pc || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "openobex built successfully"
+}
+
+function libical
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="libical-0.44.tar.gz"
+ COMPONENT_DIR="libical-0.44"
+ download_component "http://downloads.sourceforge.net/project/freeassociation/libical/libical-0.44/libical-0.44.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "libical built successfully"
+}
+
+function obexd
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="obexd"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ bluez
+ libical
+ readline
+ ncurses
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="obexd"
+ COMPONENT_REV="2281d4fac9fec97993b0a6dc0e2ec42911eac194"
+ COMPONENT_DIR="obexd"
+ download_component "git://git.kernel.org/pub/scm/bluetooth/obexd.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ /usr/bin/libtoolize || exit 1
+ /usr/bin/aclocal || exit 1
+ /usr/bin/autoheader || exit 1
+ /usr/bin/automake --add-missing || exit 1
+ /usr/bin/autoconf || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} || exit 1
+ #patch -p1 -i ${old_dir}/patches/0001-obexd-ftp-and-opp-cancel-security.patch || exit 1
+ wget http://processors.wiki.ti.com/images/4/43/Obexd-patches_v1.tar.gz || exit 1
+ echo "Openning archive: Obexd-patches_v1.tar.gz" && tar -xzf Obexd-patches_v1.tar.gz || exit 1
+ patch -p1 -i 0001-obexd-make-OPP-push-timeout-longer.patch
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ test -d ${ROOTFS}/usr/share/bluetooth || mkdir -p ${ROOTFS}/usr/share/bluetooth
+ list='exchange-business-cards ftp-client get-capabilities list-folders map-client opp-client pbap-client'
+ for f in ${list}; do
+ install -c test/$f ${ROOTFS}/usr/share/bluetooth || exit 1
+ done
+ add_fingerprint 1
+ fi
+ echo "obexd built successfully"
+}
+
+function bt-obex
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="bluez-tools"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ dbus-glib
+ readline
+ ncurses
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bluez-tools"
+ COMPONENT_REV="171181b6ef6c94aefc828dc7fd8de136b9f97532"
+ COMPONENT_DIR="bluez-tools"
+ download_component "git://gitorious.org/bluez-tools/bluez-tools.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ [ ! -e Bt-obex-patches.zip ] && { wget 'http://processors.wiki.ti.com/images/f/f5/Bt-obex-patches.zip' || exit 1; }
+ unzip -o Bt-obex-patches.zip || exit 1
+ apply_patches
+ patch -p1 -i ${old_dir}/patches/0001-bt-obex-new-dbus-api-for-obexd.patch
+ #patch -p1 -i ${old_dir}/patches/0001-manager-adoptation-to-new-manager-interface-of-bluez.patch
+
+ /usr/bin/libtoolize || exit 1
+ /usr/bin/aclocal || exit 1
+ /usr/bin/autoheader || exit 1
+ /usr/bin/automake --add-missing || exit 1
+ /usr/bin/autoconf || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} || exit 1
+ make LIBS="-ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0 -liconv -lffi -lz -lncurses" || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "bt-obex built successfully"
+}
+
+function wl1271-demo
+{
+ START_MODULE="wl1271-bluetooth"
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="wl1271-bluetooth"
+ COMPONENT_DIR="wl1271-bluetooth"
+ COMPONENT_REV="d847b748f031ddc5f4fafed4bb3ce03e880a1057" #branch r8
+ download_component "git://github.com/TI-ECS/wl1271-bluetooth.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/gallery || exit 1
+ mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1
+ mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/ftp_folder || exit 1
+
+ if [ x"$MACHINE_TYPE" = "x" ]; then
+ get_machine_used
+ fi
+
+ cp ./gallery/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/gallery || exit 1
+ cp ./script/common/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1
+ cp ./script/${MACHINE_TYPE}/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1
+ cp ./ftp_folder/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/ftp_folder || exit 1
+ add_fingerprint 1
+ fi
+ echo "wl1271-demo built successfully"
+}
+
+function bt-enable
+{
+ cd ${WORK_SPACE} || exit 1
+ if [ x"$KLIB_BUILD" = "x" ]; then
+ echo "Please set KLIB_BUILD variable to point to your Linux kernel"
+ exit 1
+ fi
+ COMPONENT_NAME="bt_enable"
+ COMPONENT_REV="dd75971705ada8fb0e88a0fb3f68833086c5bba4"
+ COMPONENT_DIR="bt_enable"
+ download_component "git://github.com/TI-ECS/bt_enable.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ [ ! -e Bt-enable-standalone-makefile.zip ] && { wget 'http://processors.wiki.ti.com/images/8/8f/Bt-enable-standalone-makefile.zip' || exit 1; }
+ unzip -o Bt-enable-standalone-makefile.zip || exit 1
+ apply_patches
+
+ if [ x"$MACHINE_TYPE" = "x" ]; then
+ get_machine_used
+ fi
+ cp ./gpio_en_${MACHINE_TYPE}.c ./gpio_en.c
+ make DEST_DIR=${ROOTFS} KERNEL_DIR=${KLIB_BUILD} || exit 1
+ make DEST_DIR=${ROOTFS} KERNEL_DIR=${KLIB_BUILD} install || exit 1
+ add_fingerprint 1
+ fi
+ echo "bt-enable built successfully"
+}
+
+#==================================================================================
+# Main
+#==================================================================================
+old_dir=`pwd`
+MACHINE_TYPE=""
+
+source setup-env || exit 1
+source ./functions/common-functions
+# if there are no sufficient arguments...
+if [ $# -lt 2 ]; then
+ usage
+ exit 0
+fi
+
+if [ x"$CROSS_COMPILE" = "x" ]; then
+ echo "define CROSS_COMPILE variable"
+ exit 1
+fi
+
+which ${CROSS_COMPILE}gcc > /dev/null
+
+if [ $? -ne 0 ]; then
+ echo "No toolchain in path"
+ exit 1
+fi
+
+
+if [ x"$ROOTFS" = "x" ]; then
+ echo "Please set ROOTFS variable to point to your root filesystem"
+ exit 1
+fi
+
+if [ x"$WORK_SPACE" = "x" ]; then
+ echo "Please set WORK_SPACE variable to point to your preferred work space"
+ exit 1
+fi
+
+FINGURE_PRINT_DIR="${WORK_SPACE}/.FingurePrint"
+mkdir -p ${FINGURE_PRINT_DIR} || exit 1
+
+USER_OPTION=0
+CURRENT_OPTION=0
+
+case "$2" in
+ build)
+ USER_OPTION=1
+ ;;
+ rebuild)
+ USER_OPTION=2
+ ;;
+ *)
+ echo "Unknown option $2"
+ exit 1
+ ;;
+esac
+
+CURRENT_OPTION=${USER_OPTION}
+
+MODULE_TO_INVOKE=$1
+$MODULE_TO_INVOKE 1
+
+cd ${old_dir}
diff --git a/wl18xx_build_bt.sh b/wl18xx_build_bt.sh
--- /dev/null
+++ b/wl18xx_build_bt.sh
@@ -0,0 +1,430 @@
+#!/bin/bash
+
+# \\\//
+# -(o o)-
+#========================oOO==(_)==OOo=======================
+#
+# This file contains the Bluetooth components which should
+# be built and installed on the target filesystem
+#
+
+BUILD_VERSION="r8"
+declare -A compat_bluetooth["r8"]="https://gforge.ti.com/gf/download/frsrelease/990/6319/compat-bluetooth-ol-r8.a5.01_Nov_12_2012.tar.gz"
+
+function usage()
+{
+ echo
+ echo
+ echo "************************************"
+ echo "* Bluetooth Modules Builder Script *"
+ echo "************************************"
+ echo
+ echo "This script compiles the BT modules components"
+ echo "The script can build each component as standalone by invoking: \"./wl18xx_build_bt.sh <module name> <build/rebuild>\""
+ echo "For example: \"./wl12xx_build_bt.sh bt-modules rebuild\""
+ echo
+ echo "Available components are:"
+ echo "bt-modules, bluez, hcidump, obexd, bt-obex, firmware, wl1271-demo"
+ echo
+ echo "You may also build all components by typing: \"./wl18xx_build_bt.sh all build\""
+ echo
+ echo "Prerequisites"
+ echo "============="
+ echo "The following variables should be exported in order to run the script:"
+ echo "1) ROOTFS - should point to the root filesystem where the BT components will be installed"
+ echo "2) WORK_SPACE - should point to the workspace where the components will be downloaded and compiled"
+ echo "3) KLIB_BUILD - should point to the kernel which the compat bluetooth will be compiled against."
+ echo "4) Path to cross compiler in PATH"
+ echo ""
+}
+
+function all()
+{
+ get_machine_used
+ bt-modules 1
+ uim 1
+ expat 1
+ libffi
+ glib 1
+ dbus 1
+ libIConv 1
+ zlib 1
+ gettext 1
+ alsa-lib 1
+ dbus-glib 1
+ check 1
+ python 1
+ pygobject 1
+ dbus-python 1
+ bluez 1
+ hcidump 1
+ ncurses 1
+ readline 1
+ openobex 1
+ libical 1
+ obexd 1
+ bt-obex 1
+ firmware 1
+ wl1271-demo 1
+}
+
+function apply_patches()
+{
+ [ ! -e $LS ] && echo "Please set full path of ls utility in setup-env file." && exit 1
+ files=`$LS *.patch`
+ for f in ${files}; do patch -p1 -i ${f} || exit 1; done
+ return 0
+}
+function bt-modules()
+{
+ if [ x"$KLIB_BUILD" = "x" ]; then
+ echo "Please set KLIB_BUILD variable to point to your Linux kernel"
+ exit 1
+ fi
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME=`basename ${compat_bluetooth[$BUILD_VERSION]}`
+ COMPONENT_DIR="compat-bluetooth"
+ download_component "${compat_bluetooth[$BUILD_VERSION]}"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ patch -p1 -i ${old_dir}/patches/0001-compat-wireless-usb-missing-macro.patch
+
+ ./scripts/driver-select bt || exit 1
+ make KLIB=${ROOTFS} bt || exit 1
+
+ make KLIB=${ROOTFS} "install-modules" || exit 1
+ add_fingerprint 1
+ fi
+ echo "bt-modules built successfully"
+}
+
+function alsa-lib
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="alsa-lib-1.0.26.tar.gz"
+ COMPONENT_DIR="alsa-lib-1.0.26"
+ download_component "http://fossies.org/linux/misc/alsa-lib-1.0.26.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --prefix=${MY_PREFIX} --host=${BUILD_HOST} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --disable-python || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "alsa-lib built successfully"
+}
+
+function bluez()
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="bluez-4.98"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ check
+ dbus
+ glib
+ uim
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bluez-4.98.tar.gz"
+ #COMPONENT_REV="18a5dc6cdcf0828443c415eaea82b6834a8f9825"
+ COMPONENT_DIR="bluez-4.98"
+ download_component "http://kernel.org/pub/linux/bluetooth/bluez-4.98.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ patch -p1 -i ${old_dir}/patches/0003-socket-enable-for-bluez-4_98.patch || exit 1
+ patch -p1 -i ${old_dir}/patches/0004-bluez-enable-source-interface.patch || exit 1
+
+ LIBS='-liconv' ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --enable-alsa --enable-tools --enable-test --enable-audio --enable-serial --enable-service --enable-gstreamer --enable-usb --enable-tools --enable-bccmd --enable-hid2hci --enable-dfutool --enable-pand --disable-cups --enable-debug --enable-gatt --enable-hid2hci --enable-health
+ make LIBS='-lffi' || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ cp audio/audio.conf input/input.conf ${ROOTFS}${MY_SYSCONFDIR}/bluetooth/ || exit 1
+ cp test/agent ${ROOTFS}${MY_PREFIX}/bin/agent || exit 1
+ mkdir -p ${ROOTFS}/usr/share/bluetooth
+
+ cd test
+ list='simple-agent list-devices simple-service test-adapter test-attrib test-audio test-device test-discovery test-health test-health-sink test-input test-manager test-network test-oob test-proximity test-sap-server test-service test-telephony test-textfile test-thermometer uuidtest rctest monitor-bluetooth mpris-player lmptest gaptest hciemu hsmicro hsplay hstest l2test attest avtest bdaddr btiotest'
+ echo "installing tests in ${ROOTFS}/usr/share/bluetooth"
+ cp ${list} ${ROOTFS}/usr/share/bluetooth
+ cd -
+ add_fingerprint 1
+ fi
+ echo "bluez built successfully"
+}
+
+function hcidump
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bluez-hcidump-2.4.tar.gz"
+ COMPONENT_DIR="bluez-hcidump-2.4"
+ download_component "http://www.kernel.org/pub/linux/bluetooth/bluez-hcidump-2.4.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ patch -p1 -i ${old_dir}/patches/0001-blueti-Add-TI-Logger-dump.patch || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "hcidump built successfully"
+}
+
+function ncurses
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="ncurses-5.9.tar.gz"
+ COMPONENT_DIR="ncurses-5.9"
+ download_component "http://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} -with-shared --without-debug --without-normal || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "ncurses built successfully"
+}
+
+function readline
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="readline-6.2.tar.gz"
+ COMPONENT_DIR="readline-6.2"
+ download_component "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "readline built successfully"
+}
+
+
+function openobex
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="openobex-1.5.tar.gz"
+ COMPONENT_DIR="openobex-1.5"
+ download_component "http://ftp.osuosl.org/pub/linux/bluetooth/openobex-1.5.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ # wget 'http://mirror.anl.gov/pub/linux/bluetooth/openobex-1.5.tar.gz' || exit 1
+ add_fingerprint 0
+ sed -i '11227 i *)\n;;' configure || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --enable-apps --disable-usb || exit 1
+ sed -i 's/^\(libdir=\).*/\1\$\{prefix\}\/lib/g' openobex.pc || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "openobex built successfully"
+}
+
+function libical
+{
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="libical-0.44.tar.gz"
+ COMPONENT_DIR="libical-0.44"
+ download_component "http://downloads.sourceforge.net/project/freeassociation/libical/libical-0.44/libical-0.44.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} || exit 1
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null
+ add_fingerprint 1
+ fi
+ echo "libical built successfully"
+}
+
+function obexd
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="obexd-0.34.tar.gz"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ bluez
+ libical
+ readline
+ ncurses
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="obexd-0.34.tar.gz"
+ COMPONENT_DIR="obexd-0.34"
+ download_component "http://www.kernel.org/pub/linux/bluetooth/obexd-0.34.tar.gz"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} || exit 1
+ wget http://processors.wiki.ti.com/images/4/43/Obexd-patches_v1.tar.gz || exit 1
+ echo "Openning archive: Obexd-patches_v1.tar.gz" && tar -xzf Obexd-patches_v1.tar.gz || exit 1
+ apply_patches
+ make || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ test -d ${ROOTFS}/usr/share/bluetooth || mkdir -p ${ROOTFS}/usr/share/bluetooth
+ list='exchange-business-cards ftp-client list-folders pbap-client send-files'
+ for f in ${list}; do
+ install -c test/$f ${ROOTFS}/usr/share/bluetooth || exit 1
+ done
+ add_fingerprint 1
+ fi
+ echo "obexd built successfully"
+}
+
+function bt-obex
+{
+ if [ $# -eq 1 ]; then
+ START_MODULE="bluez-tools"
+ fi
+ # dependency section, in here we build the dependencies. We do not want to rebuild them each time
+ dbus-glib
+ readline
+ ncurses
+
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="bluez-tools"
+ COMPONENT_REV="171181b6ef6c94aefc828dc7fd8de136b9f97532"
+ COMPONENT_DIR="bluez-tools"
+ download_component "git://gitorious.org/bluez-tools/bluez-tools.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ [ ! -e Bt-obex-patches.zip ] && { wget 'http://processors.wiki.ti.com/images/f/f5/Bt-obex-patches.zip' || exit 1; }
+ unzip -o Bt-obex-patches.zip || exit 1
+ apply_patches
+ #patch -p1 -i ${old_dir}/patches/0001-bt-obex-new-dbus-api-for-obexd.patch
+ #patch -p1 -i ${old_dir}/patches/0001-manager-adoptation-to-new-manager-interface-of-bluez.patch
+
+ /usr/bin/libtoolize || exit 1
+ /usr/bin/aclocal || exit 1
+ /usr/bin/autoheader || exit 1
+ /usr/bin/automake --add-missing || exit 1
+ /usr/bin/autoconf || exit 1
+ ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} || exit 1
+ make LIBS="-ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0 -liconv -lffi -lz -lncurses" || exit 1
+ make install DESTDIR=${ROOTFS} || exit 1
+ add_fingerprint 1
+ fi
+ echo "bt-obex built successfully"
+}
+
+function wl1271-demo
+{
+ START_MODULE="wl1271-bluetooth"
+ cd ${WORK_SPACE} || exit 1
+ COMPONENT_NAME="wl1271-bluetooth"
+ COMPONENT_DIR="wl1271-bluetooth"
+ COMPONENT_REV="ae9a9a961dd9821d30a0b9c32612f3a552c81d4e"
+ download_component "git://github.com/TI-ECS/wl1271-bluetooth.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ add_fingerprint 0
+ mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/gallery || exit 1
+ mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1
+ mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/ftp_folder || exit 1
+
+ if [ x"$MACHINE_TYPE" = "x" ]; then
+ get_machine_used
+ fi
+
+ cp ./gallery/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/gallery || exit 1
+ cp ./script/common/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1
+ cp ./script/${MACHINE_TYPE}/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1
+ cp ./ftp_folder/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/ftp_folder || exit 1
+ add_fingerprint 1
+ fi
+ echo "wl1271-demo built successfully"
+}
+
+function bt-enable
+{
+ cd ${WORK_SPACE} || exit 1
+ if [ x"$KLIB_BUILD" = "x" ]; then
+ echo "Please set KLIB_BUILD variable to point to your Linux kernel"
+ exit 1
+ fi
+ COMPONENT_NAME="bt_enable"
+ COMPONENT_REV="dd75971705ada8fb0e88a0fb3f68833086c5bba4"
+ COMPONENT_DIR="bt_enable"
+ download_component "git://github.com/TI-ECS/bt_enable.git"
+ if [ ${CURRENT_OPTION} = "2" ]; then
+ [ ! -e Bt-enable-standalone-makefile.zip ] && { wget 'http://processors.wiki.ti.com/images/8/8f/Bt-enable-standalone-makefile.zip' || exit 1; }
+ unzip -o Bt-enable-standalone-makefile.zip || exit 1
+ apply_patches
+
+ if [ x"$MACHINE_TYPE" = "x" ]; then
+ get_machine_used
+ fi
+ cp ./gpio_en_${MACHINE_TYPE}.c ./gpio_en.c
+ make DEST_DIR=${ROOTFS} KERNEL_DIR=${KLIB_BUILD} || exit 1
+ make DEST_DIR=${ROOTFS} KERNEL_DIR=${KLIB_BUILD} install || exit 1
+ add_fingerprint 1
+ fi
+ echo "bt-enable built successfully"
+}
+
+#==================================================================================
+# Main
+#==================================================================================
+old_dir=`pwd`
+MACHINE_TYPE=""
+
+source setup-env || exit 1
+source ./functions/common-functions
+# if there are no sufficient arguments...
+if [ $# -lt 2 ]; then
+ usage
+ exit 0
+fi
+
+if [ x"$CROSS_COMPILE" = "x" ]; then
+ echo "define CROSS_COMPILE variable"
+ exit 1
+fi
+
+which ${CROSS_COMPILE}gcc > /dev/null
+
+if [ $? -ne 0 ]; then
+ echo "No toolchain in path"
+ exit 1
+fi
+
+
+if [ x"$ROOTFS" = "x" ]; then
+ echo "Please set ROOTFS variable to point to your root filesystem"
+ exit 1
+fi
+
+if [ x"$WORK_SPACE" = "x" ]; then
+ echo "Please set WORK_SPACE variable to point to your preferred work space"
+ exit 1
+fi
+
+FINGURE_PRINT_DIR="${WORK_SPACE}/.FingurePrint"
+mkdir -p ${FINGURE_PRINT_DIR} || exit 1
+
+USER_OPTION=0
+CURRENT_OPTION=0
+
+case "$2" in
+ build)
+ USER_OPTION=1
+ ;;
+ rebuild)
+ USER_OPTION=2
+ ;;
+ *)
+ echo "Unknown option $2"
+ exit 1
+ ;;
+esac
+
+CURRENT_OPTION=${USER_OPTION}
+
+MODULE_TO_INVOKE=$1
+$MODULE_TO_INVOKE 1
+
+cd ${old_dir}