* How to compile module params into kernel?
@ 2006-11-08 18:43 Joakim Tjernlund
2006-11-08 19:05 ` Jesper Juhl
0 siblings, 1 reply; 10+ messages in thread
From: Joakim Tjernlund @ 2006-11-08 18:43 UTC (permalink / raw)
To: linux-kernel
Instead of passing a module param on the cmdline I want to compile that
into
the kernel, but I can't figure out how.
The module param I want compile into kernel is
rtc-ds1307.force=0,0x68
This is for an embeddet target that doesn't have loadable module
support.
Thanks
Jocke
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: How to compile module params into kernel?
2006-11-08 18:43 How to compile module params into kernel? Joakim Tjernlund
@ 2006-11-08 19:05 ` Jesper Juhl
2006-11-08 20:02 ` Joakim Tjernlund
0 siblings, 1 reply; 10+ messages in thread
From: Jesper Juhl @ 2006-11-08 19:05 UTC (permalink / raw)
To: Joakim Tjernlund; +Cc: linux-kernel
On 08/11/06, Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote:
> Instead of passing a module param on the cmdline I want to compile that
> into
> the kernel, but I can't figure out how.
>
> The module param I want compile into kernel is
> rtc-ds1307.force=0,0x68
>
> This is for an embeddet target that doesn't have loadable module
> support.
>
You could edit the module source and hardcode default values.
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: How to compile module params into kernel?
2006-11-08 19:05 ` Jesper Juhl
@ 2006-11-08 20:02 ` Joakim Tjernlund
2006-11-08 20:09 ` Jesper Juhl
2006-11-08 20:59 ` Richard B. Johnson
0 siblings, 2 replies; 10+ messages in thread
From: Joakim Tjernlund @ 2006-11-08 20:02 UTC (permalink / raw)
To: 'Jesper Juhl'; +Cc: linux-kernel
> -----Original Message-----
> From: Jesper Juhl [mailto:jesper.juhl@gmail.com]
>
> On 08/11/06, Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote:
> > Instead of passing a module param on the cmdline I want to
> compile that
> > into
> > the kernel, but I can't figure out how.
> >
> > The module param I want compile into kernel is
> > rtc-ds1307.force=0,0x68
> >
> > This is for an embeddet target that doesn't have loadable module
> > support.
> >
> You could edit the module source and hardcode default values.
>
Yes, but I don't want to do that since it makes maintance
harder.
Jocke
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: How to compile module params into kernel?
2006-11-08 20:02 ` Joakim Tjernlund
@ 2006-11-08 20:09 ` Jesper Juhl
2006-11-08 20:14 ` Jan-Benedict Glaw
2006-11-08 20:16 ` Miguel Ojeda
2006-11-08 20:59 ` Richard B. Johnson
1 sibling, 2 replies; 10+ messages in thread
From: Jesper Juhl @ 2006-11-08 20:09 UTC (permalink / raw)
To: Joakim Tjernlund; +Cc: linux-kernel
On 08/11/06, Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote:
> > -----Original Message-----
> > From: Jesper Juhl [mailto:jesper.juhl@gmail.com]
> >
> > On 08/11/06, Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote:
> > > Instead of passing a module param on the cmdline I want to
> > compile that
> > > into
> > > the kernel, but I can't figure out how.
> > >
> > > The module param I want compile into kernel is
> > > rtc-ds1307.force=0,0x68
> > >
> > > This is for an embeddet target that doesn't have loadable module
> > > support.
> > >
> > You could edit the module source and hardcode default values.
> >
>
> Yes, but I don't want to do that since it makes maintance
> harder.
>
Well, as far as I know, there's no way to specify default module
options at compile time. The defaults are set in the module source and
are modifiable at module load time or by setting options on the kernel
command line at boot tiem. So, if that's no good for you I don't see
any other way except modifying the source to hardcode new defaults.
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: How to compile module params into kernel?
2006-11-08 20:09 ` Jesper Juhl
@ 2006-11-08 20:14 ` Jan-Benedict Glaw
2006-11-09 8:31 ` Joakim Tjernlund
2006-11-08 20:16 ` Miguel Ojeda
1 sibling, 1 reply; 10+ messages in thread
From: Jan-Benedict Glaw @ 2006-11-08 20:14 UTC (permalink / raw)
To: Jesper Juhl; +Cc: Joakim Tjernlund, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1407 bytes --]
On Wed, 2006-11-08 21:09:04 +0100, Jesper Juhl <jesper.juhl@gmail.com> wrote:
> On 08/11/06, Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote:
> > > -----Original Message-----
> > > From: Jesper Juhl [mailto:jesper.juhl@gmail.com]
> > > On 08/11/06, Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote:
> > > > Instead of passing a module param on the cmdline I want to compile that
> > > > into the kernel, but I can't figure out how.
> > > You could edit the module source and hardcode default values.
> > Yes, but I don't want to do that since it makes maintance
> > harder.
> Well, as far as I know, there's no way to specify default module
> options at compile time. The defaults are set in the module source and
> are modifiable at module load time or by setting options on the kernel
> command line at boot tiem. So, if that's no good for you I don't see
> any other way except modifying the source to hardcode new defaults.
However, that could probably be hacked in easily. We use a similar
approach for VAX, since we're not yet regularly booting off a local
harddisk, but commonly via MOP off the network.
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de +49-172-7608481
Signature of: Ich hatte in letzter Zeit ein bißchen viel Realitycheck.
the second : Langsam möchte ich mal wieder weiterträumen können.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: How to compile module params into kernel?
2006-11-08 20:09 ` Jesper Juhl
2006-11-08 20:14 ` Jan-Benedict Glaw
@ 2006-11-08 20:16 ` Miguel Ojeda
2006-11-08 20:22 ` Joakim Tjernlund
1 sibling, 1 reply; 10+ messages in thread
From: Miguel Ojeda @ 2006-11-08 20:16 UTC (permalink / raw)
To: Jesper Juhl; +Cc: Joakim Tjernlund, linux-kernel
On 11/8/06, Jesper Juhl <jesper.juhl@gmail.com> wrote:
> On 08/11/06, Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote:
> > > -----Original Message-----
> > > From: Jesper Juhl [mailto:jesper.juhl@gmail.com]
> > >
> > > On 08/11/06, Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote:
> > > > Instead of passing a module param on the cmdline I want to
> > > compile that
> > > > into
> > > > the kernel, but I can't figure out how.
> > > >
> > > > The module param I want compile into kernel is
> > > > rtc-ds1307.force=0,0x68
> > > >
> > > > This is for an embeddet target that doesn't have loadable module
> > > > support.
> > > >
> > > You could edit the module source and hardcode default values.
> > >
> >
> > Yes, but I don't want to do that since it makes maintance
> > harder.
> >
> Well, as far as I know, there's no way to specify default module
> options at compile time. The defaults are set in the module source and
> are modifiable at module load time or by setting options on the kernel
> command line at boot tiem. So, if that's no good for you I don't see
> any other way except modifying the source to hardcode new defaults.
>
You can add parameter values at Kconfig using "int", "hex"... instead
of tristate, and then do something like:
static unsigned int foo = CONFIG_foo;
module_param(foo, uint, S_IRUGO);
MODULE_PARM_DESC(foo, "foo value (uint)");
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: How to compile module params into kernel?
2006-11-08 20:16 ` Miguel Ojeda
@ 2006-11-08 20:22 ` Joakim Tjernlund
0 siblings, 0 replies; 10+ messages in thread
From: Joakim Tjernlund @ 2006-11-08 20:22 UTC (permalink / raw)
To: 'Miguel Ojeda', 'Jesper Juhl'; +Cc: linux-kernel
> -----Original Message-----
> From: Miguel Ojeda [mailto:maxextreme@gmail.com]
> Sent: den 8 november 2006 21:17
> To: Jesper Juhl
> Cc: Joakim Tjernlund; linux-kernel@vger.kernel.org
> Subject: Re: How to compile module params into kernel?
>
> On 11/8/06, Jesper Juhl <jesper.juhl@gmail.com> wrote:
> > On 08/11/06, Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote:
> > > > -----Original Message-----
> > > > From: Jesper Juhl [mailto:jesper.juhl@gmail.com]
> > > >
> > > > On 08/11/06, Joakim Tjernlund
> <joakim.tjernlund@transmode.se> wrote:
> > > > > Instead of passing a module param on the cmdline I want to
> > > > compile that
> > > > > into
> > > > > the kernel, but I can't figure out how.
> > > > >
> > > > > The module param I want compile into kernel is
> > > > > rtc-ds1307.force=0,0x68
> > > > >
> > > > > This is for an embeddet target that doesn't have
> loadable module
> > > > > support.
> > > > >
> > > > You could edit the module source and hardcode default values.
> > > >
> > >
> > > Yes, but I don't want to do that since it makes maintance
> > > harder.
> > >
> > Well, as far as I know, there's no way to specify default module
> > options at compile time. The defaults are set in the module
> source and
> > are modifiable at module load time or by setting options on
> the kernel
> > command line at boot tiem. So, if that's no good for you I don't see
> > any other way except modifying the source to hardcode new defaults.
> >
>
> You can add parameter values at Kconfig using "int", "hex"... instead
> of tristate, and then do something like:
>
> static unsigned int foo = CONFIG_foo;
> module_param(foo, uint, S_IRUGO);
> MODULE_PARM_DESC(foo, "foo value (uint)");
hmm, don't quite understand.
Can you rewrite that to match the cmdvar "rtc-ds1307.force=0,0x68" ?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: How to compile module params into kernel?
2006-11-08 20:02 ` Joakim Tjernlund
2006-11-08 20:09 ` Jesper Juhl
@ 2006-11-08 20:59 ` Richard B. Johnson
2006-11-08 21:08 ` Jan-Benedict Glaw
1 sibling, 1 reply; 10+ messages in thread
From: Richard B. Johnson @ 2006-11-08 20:59 UTC (permalink / raw)
To: Joakim Tjernlund, 'Jesper Juhl'; +Cc: linux-kernel
----- Original Message -----
From: "Joakim Tjernlund" <joakim.tjernlund@transmode.se>
To: "'Jesper Juhl'" <jesper.juhl@gmail.com>
Cc: <linux-kernel@vger.kernel.org>
Sent: Wednesday, November 08, 2006 3:02 PM
Subject: RE: How to compile module params into kernel?
>> -----Original Message-----
>> From: Jesper Juhl [mailto:jesper.juhl@gmail.com]
>>
>> On 08/11/06, Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote:
>> > Instead of passing a module param on the cmdline I want to
>> compile that
>> > into
>> > the kernel, but I can't figure out how.
>> >
>> > The module param I want compile into kernel is
>> > rtc-ds1307.force=0,0x68
>> >
>> > This is for an embeddet target that doesn't have loadable module
>> > support.
>> >
>> You could edit the module source and hardcode default values.
>>
>
> Yes, but I don't want to do that since it makes maintance
> harder.
>
> Jocke
>
> -
> 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/
If you don't have a module, you can not use module parameters. However, it
might even be simpler...
You just put your parameters (strings to parse) on the kernel command-line
and you put code in your driver to interpret them.
You want to look at "saved_command_line." It is a string as:
extern char saved_command_line[COMMAND_LINE_SIZE];
You need to parse ASCII text yourself, in your driver, but it's trivial.
Look at .../arch/i386/kernel/setup.c parse_cmdline_early().
I don't see anywhere in the kernel that it gets overwritten so it should be
good to use.
Cheers,
Dick Johnson
Penguin : Linux version 2.6.16.24 (somewhere). IT removed email for
engineers!
New Book: http://www.AbominableFirebug.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: How to compile module params into kernel?
2006-11-08 20:59 ` Richard B. Johnson
@ 2006-11-08 21:08 ` Jan-Benedict Glaw
0 siblings, 0 replies; 10+ messages in thread
From: Jan-Benedict Glaw @ 2006-11-08 21:08 UTC (permalink / raw)
To: Richard B. Johnson; +Cc: Joakim Tjernlund, 'Jesper Juhl', linux-kernel
[-- Attachment #1: Type: text/plain, Size: 581 bytes --]
On Wed, 2006-11-08 15:59:44 -0500, Richard B. Johnson <jmodem@AbominableFirebug.com> wrote:
> If you don't have a module, you can not use module parameters. However, it
> might even be simpler...
Well, you actually can! If you've compiled something into your
kernel, you can use <module name>.<parametername>=<value> on your
kernel command line to set all the parameters you need.
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de +49-172-7608481
Signature of: Gib Dein Bestes. Dann übertriff Dich selbst!
the second :
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: How to compile module params into kernel?
2006-11-08 20:14 ` Jan-Benedict Glaw
@ 2006-11-09 8:31 ` Joakim Tjernlund
0 siblings, 0 replies; 10+ messages in thread
From: Joakim Tjernlund @ 2006-11-09 8:31 UTC (permalink / raw)
To: Jesper Juhl, Joakim Tjernlund, linux-kernel
Jan-Benedict Glaw wrote:
> On Wed, 2006-11-08 21:09:04 +0100, Jesper Juhl <jesper.juhl@gmail.com> wrote:
>
>> On 08/11/06, Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote:
>>
>>>> -----Original Message-----
>>>> From: Jesper Juhl [mailto:jesper.juhl@gmail.com]
>>>> On 08/11/06, Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote:
>>>>
>>>>> Instead of passing a module param on the cmdline I want to compile that
>>>>> into the kernel, but I can't figure out how.
>>>>>
>>>> You could edit the module source and hardcode default values.
>>>>
>>> Yes, but I don't want to do that since it makes maintance
>>> harder.
>>>
>> Well, as far as I know, there's no way to specify default module
>> options at compile time. The defaults are set in the module source and
>> are modifiable at module load time or by setting options on the kernel
>> command line at boot tiem. So, if that's no good for you I don't see
>> any other way except modifying the source to hardcode new defaults.
>>
>
> However, that could probably be hacked in easily. We use a similar
> approach for VAX, since we're not yet regularly booting off a local
> harddisk, but commonly via MOP off the network.
>
> MfG, JBG
>
>
This works for me in should want to known:
#include <linux/moduleparam.h>
int set_module_params(void)
{
extern struct kernel_param __start___param[], __stop___param[];
char module_params[]="rtc-ds1307.force=0,0x68";
parse_args("hard module params", module_params, __start___param,
__stop___param - __start___param, NULL);
return 0;
}
arch_initcall(set_module_params);
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-11-09 8:31 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-08 18:43 How to compile module params into kernel? Joakim Tjernlund
2006-11-08 19:05 ` Jesper Juhl
2006-11-08 20:02 ` Joakim Tjernlund
2006-11-08 20:09 ` Jesper Juhl
2006-11-08 20:14 ` Jan-Benedict Glaw
2006-11-09 8:31 ` Joakim Tjernlund
2006-11-08 20:16 ` Miguel Ojeda
2006-11-08 20:22 ` Joakim Tjernlund
2006-11-08 20:59 ` Richard B. Johnson
2006-11-08 21:08 ` Jan-Benedict Glaw
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox