LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-01-2024, 06:38 AM   #1
Matthew Wai
Member
 
Registered: Jul 2019
Location: China
Distribution: UnionTech OS Desktop Home (64-bit)
Posts: 228

Rep: Reputation: Disabled
Why can the module “r8152” still be loaded after the driver “r8152.ko” was deleted?


I have a USB RTL8152 network adapter, which uses the “r8152” driver.
I just did the following test:

(1) I deleted "/var/lib/dkms/backport-ethernet/1.0.4/5.10.0-amd64-desktop/x86_64/module/r8152.ko"
(2) I deleted "/var/lib/dkms/backport-ethernet/original_module/5.10.0-amd64-desktop/x86_64/r8152.ko"
(3) I rebooted the PC.
(4) Now, I can still access the Internet via the RTL8152 adapter because “r8152” has been loaded as per the output of “lsmod”.

Does anyone know why “r8152” can still be loaded after “r8152.ko” was deleted? I have never installed "r8152" since I installed UnionTech OS.
Code:
Matthew_Wai@My-PC:~$ lsmod | grep 8152
r8152                 245760  0
 
Old 01-01-2024, 07:37 AM   #2
biker_rat
Member
 
Registered: Feb 2010
Posts: 416

Rep: Reputation: 250Reputation: 250Reputation: 250
r8152 module is part of my normal 6.6.8 kernel, so possibly it is enabled in your kernel config too and you don't need dkms?
 
Old 01-01-2024, 10:42 PM   #3
Matthew Wai
Member
 
Registered: Jul 2019
Location: China
Distribution: UnionTech OS Desktop Home (64-bit)
Posts: 228

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by biker_rat View Post
r8152 module is part of my normal 6.6.8 kernel, so possibly it is enabled in your kernel config too and you don't need dkms?
How can I find out whether it has been enabled in my kernel configuration?

Code:
Matthew_Wai@My-PC:~$ uname -rsm
Linux 5.10.0-amd64-desktop x86_64
 
Old 01-02-2024, 12:37 AM   #4
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,696
Blog Entries: 33

Rep: Reputation: 290Reputation: 290Reputation: 290
Hi, you can/may blacklist the module by creating a file...

in /etc/moprobe.d/<file-name.conf>

/etc/modprobe.d/r8152-blacklist.conf
Code:
# blacklist r8152
blacklist r8152
note: some modules are dependants of other modules, maybe not in this case, but if you get multiple module loading failures, it could be this reason.

I hope this helps.
 
Old 01-02-2024, 01:07 AM   #5
Matthew Wai
Member
 
Registered: Jul 2019
Location: China
Distribution: UnionTech OS Desktop Home (64-bit)
Posts: 228

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by GlennsPref View Post
Hi, you can/may blacklist the module
I already know how to blacklist a driver, but I don't mean to do so.
 
1 members found this post helpful.
Old 01-02-2024, 02:15 AM   #6
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,696
Blog Entries: 33

Rep: Reputation: 290Reputation: 290Reputation: 290
The loaded modules are in /lib/modules/6.5.0-0.deb12.4-amd64/kernel/ on my box.

your module is listed there.

/lib/modules/6.5.0-0.deb12.4-amd64/modules.order and modules.dep and maybe others the module is listed.

If it is really important to get it out of the system, configuring and compiling the kernel sources may be a better fit for your situation.

saw this... https://www.baeldung.com/linux/list-...kernel-modules

Last edited by GlennsPref; 01-02-2024 at 02:16 AM. Reason: typo
 
1 members found this post helpful.
Old 01-02-2024, 03:03 AM   #7
___
Member
 
Registered: Apr 2023
Distribution: mll,4M
Posts: 257
Blog Entries: 1

Rep: Reputation: Disabled
grep 8152 /boot/config-`uname -r`
CONFIG_USB_RTL8152=? m or y?
 
Old 01-02-2024, 06:29 AM   #8
biker_rat
Member
 
Registered: Feb 2010
Posts: 416

Rep: Reputation: 250Reputation: 250Reputation: 250
ls /boot
pick out name of your config in boot
then what above guy said
ie:
grep 8152 /boot/nameofyourconfigfileinbootdirectory
 
Old 01-02-2024, 11:09 AM   #9
Sauerland
Member
 
Registered: Jul 2017
Distribution: openSUSE Leap
Posts: 247

Rep: Reputation: Disabled
deleted

Last edited by Sauerland; 01-02-2024 at 11:12 AM.
 
Old 01-02-2024, 11:40 PM   #10
Matthew Wai
Member
 
Registered: Jul 2019
Location: China
Distribution: UnionTech OS Desktop Home (64-bit)
Posts: 228

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by GlennsPref View Post
The loaded modules are in /lib/modules/6.5.0-0.deb12.4-amd64/kernel/ on my box.
"r8152" cannot be found although it has been loaded. See below:
Code:
Matthew_Wai@My-PC:~$ lsmod | grep "r8152"
r8152                 245760  0
Matthew_Wai@My-PC:~$ sudo find /lib/modules/$(uname -r)/ -name "8152.*"
[sudo] password for Matthew_Wai: 
Verification successful
Matthew_Wai@My-PC:~$ sudo find /usr/lib/modules/$(uname -r)/ -name "8152.*"
Matthew_Wai@My-PC:~$
Quote:
Originally Posted by GlennsPref View Post
If it is really important to get it out of the system, configuring and compiling the kernel sources may be a better fit for your situation.
There is misunderstanding.
I don't want to get it out. I want to find out where it is located. I am just curious to know.
 
