Requesting support for Tp-link UB500 Bluetooth adapter

Hey ! I just built the module and placed it in the kernel/bluetooth directory. But I have this error when I actually want to load the module : modprobe: ERROR: could not insert 'btusb': Exec format error
What should I do ?

Tp-Link UB500 dongle is not working properly. Device is showing up a bluetooth reciever but CANNOT scan for devices. I found out that the new dongle is not supported yet. I COULD NOT find any information online.
Running 5.14 MANJARO. Please help me out.

I see it’s very new hardware, but support should be added in near future [PATCH] Bluetooth: btusb: Add support for TP-Link UB500 Adapter — Linux Bluetooth I don’t know, maybe in 5.15 or 5.16 kernel.

Yes ! I just found out about a possible fix from this askubuntu forum.

Essentially you have to apply a patch to the btusb.c and hci_ldisc.c in the kernel source code and replace the old modules with the new pathced ones.
From the article :-

Step 1: Download and extract Linux kernel source file.

wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.11.tar.xz
tar xpvf linux-5.11.tar.xz
(In this case you have to download form gitlab.manjaro.org I guess ? )

Step 2: Edit btusb.c

cd linux-5.11/drivers/bluetooth
gedit btusb.c

add the following

/* Tp-Link UB500 */
{ USB_DEVICE(0x2357, 0x0604), .driver_info = BTUSB_REALTEK },

Step 3: Edit hci_ldisc.c

Replace

static ssize_t hci_uart_tty_read(struct tty_struct *tty, struct file *file,
                 unsigned char __user *buf, size_t nr)

to

static ssize_t hci_uart_tty_read(struct tty_struct *tty, struct file *file,
                 unsigned char __user *buf, size_t nr,
                 void **cookie, unsigned long offset)

Step 4: Compile modules

make -C /lib/modules/$(uname -r)/build M=$(pwd) clean
cp /usr/src/linux-headers-$(uname -r)/.config ./
cp /usr/src/linux-headers-$(uname -r)/Module.symvers Module.symvers
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
sudo cp btusb.ko /lib/modules/$(uname -r)/kernel/drivers/bluetooth

Step 5: Repalce the old module

sudo cp btusb.ko /lib/modules/$(uname -r)/kernel/drivers/bluetooth

Step 6: Load new btusb

sudo modprobe -r btusb
sudo modprobe -v btusb

Hey ! I just built the module and placed it in the kernel/bluetooth directory. But I have this error when I actually want to load the module : modprobe: ERROR: could not insert 'btusb': Exec format error
What should I do ? Please reply if you know a possible fix :slight_smile:

Please help me, I am tired of being confused and not being able to do anything. I have a Bluetooth 5.0 Adapter, Tp-link UB500.
This device is not supported on the latest kernel yet. I found out that I can build a patched btusb kernel module and add it to my currently running kernel. BUT I am just dumbfounded at this point, I CANNOT get the module to build correctly, everytime something just goes wrong.
I am running 5.14.10-1-MANJARO kernel. I followed this tutorial from the manjaro forums. I also got the patch needed from here.
Here is what I added to the 0900-btusb.patch file :

Fix Drivers for TPLink-UB500

