module parameters versus kernel command line - Kernel

This is a discussion on module parameters versus kernel command line - 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 ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: module parameters versus kernel command line

  1. module parameters versus kernel command line

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

  2. Re: module parameters versus kernel command line

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

  3. Re: module parameters versus kernel command line

    On Thu, 3 Apr 2008 08:39:53 -0700
    Randy Dunlap 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.
    --
    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/

  4. Re: module parameters versus kernel command line

    On Thu, 3 Apr 2008 12:04:25 -0400 Tom Horsley wrote:

    > On Thu, 3 Apr 2008 08:39:53 -0700
    > Randy Dunlap 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
    --
    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/

  5. Re: module parameters versus kernel command line

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

  6. Re: module parameters versus kernel command line

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

  7. Re: module parameters versus kernel command line

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

  8. Re: module parameters versus kernel command line

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

  9. Re: module parameters versus kernel command line

    On Sat, 5 Apr 2008 08:29:00 +1000
    Rusty Russell 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 :-).
    --
    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/

  10. Re: module parameters versus kernel command line

    On Sunday 06 April 2008 08:54:44 Tom Horsley wrote:
    > On Sat, 5 Apr 2008 08:29:00 +1000
    >
    > Rusty Russell 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.
    --
    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/

+ Reply to Thread