Ticket #103 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

some modules can be loaded more than once

Reported by: Sven <skoehler@upb.de> Owned by: roy
Priority: normal Milestone:
Component: init.d scripts Version:
Keywords: Cc:

Description

Hallo,

so i think, there's a major flaw in the design of /etc/conf.d/modules.

For example to create the network interfaces dummy0 and dummy1 you have to do execute the following commands:

modprobe -o dummy123 dummy
modprobe -o dummy246 dummy

lsmod will show, that the modules "dummy123" and "dummy246" are loaded. (These are just two different names for the same module loaded twice).

So i think this is not possible with openrc's /etc/init.d/modules, or is it?

Attachments

modules-alias.patch Download (0 bytes) - added by roy 2 years ago.
Allow module aliasing.
modules.diff Download (0 bytes) - added by roy 2 years ago.
Allow module aliasing
openrc-modules2.patch Download (0 bytes) - added by Sven <skoehler@upb.de> 2 years ago.
fix for the little glitch

Change History

comment:458 Changed 2 years ago by roy

Not with the present structure, no.
Maybe we need to be able to alias them?

modules="dummy:dummy1 dummy:dummy2"
dummy1="dummy123"
dummy2="dummy213"

comment:460 Changed 2 years ago by Sven <skoehler@upb.de>

Using your idea of aliasing, i would suggest the following:

modules="

dummy:dummy123
dummy:dummy246

"
module_dummy123_args="testparam1"
module_dummy246_args="testparam2"

resulting in the following modprobes:

modprobe -o dummy123 dummy testparam1
modprobe -o dummy246 dummy testparam2

That should do very well. I didn't understand your idea behind the

dummy1="dummy123"
dummy2="dummy213"

I think it's just another unnecessary mapping.

Changed 2 years ago by roy

Allow module aliasing.

comment:463 Changed 2 years ago by roy

Created an attachment (id=45)
Allow module aliasing.

Does this work as described above?

comment:464 Changed 2 years ago by Sven <skoehler@upb.de>

Created an attachment (id=46)
Missing change

Hi! Yes, it works fine, but you had forgotten to change the call to modprobe.

Maybe you don't want the -o option in case $a and $x match. But maybe it doesn't do any harm if it's there all the time.

I tried modules="dummy:dummy1 dummy:dummy2" and indeed lsmod shows both dummy1 and dummy2.

comment:466 Changed 2 years ago by Sven <skoehler@upb.de>

Or, maybe i missunderstood, and you want it to work this way:

modules="dummy:dummy1 dummy:dummy2"
module_dummy1_args="-o dummy123"
module_dummy2_args="-o dummy213"

That would then result in:

modprobe dummy -o dummy123
modprobe dummy -o dummy246

Hmm, but it think it's not quite the way the modprobe command line should look like. (But it works too)

Anyway: in that case you're orignal patch looks fine to me.

Changed 2 years ago by roy

Allow module aliasing

comment:468 Changed 2 years ago by roy

Created an attachment (id=48)
Allow module aliasing

Your way is better, but we should allow different arguments per alias.
Try this :)

Changed 2 years ago by Sven <skoehler@upb.de>

fix for the little glitch

comment:469 Changed 2 years ago by Sven <skoehler@upb.de>

Created an attachment (id=49)
fix for the little glitch

works, with one little glitch:

mpargs stays set from the previous iteration of the for-loop.

comment:471 Changed 2 years ago by roy

  • Status changed from new to resolved
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.