Old 01-02-2024, 11:53 PM   #11
Matthew Wai
Member
 
Registered: Jul 2019
Location: China
Distribution: UnionTech OS Desktop Home (64-bit)
Posts: 228

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ___ View Post
grep 8152 /boot/config-`uname -r`
CONFIG_USB_RTL8152=? m or y?
What does "=m" mean in the following output?
Code:
Matthew_Wai@My-PC:~$ sudo cat /boot/config-$(uname -r)|grep 8152
[sudo] password for Matthew_Wai: 
CONFIG_USB_RTL8152=m
Matthew_Wai@My-PC:~$
 
Old 01-03-2024, 12:41 AM   #12
___
Member
 
Registered: Apr 2023
Distribution: mll,4M
Posts: 257
Blog Entries: 1

Rep: Reputation: Disabled
m means module. Not built into kernel. modprobe/insmod would load/unload it.

Your find -name needs a *8.... because it doesn't begin with an 8!

Code:
$  find /usr/lib/modules/$(uname -r)/ -name "*8152.*"
/usr/lib/modules/5.15.0-91-generic/kernel/drivers/net/usb/r8152.ko
That's different than /var/lib/dkms/backport-ethernet/...
(IDK about that but a web-search of "dkms/backport-ethernet" finds your https://www.linuxquestions.org/quest....php?p=6406608)

I'd suggest (after sudo updatedb): locate r8152.ko

Last edited by ___; 01-03-2024 at 12:54 AM.
 
1 members found this post helpful.
Old 01-03-2024, 02:32 AM   #13
Matthew Wai
Member
 
Registered: Jul 2019
Location: China
Distribution: UnionTech OS Desktop Home (64-bit)
Posts: 228

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ___ View Post
Your find -name needs a *8.... because it doesn't begin with an 8!
Thank you! I have found it. See below:
Code:
Matthew_Wai@My-PC:~$ lsmod | grep "r8152"
r8152                 245760  0
Matthew_Wai@My-PC:~$ sudo find /usr/lib/modules/$(uname -r)/ -name "*8152.*"
[sudo] password for Matthew_Wai: 
Verification successful
/usr/lib/modules/5.10.0-amd64-desktop/updates/ethernet-dkms/drivers/net/usb/r8152.ko
Matthew_Wai@My-PC:~$ sudo find /lib/modules/$(uname -r)/ -name "*8152.*"
/lib/modules/5.10.0-amd64-desktop/updates/ethernet-dkms/drivers/net/usb/r8152.ko
Matthew_Wai@My-PC:~$ sudo rmmod r8152 
Matthew_Wai@My-PC:~$ lsmod | grep "r8152"
Matthew_Wai@My-PC:~$ sudo find /usr/lib/modules/$(uname -r)/ -name "*8152.*"
/usr/lib/modules/5.10.0-amd64-desktop/updates/ethernet-dkms/drivers/net/usb/r8152.ko
Matthew_Wai@My-PC:~$ sudo find /lib/modules/$(uname -r)/ -name "*8152.*"
/lib/modules/5.10.0-amd64-desktop/updates/ethernet-dkms/drivers/net/usb/r8152.ko
Matthew_Wai@My-PC:~$
 
Old 01-03-2024, 10:33 AM   #14
Sauerland
Member
 
Registered: Jul 2017
Distribution: openSUSE Leap
Posts: 247

Rep: Reputation: Disabled
Code:
/lib/modules/5.10.0-amd64-desktop/updates/ethernet-dkms/drivers/net/usb/r8152.ko
It is installed.
I do not know how you have installed it....... apt?
Delete it with the proper command.

PS
all *.ko in the /lib/modules/xxxxxxxxx/updates directory will be copied on next kernel update to the new directory /lib/modules/yyyyy/weak-updates directory.

Thats why I build the drivers as rpm for openSUSE only for the kernel delivered with the Installation-DVD.

Last edited by Sauerland; 01-03-2024 at 10:40 AM.
 
Old 01-07-2024, 07:32 AM   #15
Matthew Wai
Member
 
Registered: Jul 2019
Location: China
Distribution: UnionTech OS Desktop Home (64-bit)
Posts: 228

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Sauerland View Post
I do not know how you have installed it....... apt?
I have never installed it.
I booted my PC into a live session, in which the said adapter worked properly, as the driver was already loaded.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What are the minimal and mandatory content loaded into ram from rootfs on boot up after kernel loaded? ayyasprings Linux - Kernel 3 03-22-2019 02:15 PM
why my module can not be loaded by Apache? iclinux Linux - Newbie 1 06-10-2005 05:35 PM
paraport_pc module loaded with wrong options, st not loaded adrianmariano Debian 2 12-18-2004 09:37 PM
Finding Module Dependencies...(Still loading...still loading..still loading..HANG!!!) Aeudian Linux - General 3 08-11-2003 03:31 PM
Finding Module Dependencies.....(still loading....Still loading....still loading) Aeudian Linux - Newbie 1 07-28-2003 02:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 09:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration