Create a gist now

Instantly share code, notes, and snippets.

anonymous /build-bluetooth.sh
Created Dec 13, 2012

Scripts and DKMS configuration for building Bluetooth kernel modules.
#!/bin/bash
set -e
if [ ! -z "$1" ]; then
KERNEL="$1"
else
KERNEL="$(uname -r)"
fi
CURRENT_DIR="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
echo "Compiling Bluetooth Module"
echo "Kernel: $KERNEL; Build Directory: $CURRENT_DIR"
# Copy the kernel configuration
cp "/boot/config-$KERNEL" "$CURRENT_DIR/.config"
cp "/usr/src/linux-headers-$KERNEL/Module.symvers" "$CURRENT_DIR/./"
if [ -z "$( cat "$CURRENT_DIR/drivers/bluetooth/btusb.c" | grep "USB_DEVICE(0x0b05, 0x17b5)")" ]; then
echo "Patch not found."
fi
# Prepare for build
cd "$CURRENT_DIR"
make prepare
make scripts
make M=drivers/bluetooth modules
MAKE="./build-bluetooth.sh ${kernelver}"
CLEAN="make clean"
BUILT_MODULE_NAME=btusb
BUILT_MODULE_LOCATION=drivers/bluetooth
DEST_MODULE_LOCATION=/kernel/drivers/bluetooth
PACKAGE_NAME=btusb
PACKAGE_VERSION=0.6
PRE_INSTALL="./preinst.sh"
POST_INSTALL="./postinst.sh"
REMAKE_INITRD=yes
#!/bin/bash
sudo service bluetooth start
#!/bin/bash
sudo service bluetooth stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment