lkml.org 
[lkml]   [2003]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Loading a module multtiple times
Date
In message <20030430140557.12e13f1a.rddunlap@osdl.org> you write:
>
> Hi Rusty-
>
> I was looking into a bug in /proc/net/dev truncated output.
> /proc/net/dev lists {if (!buggy)} all loaded network interfaces.
>
> To get a large number of network interfaces, Christian (below)
> told me to copy driver/net/dummy.o to several different file names
> and then insmod them. It seems to have worked for him, and it works
> that way in 2.4.recent, but it's not working for me. See error
> messages below.
>
> Which way is expected behavior?
> What should be the expected behavior?
> or am I just seeing bugs (failures) that noone else sees?

No, it's a 2.5 thing: modules know their own name. This is because
(1) the names are used to set new-style boot parameters, (2) needing
to insert two modules is usually wrong, since how would that work if
the module was built-in?

It also opens us up to the possibility of a list of built-in modules,
if we wanted to.

However, the -o option to modprobe replaces the module name (by
hacking the elf object, yes), because programmers are basically lazy,
and multiple modules are useful for testing.

So, you want:
for i in `seq 1 100`; do modprobe -o dummy$i dummy; done

This works on 2.4 as well. Note that insmod doesn't support -o, being
a trivial program by design.

> It seems like not supporting this is likely to cause some problems.

Yes. Removing any feature causes problems 8(. But adding every
feature is usually worse.

Hope this clarifies?
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.784 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site