* module parameters versus kernel command line
@ 2008-04-03 13:00 Tom Horsley
2008-04-03 15:39 ` Randy Dunlap
0 siblings, 1 reply; 10+ messages in thread
From: Tom Horsley @ 2008-04-03 13:00 UTC (permalink / raw)
To: linux-kernel
Just curious: Is there any reason even dynamically loaded
modules shouldn't be able to find module parameters on
the kernel command line? I haven't actually investigated
the code involved (since I have no idea where it is :-),
but it sure seems like it would be convenient to have
a single place to put module parameters where they
would always be found regardless of the module's static
or dynamic build mode (especially when multi-booting
different kernels built different ways).
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: module parameters versus kernel command line
2008-04-03 13:00 module parameters versus kernel command line Tom Horsley
@ 2008-04-03 15:39 ` Randy Dunlap
2008-04-03 16:04 ` Tom Horsley
0 siblings, 1 reply; 10+ messages in thread
From: Randy Dunlap @ 2008-04-03 15:39 UTC (permalink / raw)
To: Tom Horsley; +Cc: linux-kernel
On Thu, 3 Apr 2008 09:00:53 -0400 Tom Horsley wrote:
> Just curious: Is there any reason even dynamically loaded
> modules shouldn't be able to find module parameters on
> the kernel command line? I haven't actually investigated
> the code involved (since I have no idea where it is :-),
> but it sure seems like it would be convenient to have
> a single place to put module parameters where they
> would always be found regardless of the module's static
> or dynamic build mode (especially when multi-booting
> different kernels built different ways).
> --
Does this answer your question? from Documentation/kernel-parameters.txt:
Module parameters for loadable modules are specified only as the
parameter name with optional '=' and value as appropriate, such as:
modprobe usbcore blinkenlights=1
Module parameters for modules that are built into the kernel image
are specified on the kernel command line with the module name plus
'.' plus parameter name, with '=' and value if appropriate, such as:
usbcore.blinkenlights=1
---
~Randy
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: module parameters versus kernel command line
2008-04-03 15:39 ` Randy Dunlap
@ 2008-04-03 16:04 ` Tom Horsley
2008-04-03 16:14 ` Randy Dunlap
2008-04-03 16:31 ` Chris Friesen
0 siblings, 2 replies; 10+ messages in thread
From: Tom Horsley @ 2008-04-03 16:04 UTC (permalink / raw)
To: linux-kernel
On Thu, 3 Apr 2008 08:39:53 -0700
Randy Dunlap <randy.dunlap@oracle.com> wrote:
> Module parameters for modules that are built into the kernel image
> are specified on the kernel command line with the module name plus
> '.' plus parameter name, with '=' and value if appropriate, such as:
>
> usbcore.blinkenlights=1
I know that part, I'm just wondering if it would be nice to have
even dynamically loaded modules notice the kernel option
so that the "usbcore" module would see the "blinkenlights=1"
parameter from the kernel boot options when dynamically loaded?
That way, you wouldn't have to stop and figure out if a module
was static or dynamic to decide if you need to edit the grub boot
line or the modprobe.conf file.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: module parameters versus kernel command line
2008-04-03 16:04 ` Tom Horsley
@ 2008-04-03 16:14 ` Randy Dunlap
2008-04-03 23:09 ` Rusty Russell
2008-04-03 16:31 ` Chris Friesen
1 sibling, 1 reply; 10+ messages in thread
From: Randy Dunlap @ 2008-04-03 16:14 UTC (permalink / raw)
To: Tom Horsley; +Cc: linux-kernel, rusty
On Thu, 3 Apr 2008 12:04:25 -0400 Tom Horsley wrote:
> On Thu, 3 Apr 2008 08:39:53 -0700
> Randy Dunlap <randy.dunlap@oracle.com> wrote:
Please use reply-to-all.
> > Module parameters for modules that are built into the kernel image
> > are specified on the kernel command line with the module name plus
> > '.' plus parameter name, with '=' and value if appropriate, such as:
> >
> > usbcore.blinkenlights=1
>
> I know that part, I'm just wondering if it would be nice to have
> even dynamically loaded modules notice the kernel option
> so that the "usbcore" module would see the "blinkenlights=1"
> parameter from the kernel boot options when dynamically loaded?
>
> That way, you wouldn't have to stop and figure out if a module
> was static or dynamic to decide if you need to edit the grub boot
> line or the modprobe.conf file.
OK, that makes some sense to me.
Rusty added to cc for his objective viewpoint.
---
~Randy
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: module parameters versus kernel command line
2008-04-03 16:04 ` Tom Horsley
2008-04-03 16:14 ` Randy Dunlap
@ 2008-04-03 16:31 ` Chris Friesen
1 sibling, 0 replies; 10+ messages in thread
From: Chris Friesen @ 2008-04-03 16:31 UTC (permalink / raw)
To: Tom Horsley; +Cc: linux-kernel
Tom Horsley wrote:
> I know that part, I'm just wondering if it would be nice to have
> even dynamically loaded modules notice the kernel option
> so that the "usbcore" module would see the "blinkenlights=1"
> parameter from the kernel boot options when dynamically loaded?
What if the module is loaded with parameters, and parameters are also
specified in the kernel command line?
I'd suggest that the dynamic parameter should probably take precedence,
as that would allow the user to specify things that were not necessarily
known at boot time, while still providing a boot-time fallback.
Chris
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: module parameters versus kernel command line
2008-04-03 16:14 ` Randy Dunlap
@ 2008-04-03 23:09 ` Rusty Russell
2008-04-04 11:45 ` Marc Pignat
0 siblings, 1 reply; 10+ messages in thread
From: Rusty Russell @ 2008-04-03 23:09 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Tom Horsley, linux-kernel
On Friday 04 April 2008 02:14:44 Randy Dunlap wrote:
> On Thu, 3 Apr 2008 12:04:25 -0400 Tom Horsley wrote:
> > I know that part, I'm just wondering if it would be nice to have
> > even dynamically loaded modules notice the kernel option
> > so that the "usbcore" module would see the "blinkenlights=1"
> > parameter from the kernel boot options when dynamically loaded?
> >
> > That way, you wouldn't have to stop and figure out if a module
> > was static or dynamic to decide if you need to edit the grub boot
> > line or the modprobe.conf file.
>
> OK, that makes some sense to me.
>
> Rusty added to cc for his objective viewpoint.
I agree with Randy; it has some appeal, but it's not a killer feature.
We already do the reverse: sysfs exposed parameters are the same for modules
and builtins. If they're modifiable (most aren't), you don't have to care
whether it's a module or not.
But there are also minor downsides. The first is that we currently warn about
unused parameters (at least those containing '.'). We'd have to come up with
something cleverer if we want to warn only about parameters which cannot be
used by modules (ie. do it in userspace).
The second is that users might be surprised when they take
the 'usbcore.blinkenlights' line out of their modprobe config file and it
still applies. Most users use everything-is-a-module distributions.
Finally, it would be logical to take all the module parameters and autogen
them into the kernel commandline, but it will soon hit cmdline limits (hmm,
actually on my Ubuntu Hardy system here I think I'd be OK).
Cheers,
Rusty.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: module parameters versus kernel command line
2008-04-03 23:09 ` Rusty Russell
@ 2008-04-04 11:45 ` Marc Pignat
2008-04-04 22:29 ` Rusty Russell
0 siblings, 1 reply; 10+ messages in thread
From: Marc Pignat @ 2008-04-04 11:45 UTC (permalink / raw)
To: Rusty Russell; +Cc: Randy Dunlap, Tom Horsley, linux-kernel
On Friday 04 April 2008, Rusty Russell wrote:
...
> The second is that users might be surprised when they take
> the 'usbcore.blinkenlights' line out of their modprobe config file and it
> still applies. Most users use everything-is-a-module distributions.
Why don't do it in user space (let insmod/modprobe parse /proc/cmdline)?
1. Users won't be surprised after looking at the new man pages:)
2. it will work with older kernel
The warning problem is more complicated to fix.
Regards
Marc
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: module parameters versus kernel command line
2008-04-04 11:45 ` Marc Pignat
@ 2008-04-04 22:29 ` Rusty Russell
2008-04-05 22:54 ` Tom Horsley
0 siblings, 1 reply; 10+ messages in thread
From: Rusty Russell @ 2008-04-04 22:29 UTC (permalink / raw)
To: Marc Pignat; +Cc: Randy Dunlap, Tom Horsley, linux-kernel, Jon Masters
On Friday 04 April 2008 21:45:37 Marc Pignat wrote:
> On Friday 04 April 2008, Rusty Russell wrote:
> ...
>
> > The second is that users might be surprised when they take
> > the 'usbcore.blinkenlights' line out of their modprobe config file and it
> > still applies. Most users use everything-is-a-module distributions.
>
> Why don't do it in user space (let insmod/modprobe parse /proc/cmdline)?
> 1. Users won't be surprised after looking at the new man pages:)
> 2. it will work with older kernel
>
> The warning problem is more complicated to fix.
I like this idea, and also have module tools ship with
a 'check-kernel-cmdline' tool which handles the warnings for unusable cmdline
params. Distributions can run this in their init scripts, and we can remove
the warning from the kernel.
The best bit about this idea: it's now Jon's problem :)
Cheers,
Rusty.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: module parameters versus kernel command line
2008-04-04 22:29 ` Rusty Russell
@ 2008-04-05 22:54 ` Tom Horsley
2008-04-06 3:08 ` Rusty Russell
0 siblings, 1 reply; 10+ messages in thread
From: Tom Horsley @ 2008-04-05 22:54 UTC (permalink / raw)
To: Rusty Russell; +Cc: Marc Pignat, Randy Dunlap, linux-kernel, Jon Masters
On Sat, 5 Apr 2008 08:29:00 +1000
Rusty Russell <rusty@rustcorp.com.au> wrote:
> I like this idea, and also have module tools ship with
> a 'check-kernel-cmdline' tool which handles the warnings for unusable cmdline
> params. Distributions can run this in their init scripts, and we can remove
> the warning from the kernel.
Or maybe not have the warning at all, after all, even if sillymodule.sillyarg=1
doesn't make sense when I booted, who's to say I can't download the source
to sillymodule, compile it, and modprobe it after boot time :-).
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: module parameters versus kernel command line
2008-04-05 22:54 ` Tom Horsley
@ 2008-04-06 3:08 ` Rusty Russell
0 siblings, 0 replies; 10+ messages in thread
From: Rusty Russell @ 2008-04-06 3:08 UTC (permalink / raw)
To: Tom Horsley; +Cc: Marc Pignat, Randy Dunlap, linux-kernel, Jon Masters
On Sunday 06 April 2008 08:54:44 Tom Horsley wrote:
> On Sat, 5 Apr 2008 08:29:00 +1000
>
> Rusty Russell <rusty@rustcorp.com.au> wrote:
> > I like this idea, and also have module tools ship with
> > a 'check-kernel-cmdline' tool which handles the warnings for unusable
> > cmdline params. Distributions can run this in their init scripts, and we
> > can remove the warning from the kernel.
>
> Or maybe not have the warning at all, after all, even if
> sillymodule.sillyarg=1 doesn't make sense when I booted, who's to say I
> can't download the source to sillymodule, compile it, and modprobe it after
> boot time :-).
I think it's worse not to have typo protection. Of course, our logs are so
noisy they might miss the warning anyway.
Rusty.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-04-06 3:08 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-03 13:00 module parameters versus kernel command line Tom Horsley
2008-04-03 15:39 ` Randy Dunlap
2008-04-03 16:04 ` Tom Horsley
2008-04-03 16:14 ` Randy Dunlap
2008-04-03 23:09 ` Rusty Russell
2008-04-04 11:45 ` Marc Pignat
2008-04-04 22:29 ` Rusty Russell
2008-04-05 22:54 ` Tom Horsley
2008-04-06 3:08 ` Rusty Russell
2008-04-03 16:31 ` Chris Friesen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).