--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -433,6 +433,10 @@ static const struct usb_device_id blacklist_table[] = {
 	{ USB_DEVICE(0x0bda, 0xb009), .driver_info = BTUSB_REALTEK },
 	{ USB_DEVICE(0x2ff8, 0xb011), .driver_info = BTUSB_REALTEK },

+	/* Additional Realtek 8761B Bluetooth devices */
+	{ USB_DEVICE(0x2357, 0x0604), .driver_info = BTUSB_REALTEK |
+						     BTUSB_WIDEBAND_SPEECH },
+
 	/* Additional Realtek 8761BU Bluetooth devices */
 	{ USB_DEVICE(0x0b05, 0x190e), .driver_info = BTUSB_REALTEK |
 	  					     BTUSB_WIDEBAND_SPEECH },

Then I followed the tutorial as followed, adjusted the PKGBUILD , here is my exact PKGBUILD file contents :-

# Maintainer: Philip Müller <philm[at]manjaro[dot]org>
# Maintainer: Bernhard Landauer <bernhard@manjaro.org>
# Arch credits:
# Tobias Powalowski <tpowa@archlinux.org>
# Thomas Baechler <thomas@archlinux.org>

pkgbase=linux514
pkgname=('linux514' 'linux514-headers')
_kernelname=-MANJARO
_basekernel=5.14
_basever=514
pkgver=5.14.17
pkgrel=1
arch=('x86_64')
url="https://www.kernel.org/"
license=('GPL2')
makedepends=('bc'
    'docbook-xsl'
    'libelf'
    'pahole'
    'git'
    'inetutils'
    'kmod'
    'xmlto'
    'cpio'
    'perl'
    'tar'
    'xz')
options=('!strip')
source=("https://www.kernel.org/pub/linux/kernel/v5.x/linux-${_basekernel}.tar.xz"
        "https://www.kernel.org/pub/linux/kernel/v5.x/patch-${pkgver}.xz"
        # the main kernel config files
        'config' 'config.anbox'
        # ARCH Patches
        '0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-CLONE_NEWUSER.patch'
        '0002-HID-quirks-Add-Apple-Magic-Trackpad-2-to-hid_have_special_driver-list.patch'
        # Temp Fixes
        # MANJARO Patches
        '0101-i2c-nuvoton-nc677x-hwmon-driver.patch'
        '0102-iomap-iomap_bmap-should-accept-unwritten-maps.patch'
        '0103-futex.patch'
        '0104-revert-xhci-Add-support-for-Renesas-controller-with-memory.patch'
        '0107-quirk-kernel-org-bug-210681-firmware_rome_error.patch'
        # Lenovo + AMD
        '0302-lenovo-wmi2.patch'
        # other patches
        # Bootsplash
        '0401-revert-fbcon-remove-now-unusued-softback_lines-cursor-argument.patch'        
        '0402-revert-fbcon-remove-no-op-fbcon_set_origin.patch'
        '0403-revert-fbcon-remove-soft-scrollback-code.patch'
        '0501-bootsplash.patch'
        '0502-bootsplash.patch'
        '0503-bootsplash.patch'
        '0504-bootsplash.patch'
        '0505-bootsplash.patch'
        '0506-bootsplash.patch'
        '0507-bootsplash.patch'
        '0508-bootsplash.patch'
        '0509-bootsplash.patch'
        '0510-bootsplash.patch'
        '0511-bootsplash.patch'
        '0512-bootsplash.patch'
        '0513-bootsplash.gitpatch'
        '0900-btusb.patch')
sha256sums=('7e068b5e0d26a62b10e5320b25dce57588cbbc6f781c090442138c9c9c3271b2'
            'bfe913fd04c78f544e6a416e3a0952066635548cb155412f62ba4d82769637ff'
            '5e18e915aa406ad1548c2cdf0a1485657bf582c5aff64076882b9572af65673e'
            'fc896e5b00fad732d937bfb7b0db41922ecdb3a488bc1c1b91b201e028eed866'
            '986f8d802f37b72a54256f0ab84da83cb229388d58c0b6750f7c770818a18421'
            'df5843818f1571841e1a8bdbe38d7f853d841f38de46d6a6a5765de089495578'
            '7823d7488f42bc4ed7dfae6d1014dbde679d8b862c9a3697a39ba0dae5918978'
            '95745075edd597caa92b369cfbcd11a04c9e3c88c0c987c70114924e1e01df5c'
            'cbf1ca0b95b2156e408fb5a9520dde1e5fd342586407e1e0dcccd9a526c79e53'
            '22f259620bfb89ffb4e65fcc810d8d796d0c3714a31dc6378122ed8cc1645bdd'
            '5e804e1f241ce542f3f0e83d274ede6aa4b0539e510fb9376f8106e8732ce69b'
            '1d58ef2991c625f6f0eb33b4cb8303932f53f1c4694e42bae24c9cd36d2ad013'
            '2b11905b63b05b25807dd64757c779da74dd4c37e36d3f7a46485b1ee5a9d326'
            '94a8538251ad148f1025cc3de446ce64f73dc32b01815426fb159c722e8fa5bc'
            '1f18c5c10a3c63e41ecd05ad34cd9f6653ba96e9f1049ce2b7bb6da2578ae710'
            '59202940d4f12bad23c194a530edc900e066866c9945e39748484a6545af96de'
            'e096b127a5208f56d368d2cb938933454d7200d70c86b763aa22c38e0ddb8717'
            '8c1c880f2caa9c7ae43281a35410203887ea8eae750fe8d360d0c8bf80fcc6e0'
            '1144d51e5eb980fceeec16004f3645ed04a60fac9e0c7cf88a15c5c1e7a4b89e'
            'dd4b69def2efacf4a6c442202ad5cb93d492c03886d7c61de87696e5a83e2846'
            '028b07f0c954f70ca37237b62e04103e81f7c658bb8bd65d7d3c2ace301297dc'
            'a0c548c5703d25ae34b57931f1162de8b18937e676e5791a0f039922090881e7'
            '8dbb5ab3cb99e48d97d4e2f2e3df5d0de66f3721b4f7fd94a708089f53245c77'
            'a7aefeacf22c600fafd9e040a985a913643095db7272c296b77a0a651c6a140a'
            'e9f22cbb542591087d2d66dc6dc912b1434330ba3cd13d2df741d869a2c31e89'
            '27471eee564ca3149dd271b0817719b5565a9594dc4d884fe3dc51a5f03832bc'
            '60e295601e4fb33d9bf65f198c54c7eb07c0d1e91e2ad1e0dd6cd6e142cb266d'
            '035ea4b2a7621054f4560471f45336b981538a40172d8f17285910d4e0e0b3ef'
            '0fea73217cff815544072466a465f4775c422082981c8e3f6078650c766cd87d')

prepare() {
  cd "linux-${_basekernel}"

  # add upstream patch
  msg "add upstream patch"
  patch -p1 -i "../patch-${pkgver}"

  local src
  for src in "${source[@]}"; do
      src="${src%%::*}"
      src="${src##*/}"
      [[ $src = *.patch ]] || continue
      msg2 "Applying patch: $src..."
      patch -Np1 < "../$src"
  done

  msg2 "0513-bootsplash"
  git apply -p1 < "../0513-bootsplash.gitpatch"

  msg2 "add config.anbox to config"
  cat "../config" > ./.config
  cat "../config.anbox" >> ./.config

  if [ "${_kernelname}" != "" ]; then
    sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
    sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
  fi

  msg "set extraversion to pkgrel"
  sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile

  # set patchlevel to 14
  #sed -ri "s|^(PATCHLEVEL =).*|\1 14|" Makefile

  msg "don't run depmod on 'make install'"
  # We'll do this ourselves in packaging
  sed -i '2iexit 0' scripts/depmod.sh

  msg "get kernel version"
  make prepare

  msg "rewrite configuration"
  yes "" | make config >/dev/null
}

build() {
  cd "linux-${_basekernel}"

  msg "build"
  make ${MAKEFLAGS} LOCALVERSION= bzImage modules
}

package_linux514() {
  pkgdesc="The ${pkgbase/linux/Linux} kernel and modules"
  depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=27')
  optdepends=('crda: to set the correct wireless channels of your country')
  provides=("linux=${pkgver}" VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE)

  cd "linux-${_basekernel}"

  # get kernel version
  _kernver="$(make LOCALVERSION= kernelrelease)"

  mkdir -p "${pkgdir}"/{boot,usr/lib/modules}
  make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}/usr" INSTALL_MOD_STRIP=1 modules_install

  # systemd expects to find the kernel here to allow hibernation
  # https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
  cp arch/x86/boot/bzImage "${pkgdir}/usr/lib/modules/${_kernver}/vmlinuz"

  # Used by mkinitcpio to name the kernel
  echo "${pkgbase}" | install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_kernver}/pkgbase"
  echo "${_basekernel}-${CARCH}" | install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_kernver}/kernelbase"

  # add kernel version
  echo "${pkgver}-${pkgrel}-MANJARO x64" > "${pkgdir}/boot/${pkgbase}-${CARCH}.kver"

  # make room for external modules
  local _extramodules="extramodules-${_basekernel}${_kernelname:--MANJARO}"
  ln -s "../${_extramodules}" "${pkgdir}/usr/lib/modules/${_kernver}/extramodules"

  # add real version for building modules and running depmod from hook
  echo "${_kernver}" |
    install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_extramodules}/version"

  # remove build and source links
  rm "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build}

  # now we call depmod...
  depmod -b "${pkgdir}/usr" -F System.map "${_kernver}"
}

