Re: Loading a module multtiple times

Randy.Dunlap (rddunlap@osdl.org)
Wed, 30 Apr 2003 22:10:37 -0700 (PDT)


> 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.

Argh, I looked thru insmod.c but not modprobe.c for a solution.

>> 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?

Yes, thanks much.

~Randy

-
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/