Skip to content

Instantly share code, notes, and snippets.

Created December 13, 2012 00:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save anonymous/4272952 to your computer and use it in GitHub Desktop.
Save anonymous/4272952 to your computer and use it in GitHub Desktop.
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