package_linux514-headers() {
  pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel"
  depends=('gawk' 'python' 'libelf' 'pahole')
  provides=("linux-headers=$pkgver")

  cd "linux-${_basekernel}"
  local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"

  install -Dt "${_builddir}" -m644 Makefile .config Module.symvers
  install -Dt "${_builddir}/kernel" -m644 kernel/Makefile
  install -Dt "${_builddir}" -m644 vmlinux  

  mkdir "${_builddir}/.tmp_versions"

  cp -t "${_builddir}" -a include scripts

  install -Dt "${_builddir}/arch/x86" -m644 "arch/x86/Makefile"
  install -Dt "${_builddir}/arch/x86/kernel" -m644 "arch/x86/kernel/asm-offsets.s"

  cp -t "${_builddir}/arch/x86" -a "arch/x86/include"

  install -Dt "${_builddir}/drivers/md" -m644 drivers/md/*.h
  install -Dt "${_builddir}/net/mac80211" -m644 net/mac80211/*.h

  # https://bugs.archlinux.org/task/13146
  install -Dt "${_builddir}/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h

  # https://bugs.archlinux.org/task/20402
  install -Dt "${_builddir}/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h
  install -Dt "${_builddir}/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h
  install -Dt "${_builddir}/drivers/media/tuners" -m644 drivers/media/tuners/*.h

  # https://bugs.archlinux.org/task/71392
  install -Dt "${_builddir}/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.h

  # add xfs and shmem for aufs building
  mkdir -p "${_builddir}"/{fs/xfs,mm}

  # copy in Kconfig files
  find . -name Kconfig\* -exec install -Dm644 {} "${_builddir}/{}" \;

  # add objtool for external module building and enabled VALIDATION_STACK option
  install -Dt "${_builddir}/tools/objtool" tools/objtool/objtool

  # remove unneeded architectures
  local _arch
  for _arch in "${_builddir}"/arch/*/; do
    [[ ${_arch} == */x86/ ]] && continue
    rm -r "${_arch}"
  done

  # remove documentation files
  rm -r "${_builddir}/Documentation"

  # strip scripts directory
  local file
  while read -rd '' file; do
    case "$(file -bi "$file")" in
      application/x-sharedlib\;*)      # Libraries (.so)
        strip $STRIP_SHARED "$file" ;;
      application/x-archive\;*)        # Libraries (.a)
        strip $STRIP_STATIC "$file" ;;
      application/x-executable\;*)     # Binaries
        strip $STRIP_BINARIES "$file" ;;
      application/x-pie-executable\;*) # Relocatable binaries
        strip $STRIP_SHARED "$file" ;;
    esac
  done < <(find "${_builddir}" -type f -perm -u+x ! -name vmlinux -print0 2>/dev/null)
  strip $STRIP_STATIC "${_builddir}/vmlinux"
  
  # remove unwanted files
  find ${_builddir} -name '*.orig' -delete
}

