public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
To: Jesper Juhl <jesper.juhl@gmail.com>,
	Joakim Tjernlund <joakim.tjernlund@transmode.se>,
	linux-kernel@vger.kernel.org
Subject: Re: How to compile module params into kernel?
Date: Thu, 09 Nov 2006 09:31:37 +0100	[thread overview]
Message-ID: <4552E769.2030303@transmode.se> (raw)
In-Reply-To: <20061108201456.GD21485@lug-owl.de>

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);


  reply	other threads:[~2006-11-09  8:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4552E769.2030303@transmode.se \
    --to=joakim.tjernlund@transmode.se \
    --cc=jesper.juhl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox