LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   rmmod doesn't work properly (https://www.linuxquestions.org/questions/linux-kernel-70/rmmod-doesnt-work-properly-795960/)

atmurali 03-17-2010 02:18 AM

rmmod doesn't work properly
 
Hello,
I am using mini2440 arm board with linux 2.29.4 kernel ported. I can successfully insert the kernel module (main.ko). But when trying rmmod it does not be removed.
###########
[root@FriendlyARM /]# rmmod main.ko
rmmod: chdir(2.6.29.4-FriendlyARM): No such file or directory
[root@FriendlyARM /]# modprobe -r main.ko
modprobe: chdir(2.6.29.4-FriendlyARM): No such file or directory
##########
Please help me to solve the problem.
Thanking You,
Anoob T Murali.

Aquarius_Girl 03-17-2010 07:01 AM

What does dmesg say,

After you insmod the module ?

After you rmmod the module ?

atmurali 03-18-2010 12:33 AM

Hello,
When I 'insmod' the module, the message in printk(" message"); was displayed (in dmesg also).

After 'rmmod' there is no other messages in 'dmesg'.
What may the problem is?

kirukan 03-18-2010 12:37 AM

Did you check whether the module loaded?
What is the output for lsmod?

Sayan Acharjee 03-18-2010 12:47 AM

Quote:

Originally Posted by atmurali (Post 3901401)
Hello,
I am using mini2440 arm board with linux 2.29.4 kernel ported. I can successfully insert the kernel module (main.ko). But when trying rmmod it does not be removed.
###########
[root@FriendlyARM /]# rmmod main.ko
rmmod: chdir(2.6.29.4-FriendlyARM): No such file or directory
[root@FriendlyARM /]# modprobe -r main.ko
modprobe: chdir(2.6.29.4-FriendlyARM): No such file or directory
##########
Please help me to solve the problem.
Thanking You,
Anoob T Murali.

Are you sure there is a module named main.ko?
First check the output of lsmod to see if its there or not, if its not there then its obvious that it will give that error.
use this command to serach main.ko:
#lsmod |grep main.ko

jayjwa 03-19-2010 12:00 AM

The kernel looks for its modules in /lib/modules/`uname -r`/. Likely your kernel and your modules aren't in sync with what arch/release they think they are, likely because they were installed from some (differing) packages. That is, either the kernel or the modules is having an identity crisis. You can avoid the problem totally by building/installing the kernel and its modules from the same source. Remember to run depmod afterwards. Also, modules should be inserted with 'modprobe whatever' and removed with 'modprobe -r whatever'. List all available modules the kernel knows of with 'modprobe -l '.

Quakeboy02 03-19-2010 12:13 AM

Quote:

Originally Posted by atmurali (Post 3901401)
Hello,
I am using mini2440 arm board with linux 2.29.4 kernel ported. I can successfully insert the kernel module (main.ko). But when trying rmmod it does not be removed.
###########
[root@FriendlyARM /]# rmmod main.ko
rmmod: chdir(2.6.29.4-FriendlyARM): No such file or directory
[root@FriendlyARM /]# modprobe -r main.ko
modprobe: chdir(2.6.29.4-FriendlyARM): No such file or directory
##########
Please help me to solve the problem.
Thanking You,
Anoob T Murali.

A module is inserted with insmod using the fileid of the module; which ends with ".ko". However, the fileid is not the module name; which is the fileid minus the ".ko". Try doing a rmmod on just "main". By the way, that is a somewhat dangerous name for a module.

Aquarius_Girl 03-19-2010 12:39 AM

Quakeboy02,

Oh you are so correct, this small error slipped out of my mind :doh:

atmurali 03-23-2010 12:26 AM

Thank You all.

I got it.
One of my problems was using rmmod main.ko, I have used it without .ko.
Second I created a folder "2.6.29.4-FriendlyARM" under /lib/module.

And Thank You for all.

Aquarius_Girl 03-23-2010 12:28 AM

atmurali,

Nice, you got it solved :)

wujianwen 04-23-2010 04:26 AM

also refer to :www.developmentboard.net
embedded board


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