Then I go ahead and run makepkg --nobuild , it run fine with the last couple of lines being :-

==> rewrite configuration
==> Sources are ready.

Then I run this command : srcDir=src/5.14.10-1-MANJARO
Where I have replaced the kernel version with my currently running kernel, and the command runs fine.
Then I run this command : ln -s /usr/lib/modules/5.14.10-1-MANJARO/build/Module.symvers "$srcDir/"
It runs fine, I then run : zcat /proc/config.gz > "$srcDir/.config"
It returns error permission denied even when running with sudo.
I am currently stuck at this stage, what should I do ? Sorry for such a long post, this is my first time doing something like this, I am very new to linux, please someone help me figure this out. I will keep this post updated as I progress further.

I made it to the final point, just stuck at the end :smiley:
The sudo modprobe btusb command seems to fail for me…
modprobe: ERROR: could not insert 'btusb': Exec format error

Assuming you are inside the git cloned directory, once you makepkg --nobuild there should be a src/linux-5.14 inside so you run srcDir=src/linux-5.14 instead.

Thanks for your reply, I just realised that the srcDir is just the src directory in my build folder where all the source files are stored for building ! After realising that I successfully built the btusb module but I am facing a problem at the last stage too !
When I do sudo modprobe btusb
It outputs an error : modprobe: ERROR: could not insert 'btusb': Unknown symbol in module, or unknown parameter (see dmesg)
So close !
EDIT :-
I didnt do the depmod command thats why it was showing the error. But now I have the same error as you, modprobe: ERROR: could not insert 'btusb': Exec format error
If you find a solution please reply ! :slight_smile:

@cmossimp - merged your 3 topics on the same subject to this one. Please continue the discussion here and avoid Cross Posting as per forum rules.

Oh ok, I’ll keep that in mind from now on.

Well after your reply I re-did EVERYTHING from scratch in your tutorial, I double checked to make sure I was building the module against the kernel 5.14 which is my currently running kernel. Here is a complete dump of what happend in the terminal. Please see if you find anything. The error modprobe: ERROR: could not insert 'btusb': Exec format error still shows up.

