public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG] module-init-tools 0.9.3, rmmod modules with '-'
@ 2002-12-16 11:06 Vamsi Krishna S .
  2002-12-16 21:36 ` Rusty Russell
  0 siblings, 1 reply; 10+ messages in thread
From: Vamsi Krishna S . @ 2002-12-16 11:06 UTC (permalink / raw)
  To: rusty; +Cc: lkml

Hi Rusty,

It seems we cannot unload modules if they have a '-' in their name. 
filename2modname() in rmmod.c converts a '-' in the filename
to '_'. Why? Are dashes not allowed as part of module names?

For eg: (kernel 2.5.52/module-init-tools 0.9.3)

[root@llm10 test-modules]# ./insmod probe-test.o
[root@llm10 test-modules]# ./lsmod
Module                  Size  Used by
probe-test               943  0
[root@llm10 test-modules]# cat /proc/modules
probe-test 943 0
[root@llm10 test-modules]# ./rmmod -V
module-init-tools version 0.9.3
[root@llm10 test-modules]# ./rmmod probe-test
ERROR: Module probe_test does not exist in /proc/modules
                   ^note this

Editing filename2modname() to remove this special test for
'-' seems to fix it. But, this is done explicitly, so
I wonder if there is a deeper meaning to this. Can you
please take a look and explain?

Thanks,
Vamsi.
-- 
Vamsi Krishna S.
Linux Technology Center,
IBM Software Lab, Bangalore.
Ph: +91 80 5044959
Internet: vamsi@in.ibm.com
--
--- rmmod-old.c	2002-12-13 21:11:57.000000000 +0530
+++ rmmod.c	2002-12-13 21:10:44.000000000 +0530
@@ -157,9 +157,12 @@
 	else
 		afterslash++;
 
-	/* stop at first . */
+	/* Convert to underscores, stop at first . */
 	for (i = 0; afterslash[i] && afterslash[i] != '.'; i++) {
-		modname[i] = afterslash[i];
+		if (afterslash[i] == '-')
+			modname[i] = '_';
+		else
+			modname[i] = afterslash[i];
 	}
 	modname[i] = '\0';
 }

^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: [BUG] module-init-tools 0.9.3, rmmod modules with '-'
@ 2002-12-17  6:55 Osamu Tomita
  0 siblings, 0 replies; 10+ messages in thread
From: Osamu Tomita @ 2002-12-17  6:55 UTC (permalink / raw)
  To: 'Rusty Russell '; +Cc: 'lkml '

-----Original Message-----
From: Rusty Russell
To: Zwane Mwaikambo
Cc: vamsi@in.ibm.com; lkml
Sent: 2002/12/17 9:17
Subject: Re: [BUG] module-init-tools 0.9.3, rmmod modules with '-' 

> Yes, the filenames are unchanged.  But if you modprobe snd-mixer-oss,
> you'll see snd_mixer_oss in /proc/modules.  But rmmod "snd-mixer-oss"
> works as expected.  Basically, the kernel and tools see them as
> equivalent: anything else is a bug, please report.

I have another problem related this one.
"options snd-cs4232 port=0xf44 ..." in modprobe.conf is ignored.
This is created by modprobe.conf2modprobe.conf in module-init-
tools 0.9.3.
When I rewite it to "options snd_cs4232 port=0xf44 ..." by hand,
it works fine.

Regards,
Osamu

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-12-19  6:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-16 11:06 [BUG] module-init-tools 0.9.3, rmmod modules with '-' Vamsi Krishna S .
2002-12-16 21:36 ` Rusty Russell
2002-12-16 23:39   ` Zwane Mwaikambo
2002-12-17  0:17     ` Rusty Russell
2002-12-17  6:18       ` Vamsi Krishna S .
2002-12-18  0:23         ` Rusty Russell
2002-12-18 17:47           ` Kai Germaschewski
2002-12-19  0:39             ` Rusty Russell
2002-12-19  7:11             ` Vamsi Krishna S .
  -- strict thread matches above, loose matches on Subject: below --
2002-12-17  6:55 Osamu Tomita

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox