You are not logged in.

#1 2019-05-08 11:59:56

jimjamz
Member
From: Nagasaki, Japan
Registered: 2016-04-04
Posts: 90

Re-installing manually removed drivers

In an effort to enable monitor mode for a RTL8188EUS based USB Wi-Fi adapter (TP-Link TL-WN722N v3.0), I installed a third-party driver (via GitHub).  As part of this, a recommended step was to manually remove all realtek drivers from my system so the new driver would be the one the USB Wi-Fi adapter would recognise.:

rm -rf /usr/src/linux-headers-$(uname -r)/include/config/rtl*
rm -rf /lib/modules/$(uname -r)/kernel/drivers/staging/rtl*
rm -rf /lib/modules/$(uname -r)/kernel/drivers/net/wireless/realtek/*

Unfortunately, I also have another Realtek based USB Wi-Fi adapter (Edimax EW-7811Un N150), which uses the RTL8188CUS (not EUS).

According to Debian, the RTL8188CUS chipset relies on the rtl8192cu driver, which is part of the firmware-realtek package.

So I installed the package and rebooted, but the device still does not load a driver for it:

$ lsusb | grep Edimax
Bus 001 Device 003: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
lsusb -t | grep "Dev 3"
    |__ Port 6: Dev 3, If 0, Class=Hub, Driver=hub/3p, 12M
    |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=, 480M

As you can see above, Device 3 is still missing it's rtl8192cu driver.  The Wi-Fi adapter is not present in iwconfig.
The drivers removed at the above directories still don't have the .ko modules, even after installing the firmware-realtek package.
How can I restore those drivers and does it have to be done manually?

Offline

#2 2019-05-08 14:47:52

earlybird
ほやほや
Registered: 2015-12-16
Posts: 684
Website

Re: Re-installing manually removed drivers

apt-get update
apt-get install --reinstall linux-image-amd64

The other driver files would have come back when the kernel package updates next time anyway. Blacklist drivers you don't want or need instead.

Looking at the repo, the way to go would be to build a dkms package since the source includes a dkms.conf file. That way, you save yourself almost all manual install steps, and the module automatically rebuilds when you  update the local kernel.

Documentation on DKMS sucks very much though, and man dkms is the only reliable source.

Offline

#3 2019-05-09 03:33:16

stevep
MX Linux Developer
Registered: 2016-08-08
Posts: 364

Re: Re-installing manually removed drivers

Firmware and drivers are two different animals. The free drivers live in the kernel, but almost all of the free wi-fi drivers require non-free firmware. 

Instead of deleting the drivers from the kernel, you can add the one you don't want to load automatically to the module blacklist file. You can then still load it manually with modprobe when you need it for the second adapter.

Offline

#4 2019-05-09 13:11:18

jimjamz
Member
From: Nagasaki, Japan
Registered: 2016-04-04
Posts: 90

Re: Re-installing manually removed drivers

@earlybird - Thank you very much.  Very useful.

How would one blacklist certain module files?  I found this, but it does mention that driver modules built into the image cannot be blacklisted.
Is this the reason you suggested building a custom dkms package?

Offline

#5 2019-05-09 19:55:20

stevep
MX Linux Developer
Registered: 2016-08-08
Posts: 364

Re: Re-installing manually removed drivers

jimjamz wrote:

@earlybird - Thank you very much.  Very useful.

How would one blacklist certain module files?  I found this, but it does mention that driver modules built into the image cannot be blacklisted.
Is this the reason you suggested building a custom dkms package?

Wi-fi drivers are all built as .ko module files, so you don't have to worry about those being part of the monolithic kernel image. The file is /etc/modprobe.d/blacklist.conf, but you can also put it into another file in the same folder such as realtek-driver-blacklist.conf

Offline

#6 2019-05-21 07:57:16

jimjamz
Member
From: Nagasaki, Japan
Registered: 2016-04-04
Posts: 90

Re: Re-installing manually removed drivers

The issue I am having is with the rtl8192cu driver.  Both in my BL installation and BL Live, it does not work correctly.  The USB Wi-Fi adapter using this driver fails to connect.  However, the device is working correctly in Windows.  I am attempting to try other Linux distributions.

sudo dmesg | grep rtl8192cu
[   20.630362] rtl8192cu: Board Type 0
[   20.630840] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin
[   20.918122] usb 2-4: firmware: failed to load rtlwifi/rtl8192cufw_TMSC.bin (-2)
[   20.918131] usb 2-4: Direct firmware load for rtlwifi/rtl8192cufw_TMSC.bin failed with error -2
[   20.918143] usb 2-4: firmware: failed to load rtlwifi/rtl8192cufw.bin (-2)
[   20.918147] usb 2-4: Direct firmware load for rtlwifi/rtl8192cufw.bin failed with error -2
[   20.918148] rtlwifi: Loading alternative firmware rtlwifi/rtl8192cufw.bin
[   20.931340] usbcore: registered new interface driver rtl8192cu

Could it be that I need to install `firmware-realtek`?

How can I blacklist the default rtl8192cu driver, so that I may try a 3rd-party one from GitHub?

Last edited by jimjamz (2019-05-21 07:58:47)

Offline

Board footer

Powered by FluxBB