mkdir kernelbuild
cd kernelbuild
git clone https://gitlab.manjaro.org/packages/core/linux514.git
cd linux514
nano 0900-btusb.patch
sha256sum 0900-btusb.patch
nano PKGBUILD
makepkg --nobuild
srcDir=src/linux-5.14
ln -s /usr/lib/modules/5.14.10-1-MANJARO/build/Module.symvers "$srcDir/"
zcat /proc/config.gz > "$srcDir/.config"
make -C "$srcDir" modules_prepare
make --directory="$srcDir" M=drivers/bluetooth/
ls -l "$srcDir/drivers/bluetooth/btusb.ko"
sudo mv /usr/lib/modules/5.14.10-1-MANJARO/kernel/drivers/bluetooth/btusb.ko.xz /usr/lib/modules/5.14.10-1-MANJARO/kernel/drivers/bluetooth/btusb.ko.xz.backup
sudo cp "$srcDir/drivers/bluetooth/btusb.ko" /usr/lib/modules/5.14.10-1-MANJARO/kernel/drivers/bluetooth/
sudo depmod -a
sudo modprobe -r btusb 
sudo modprobe btusb

When building the modules I saw this, it’s skipping the BTF generation for drivers due to unavailability of vmlinux hope this helps :

  CC [M]  drivers/bluetooth/ath3k.mod.o
  LD [M]  drivers/bluetooth/ath3k.ko
  BTF [M] drivers/bluetooth/ath3k.ko
Skipping BTF generation for drivers/bluetooth/ath3k.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/bcm203x.mod.o
  LD [M]  drivers/bluetooth/bcm203x.ko
  BTF [M] drivers/bluetooth/bcm203x.ko
Skipping BTF generation for drivers/bluetooth/bcm203x.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/bfusb.mod.o
  LD [M]  drivers/bluetooth/bfusb.ko
  BTF [M] drivers/bluetooth/bfusb.ko
Skipping BTF generation for drivers/bluetooth/bfusb.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/bluecard_cs.mod.o
  LD [M]  drivers/bluetooth/bluecard_cs.ko
  BTF [M] drivers/bluetooth/bluecard_cs.ko
Skipping BTF generation for drivers/bluetooth/bluecard_cs.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/bpa10x.mod.o
  LD [M]  drivers/bluetooth/bpa10x.ko
  BTF [M] drivers/bluetooth/bpa10x.ko
Skipping BTF generation for drivers/bluetooth/bpa10x.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/bt3c_cs.mod.o
  LD [M]  drivers/bluetooth/bt3c_cs.ko
  BTF [M] drivers/bluetooth/bt3c_cs.ko
Skipping BTF generation for drivers/bluetooth/bt3c_cs.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/btbcm.mod.o
  LD [M]  drivers/bluetooth/btbcm.ko
  BTF [M] drivers/bluetooth/btbcm.ko
Skipping BTF generation for drivers/bluetooth/btbcm.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/btintel.mod.o
  LD [M]  drivers/bluetooth/btintel.ko
  BTF [M] drivers/bluetooth/btintel.ko
Skipping BTF generation for drivers/bluetooth/btintel.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/btmrvl.mod.o
  LD [M]  drivers/bluetooth/btmrvl.ko
  BTF [M] drivers/bluetooth/btmrvl.ko
Skipping BTF generation for drivers/bluetooth/btmrvl.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/btmrvl_sdio.mod.o
  LD [M]  drivers/bluetooth/btmrvl_sdio.ko
  BTF [M] drivers/bluetooth/btmrvl_sdio.ko
Skipping BTF generation for drivers/bluetooth/btmrvl_sdio.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/btmtksdio.mod.o
  LD [M]  drivers/bluetooth/btmtksdio.ko
  BTF [M] drivers/bluetooth/btmtksdio.ko
Skipping BTF generation for drivers/bluetooth/btmtksdio.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/btmtkuart.mod.o
  LD [M]  drivers/bluetooth/btmtkuart.ko
  BTF [M] drivers/bluetooth/btmtkuart.ko
Skipping BTF generation for drivers/bluetooth/btmtkuart.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/btqca.mod.o
  LD [M]  drivers/bluetooth/btqca.ko
  BTF [M] drivers/bluetooth/btqca.ko
Skipping BTF generation for drivers/bluetooth/btqca.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/btrsi.mod.o
  LD [M]  drivers/bluetooth/btrsi.ko
  BTF [M] drivers/bluetooth/btrsi.ko
