summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRangHo Lee2018-08-25 08:16:25 -0700
committerRangHo Lee2018-08-25 08:16:25 -0700
commit4b12706618dbc131b86248c1b32d6abc050619a4 (patch)
tree38f6ae8f2978110b323f796f438d5b82b3fdd341
downloadaur-4b12706618dbc131b86248c1b32d6abc050619a4.tar.gz
Initial commit
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD54
-rw-r--r--atheros-ar3012.diff18
-rw-r--r--kernelmodule.install18
4 files changed, 105 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..997aa4f34e18
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = atheros-ar3012
+ pkgdesc = Provides an alternate kernel module for those with malfunctioning AR3012 bluetooth hardware.
+ pkgver = 4.18.4
+ pkgrel = 1
+ url = https://kernel.org
+ install = kernelmodule.install
+ arch = any
+ license = GPL
+ makedepends = wget
+ makedepends = make
+ makedepends = gcc
+ makedepends = linux-headers
+
+pkgname = atheros-ar3012
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..41c059c5fb3f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,54 @@
+# Maintainer: RangHo Lee <hibiki_love@rangho.moe>
+
+pkgname=atheros-ar3012
+pkgver=4.18.4
+pkgrel=1
+pkgdesc="Provides an alternate kernel module for those with malfunctioning AR3012 bluetooth hardware."
+arch=('any')
+url="https://kernel.org"
+license=('GPL')
+makedepends=('wget' 'make' 'gcc' 'linux-headers')
+install=kernelmodule.install
+
+prepare() {
+ cd "$srcdir"
+
+ export version=$(uname -r | cut -d '-' -f 1)
+
+ if [ ! -e "./linux-$version.tar.xz" ]; then
+ echo "Downloading appropriate kernel souce code..."
+ wget "https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-$version.tar.xz"
+ else
+ echo "Appropriate Linux source already exists."
+ fi
+
+ tar -xvJf linux-$version.tar.xz
+
+
+ cd linux-$version
+ patch -p0 ./drivers/bluetooth/btusb.c < ../../atheros-ar3012.diff
+}
+
+pkgver() {
+ echo $version
+}
+
+build() {
+ cd linux-$version/
+ make mrproper
+ cp /usr/lib/modules/$(uname -r)/build/.config ./
+ cp /usr/lib/modules/$(uname -r)/build/Module.symvers ./
+ make oldconfig
+
+ make EXTRAVERSION=$(uname -r | sed -e 's/[[:digit:]]\.[[:digit:]][[:digit:]]*\.*[[:digit:]]*//g' -e 's/-ARCH//g') modules_prepare
+
+ make M=drivers/bluetooth
+}
+
+package() {
+ xz $srcdir/linux-$version/drivers/bluetooth/btusb.ko
+
+ install -d $pkgdir/usr/lib/modules/$(uname -r)/kernel/drivers/bluetooth
+ cp $srcdir/linux-$version/drivers/bluetooth/btusb.ko.xz \
+ $pkgdir/usr/lib/modules/$(uname -r)/kernel/drivers/
+}
diff --git a/atheros-ar3012.diff b/atheros-ar3012.diff
new file mode 100644
index 000000000000..bc27f2af1e69
--- /dev/null
+++ b/atheros-ar3012.diff
@@ -0,0 +1,18 @@
+--- a/drivers/bluetooth/btusb.c 2015-12-31 05:08:23.080104409 +0100
++++ b/drivers/bluetooth/btusb.c 2015-12-31 05:08:11.210104749 +0100
+@@ -197,7 +197,6 @@
+ { USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 },
+- { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0cf3, 0x311e), .driver_info = BTUSB_ATH3012 },
+@@ -226,6 +225,7 @@
+ { USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 },
+
+ /* QCA ROME chipset */
++ { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_QCA_ROME },
+ { USB_DEVICE(0x0cf3, 0xe007), .driver_info = BTUSB_QCA_ROME },
+ { USB_DEVICE(0x0cf3, 0xe300), .driver_info = BTUSB_QCA_ROME },
+ { USB_DEVICE(0x0cf3, 0xe360), .driver_info = BTUSB_QCA_ROME }, \ No newline at end of file
diff --git a/kernelmodule.install b/kernelmodule.install
new file mode 100644
index 000000000000..5b944e7165b0
--- /dev/null
+++ b/kernelmodule.install
@@ -0,0 +1,18 @@
+# Contributor : RangHo Lee <hibiki_love@rangho.moe>
+
+post_install() {
+ echo -n "Regenerating Initramfs..."
+ mkinitcpio -p linux
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+post_remove() {
+ post_install $1
+}
+
+op=$1
+shift
+$op $*