lwfinger / rtw89-BT

Out-of-kernel driver for Realtek BT devices found in rtw89 devides.
67 stars 9 forks source link

make install doesn't replace .ko.xz files #13

Closed i-nod closed 1 year ago

i-nod commented 1 year ago

For awhile I thought the driver didn't work for my asus x670-p motherboard. It turned out the default fedora btusb and btrtl drivers were taking priority over the ones I built and installed using make install. the .ko files were installed along side but weren't used until I removed the default .ko.xz files for btusb and btrtl. Maybe the makefile can account for this and install .ko.xz files or maybe remove the default ones?

lwfinger commented 1 year ago

I modified the Makefile to overwrite compressed modules as you requested. Thanks for the suggestion.

i-nod commented 1 year ago

This looks close to correct but you need a bit more from your other project. As it is now, DRV_DIR isn't defined. You could replace it with MODDESTDIR. You can compare it to this makefile from your other project and see that it defines DRV_DIR to what this project defines as MODDESTDIR. https://github.com/lwfinger/realtek_bluetooth/blob/master/Makefile

ohquait commented 1 year ago
--- a/rtw89-BT/Makefile
+++ b/rtw89-BT/Makefile
@@ -36,12 +36,12 @@
    @mkdir -p $(MODDESTDIR)
    @install -p -D -m 644 *.ko $(MODDESTDIR)
 ifeq ($(COMPRESS_GZIP), y)
-   @gzip -f $(DRV_DIR)/btusb.ko
-   @gzip -f $(DRV_DIR)/btrtl.ko
+   @gzip -f $(MODDESTDIR)/btusb.ko
+   @gzip -f $(MODDESTDIR)/btrtl.ko
 endif
 ifeq ($(COMPRESS_XZ), y)
-   @xz -f $(DRV_DIR)/btusb.ko
-   @xz -f $(DRV_DIR)/btrtl.ko
+   @xz -f $(MODDESTDIR)/btusb.ko
+   @xz -f $(MODDESTDIR)/btrtl.ko
 endif
    @depmod -a $(KVER)
i-nod commented 1 year ago

@ohquait This is how I fixed it locally. It worked after that.

i-nod commented 1 year ago

@ohquait After looking closely you missed one part. The compression check diff --git a/Makefile b/Makefile index c810d28..310cdf3 100644 --- a/Makefile +++ b/Makefile @@ -12,10 +12,10 @@ NO_SKIP_SIGN := y endif

Handle the compression option for modules in 3.18+

-ifneq ("","$(wildcard $(DRV_DIR)/.ko.gz)") +ifneq ("","$(wildcard $(MODDESTDIR)/.ko.gz)") COMPRESS_GZIP := y endif -ifneq ("","$(wildcard $(DRV_DIR)/.ko.xz)") +ifneq ("","$(wildcard $(MODDESTDIR)/.ko.xz)") COMPRESS_XZ := y endif

i-nod commented 1 year ago

@lwfinger Can you add the above patch? DRV_DIR is not defined and needs to be MODDESTDIR.

lwfinger commented 1 year ago

I made that change. Do a 'git pull'.

i-nod commented 1 year ago

Looks good, thanks.