Skipping BTF generation for drivers/bluetooth/btrsi.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/btrtl.mod.o
  LD [M]  drivers/bluetooth/btrtl.ko
  BTF [M] drivers/bluetooth/btrtl.ko
Skipping BTF generation for drivers/bluetooth/btrtl.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/btsdio.mod.o
  LD [M]  drivers/bluetooth/btsdio.ko
  BTF [M] drivers/bluetooth/btsdio.ko
Skipping BTF generation for drivers/bluetooth/btsdio.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/btusb.mod.o
  LD [M]  drivers/bluetooth/btusb.ko
  BTF [M] drivers/bluetooth/btusb.ko
Skipping BTF generation for drivers/bluetooth/btusb.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/dtl1_cs.mod.o
  LD [M]  drivers/bluetooth/dtl1_cs.ko
  BTF [M] drivers/bluetooth/dtl1_cs.ko
Skipping BTF generation for drivers/bluetooth/dtl1_cs.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/hci_nokia.mod.o
  LD [M]  drivers/bluetooth/hci_nokia.ko
  BTF [M] drivers/bluetooth/hci_nokia.ko
Skipping BTF generation for drivers/bluetooth/hci_nokia.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/hci_uart.mod.o
  LD [M]  drivers/bluetooth/hci_uart.ko
  BTF [M] drivers/bluetooth/hci_uart.ko
Skipping BTF generation for drivers/bluetooth/hci_uart.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/hci_vhci.mod.o
  LD [M]  drivers/bluetooth/hci_vhci.ko
  BTF [M] drivers/bluetooth/hci_vhci.ko
Skipping BTF generation for drivers/bluetooth/hci_vhci.ko due to unavailability of vmlinux
  CC [M]  drivers/bluetooth/virtio_bt.mod.o
  LD [M]  drivers/bluetooth/virtio_bt.ko
  BTF [M] drivers/bluetooth/virtio_bt.ko
Skipping BTF generation for drivers/bluetooth/virtio_bt.ko due to unavailability of vmlinux
make: Leaving directory '/home/sensei/kernelbuild/linux514/src/linux-5.14'

Hope this helps, thanks for your time :smiley:

@cmossimp I fixed it by reinstalling kernel headers and redoing the whole process(starting from git clone, you may also start from recopying Modules.symvers). linux514-headers will be the package name.

As I previously said, you only need to patch btusb.c and not hci_ldisc.c(as it is already patched for kernel 5.14 and above).

ok ! I will try that ! And did you get the tplink UB500 dongle to work properly with this fix ?

Yes! I am already using it for my wireless neckband.

ok ! I am doing it right now, did you also use the 5.14 kernel ?

Nope, 5.15 (The latest one). Also this patch is already there in bluetooth-next branch, So we can hope to get this fixed soon.

I DID IT !! Although your solution didn’t work, but I finally figured out what was going wrong ! I was building the kernel source from git clone https://gitlab.manjaro.org/packages/core/linux514.git
BUT the linux514.git contained the source files and patches for the latest revision of 5.14 which is 5.14.17. While my system has 5.14.10. Thats why it was showing the error while starting the module. Essentially I was building the module for 5.14.17 and trying to apply it to 5.14.10. I just had to revert to the 5.14.10 commit and it worked ! Thanks for your time, this has been a great learning experience :smile:

I DID IT !! I finally figured out what was going wrong ! I was building the kernel source from git clone https://gitlab.manjaro.org/packages/core/linux514.git
BUT the linux514.git contained the source files and patches for the latest revision of 5.14 which is 5.14.17. While my system has 5.14.10. Thats why it was showing the error while starting the module. Essentially I was building the module for 5.14.17 and trying to apply it to 5.14.10. I just had to revert to the 5.14.10 commit and it worked ! Make sure you have the matching version of kernel before you makepkg --nobuild. you have to set the commit number to your desired kernel version. To revert to 5.14.10 commit you have to do git reset iCommitNumber --hard where you replace iComitNumber with the commit version which is 1dc694e502184c1e9afe78914e82327fe264a9e4. So your final command to run BEFORE makepkg --nobuild will be git reset 1dc694e502184c1e9afe78914e82327fe264a9e4 --hard. I know this can be confusing as hell, so if you get stuck, then feel free to reply ! I will be happy to help you :smile:

1 Like

Wow nice! thanks again for posting the solution, it worked on my side as well! :smiley: