linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [Linux Wireless] Update of "en/users/Download" by ReinetteChatre
       [not found] <20090729214510.31738.90990@cl-1649.ham-01.de.sixxs.net>
@ 2009-07-29 21:53 ` Luis R. Rodriguez
  2009-07-29 21:57   ` reinette chatre
  0 siblings, 1 reply; 12+ messages in thread
From: Luis R. Rodriguez @ 2009-07-29 21:53 UTC (permalink / raw)
  To: reinette chatre; +Cc: linux-wireless

On Wed, Jul 29, 2009 at 2:45 PM, Linux
Wireless<johannes@sipsolutions.net> wrote:
> Dear Wiki user,
>
> You have subscribed to a wiki page or wiki category on "Linux Wireless" for change notification.
>
> The "en/users/Download" page has been changed by ReinetteChatre:
> http://wireless.kernel.org/en/users/Download?action=diff&rev1=93&rev2=94
>
>  }}}
>  '''Install''':
>
> - We use the updates/ directory so your distribution's drivers are left intact.
> + We use the updates/ directory so your distribution's drivers are left intact. By default depmod will search this directory first, but if you find that it does not then check that your depmod.conf file lists the search order correctly with ''updates'' appearing first (before ''built-in'').

Hm, so compat-wireless now actually checks this for you and if its not
there it adds it for you. Was there an issue with a particular user on
this?

  Luis

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Linux Wireless] Update of "en/users/Download" by ReinetteChatre
  2009-07-29 21:53 ` [Linux Wireless] Update of "en/users/Download" by ReinetteChatre Luis R. Rodriguez
@ 2009-07-29 21:57   ` reinette chatre
  2009-07-29 22:04     ` Luis R. Rodriguez
  0 siblings, 1 reply; 12+ messages in thread
From: reinette chatre @ 2009-07-29 21:57 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless

On Wed, 2009-07-29 at 14:53 -0700, Luis R. Rodriguez wrote:
> On Wed, Jul 29, 2009 at 2:45 PM, Linux
> Wireless<johannes@sipsolutions.net> wrote:
> > Dear Wiki user,
> >
> > You have subscribed to a wiki page or wiki category on "Linux Wireless" for change notification.
> >
> > The "en/users/Download" page has been changed by ReinetteChatre:
> > http://wireless.kernel.org/en/users/Download?action=diff&rev1=93&rev2=94
> >
> >  }}}
> >  '''Install''':
> >
> > - We use the updates/ directory so your distribution's drivers are left intact.
> > + We use the updates/ directory so your distribution's drivers are left intact. By default depmod will search this directory first, but if you find that it does not then check that your depmod.conf file lists the search order correctly with ''updates'' appearing first (before ''built-in'').
> 
> Hm, so compat-wireless now actually checks this for you and if its not
> there it adds it for you. Was there an issue with a particular user on
> this?

Yes, a madriva user ran into this problem. See
http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=2061#c6 


Reinette



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Linux Wireless] Update of "en/users/Download" by ReinetteChatre
  2009-07-29 21:57   ` reinette chatre
@ 2009-07-29 22:04     ` Luis R. Rodriguez
  2009-07-30 13:12       ` Roman Macko
  0 siblings, 1 reply; 12+ messages in thread
From: Luis R. Rodriguez @ 2009-07-29 22:04 UTC (permalink / raw)
  To: reinette chatre, rmacko72; +Cc: linux-wireless

On Wed, Jul 29, 2009 at 2:57 PM, reinette
chatre<reinette.chatre@intel.com> wrote:
> On Wed, 2009-07-29 at 14:53 -0700, Luis R. Rodriguez wrote:
>> On Wed, Jul 29, 2009 at 2:45 PM, Linux
>> Wireless<johannes@sipsolutions.net> wrote:
>> > Dear Wiki user,
>> >
>> > You have subscribed to a wiki page or wiki category on "Linux Wireless" for change notification.
>> >
>> > The "en/users/Download" page has been changed by ReinetteChatre:
>> > http://wireless.kernel.org/en/users/Download?action=diff&rev1=93&rev2=94
>> >
>> >  }}}
>> >  '''Install''':
>> >
>> > - We use the updates/ directory so your distribution's drivers are left intact.
>> > + We use the updates/ directory so your distribution's drivers are left intact. By default depmod will search this directory first, but if you find that it does not then check that your depmod.conf file lists the search order correctly with ''updates'' appearing first (before ''built-in'').
>>
>> Hm, so compat-wireless now actually checks this for you and if its not
>> there it adds it for you. Was there an issue with a particular user on
>> this?
>
> Yes, a madriva user ran into this problem. See
> http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=2061#c6

Roman, I added a little check for this, specifically since another
user reported the same issue. Did you use bleeding edge
compat-wireless?

The script is in:

scripts/check_depmod

We run this at make install time.

Can you run that manually?

  Luis

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Linux Wireless] Update of "en/users/Download" by ReinetteChatre
  2009-07-29 22:04     ` Luis R. Rodriguez
@ 2009-07-30 13:12       ` Roman Macko
  2009-07-30 14:43         ` Luis R. Rodriguez
  0 siblings, 1 reply; 12+ messages in thread
From: Roman Macko @ 2009-07-30 13:12 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: reinette chatre, linux-wireless

Luis,

I used stable version 2.6.30.
Anyway I downloaded bleeding edge version and ran script check_depmod.
But it created new configuration in /etc/depmod.d directory instead of 
creating
global configuration /etc/depmod.conf what I did. It doesn't work in 
that way.

I can read in manual pages of depmod.conf that depmod.d directory serves 
for configuration on per-module basis,
so I think you can change the order of proceding directories for 
particular module only there.
But I don't know how to name that file or if my thought is right at all.

Roman





Luis R. Rodriguez wrote:
> On Wed, Jul 29, 2009 at 2:57 PM, reinette
> chatre<reinette.chatre@intel.com> wrote:
>   
>> On Wed, 2009-07-29 at 14:53 -0700, Luis R. Rodriguez wrote:
>>     
>>> On Wed, Jul 29, 2009 at 2:45 PM, Linux
>>> Wireless<johannes@sipsolutions.net> wrote:
>>>       
>>>> Dear Wiki user,
>>>>
>>>> You have subscribed to a wiki page or wiki category on "Linux Wireless" for change notification.
>>>>
>>>> The "en/users/Download" page has been changed by ReinetteChatre:
>>>> http://wireless.kernel.org/en/users/Download?action=diff&rev1=93&rev2=94
>>>>
>>>>  }}}
>>>>  '''Install''':
>>>>
>>>> - We use the updates/ directory so your distribution's drivers are left intact.
>>>> + We use the updates/ directory so your distribution's drivers are left intact. By default depmod will search this directory first, but if you find that it does not then check that your depmod.conf file lists the search order correctly with ''updates'' appearing first (before ''built-in'').
>>>>         
>>> Hm, so compat-wireless now actually checks this for you and if its not
>>> there it adds it for you. Was there an issue with a particular user on
>>> this?
>>>       
>> Yes, a madriva user ran into this problem. See
>> http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=2061#c6
>>     
>
> Roman, I added a little check for this, specifically since another
> user reported the same issue. Did you use bleeding edge
> compat-wireless?
>
> The script is in:
>
> scripts/check_depmod
>
> We run this at make install time.
>
> Can you run that manually?
>
>   Luis
>   


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Linux Wireless] Update of "en/users/Download" by ReinetteChatre
  2009-07-30 13:12       ` Roman Macko
@ 2009-07-30 14:43         ` Luis R. Rodriguez
  2009-07-30 16:59           ` Roman Macko
  0 siblings, 1 reply; 12+ messages in thread
From: Luis R. Rodriguez @ 2009-07-30 14:43 UTC (permalink / raw)
  To: Roman Macko; +Cc: reinette chatre, linux-wireless

On Thu, Jul 30, 2009 at 6:12 AM, Roman Macko<rmacko72@gmail.com> wrote:
> Luis,
>
> I used stable version 2.6.30.
> Anyway I downloaded bleeding edge version and ran script check_depmod.
> But it created new configuration in /etc/depmod.d directory instead of
> creating
> global configuration /etc/depmod.conf what I did. It doesn't work in that
> way.

What do you mean it doesn't work that way?
Do you mean you tested it and that it didn't work?

> I can read in manual pages of depmod.conf that depmod.d directory serves for
> configuration on per-module basis,
> so I think you can change the order of proceding directories for particular
> module only there.

Nope. Even Ubuntu uses their own file in there for the same purpose:

mcgrof@tux ~ $ cat /etc/depmod.d/ubuntu.conf
search updates ubuntu built-in

> But I don't know how to name that file or if my thought is right at all.

The man page needs some updating.

  Luis

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Linux Wireless] Update of "en/users/Download" by ReinetteChatre
  2009-07-30 14:43         ` Luis R. Rodriguez
@ 2009-07-30 16:59           ` Roman Macko
  2009-07-30 17:06             ` Luis R. Rodriguez
  0 siblings, 1 reply; 12+ messages in thread
From: Roman Macko @ 2009-07-30 16:59 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: reinette chatre, linux-wireless

Yes, I tested it. When you place that config file containing "search 
updates built-in" in /etc/depmod.d
directory, it doesn't work. You have to place it in global config file 
/etc/depmod.conf.

How depmod works with config files in /etc/depmod.d directory is a 
mystery for me. I wasn't able to learn
this from manual pages.

And I tested another thing too. When some of config files (either global 
/etc/depmod.conf or one of those in /etc/depmod.d directory)
doesn't contain search command ,
everything works fine, according to manual page for depmod, using 
builtin search string "updates built-in" what  is
what you need. As soon as one of them (either global or one of those in 
/etc/depmod.d directory) contains search command,
then depmod uses this one. It seems seach command in global config file 
(/etc/depmod.conf) has higher priory. But as I say
I really don't know how depmod works with all config files.

roman

Luis R. Rodriguez wrote:
> On Thu, Jul 30, 2009 at 6:12 AM, Roman Macko<rmacko72@gmail.com> wrote:
>   
>> Luis,
>>
>> I used stable version 2.6.30.
>> Anyway I downloaded bleeding edge version and ran script check_depmod.
>> But it created new configuration in /etc/depmod.d directory instead of
>> creating
>> global configuration /etc/depmod.conf what I did. It doesn't work in that
>> way.
>>     
>
> What do you mean it doesn't work that way?
> Do you mean you tested it and that it didn't work?
>
>   
>> I can read in manual pages of depmod.conf that depmod.d directory serves for
>> configuration on per-module basis,
>> so I think you can change the order of proceding directories for particular
>> module only there.
>>     
>
> Nope. Even Ubuntu uses their own file in there for the same purpose:
>
> mcgrof@tux ~ $ cat /etc/depmod.d/ubuntu.conf
> search updates ubuntu built-in
>
>   
>> But I don't know how to name that file or if my thought is right at all.
>>     
>
> The man page needs some updating.
>
>   Luis
>   


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Linux Wireless] Update of "en/users/Download" by ReinetteChatre
  2009-07-30 16:59           ` Roman Macko
@ 2009-07-30 17:06             ` Luis R. Rodriguez
  2009-07-31  1:20               ` Roman Macko
  0 siblings, 1 reply; 12+ messages in thread
From: Luis R. Rodriguez @ 2009-07-30 17:06 UTC (permalink / raw)
  To: Roman Macko; +Cc: reinette chatre, linux-wireless

On Thu, Jul 30, 2009 at 9:59 AM, Roman Macko<rmacko72@gmail.com> wrote:
> Yes, I tested it. When you place that config file containing "search updates
> built-in" in /etc/depmod.d
> directory, it doesn't work.

OK you probably have an old version of depmod. depmod is provided by
module-init-tools, what version of module-init-tools do you have?

I have 3.10 (as on Ubuntu Karmic)

> You have to place it in global config file
> /etc/depmod.conf.

If this is an old depmod thing we will have to check the version of
depmod and do this for that case.

> How depmod works with config files in /etc/depmod.d directory is a mystery
> for me.

Its not that tricky, the new version reads /etc/depmod.conf and if
that is not found then moves on to check /etc/depmod.d/* files.

> I wasn't able to learn
> this from manual pages.

That's probably because your version doesn't use depmod.d dir.

> And I tested another thing too. When some of config files (either global
> /etc/depmod.conf or one of those in /etc/depmod.d directory)
> doesn't contain search command ,
> everything works fine, according to manual page for depmod, using builtin
> search string "updates built-in" what  is
> what you need.

Right, built-in will use /lib/modules/$(uname -r)/kernel/ for modules,
chances are if no depmod.conf file or depmod.d dir is present default
may be to use built-in.

> As soon as one of them (either global or one of those in
> /etc/depmod.d directory) contains search command,
> then depmod uses this one. It seems seach command in global config file
> (/etc/depmod.conf) has higher priory. But as I say
> I really don't know how depmod works with all config files.

I believe this is built-in by default, then read depmod.conf first, if
that is not present read depmod.d dir.

  Luis

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Linux Wireless] Update of "en/users/Download" by ReinetteChatre
  2009-07-30 17:06             ` Luis R. Rodriguez
@ 2009-07-31  1:20               ` Roman Macko
  2009-07-31  1:31                 ` Luis R. Rodriguez
  0 siblings, 1 reply; 12+ messages in thread
From: Roman Macko @ 2009-07-31  1:20 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: reinette chatre, linux-wireless

Hi Luis,

I have version 3.6 of module-init-tools and this version reads 
/etc/depmod.d directory too.

But I wanted to understand how depmod reads config files, so I looked 
into source codes (both version 3.6 and 3.10)
and finally found out how it works.

Assume depmod is run without -C or --config option

Version 3.6 reads firstly /etc/depmod.conf file and then it reads config 
files in directory /etc/depmod.d.
Files in directory /etc/depmod.d are read and parsed in unpredictable 
order by readdir function (this function uses
raw directory structures of filesystem)

Version 3.10 reads /etc/depmod.conf firstly as well, but this config 
file is considered as deprecated in this version
and prints out warning about that. Then it reads config files in 
directory /etc/depmod.d by readdir function as well, but before it starts
to parse them, it sorts them accord to filename, so you know the order 
in which they are going to be parsed
and this is very improtant!!! This behavior should be from version 3.7

The same for both versions:
1) List of directories to be searched is created from search commands 
from all config files in order how particular
search commands are found in config files (so order of parsed config 
files is important). If no search command is found,
updates directory is added before "built-in" directory.

2) As for override command, the last one found for particular module and 
kernel in all config files wins,
 so again the order of parsed config files is important.

 From this is evident, that both versions can work differently which 
depends on the order of parsed config files from
/etc/depmod.d directory that is different in both versions.

So solution would be:
1) if there is no search command in any of config files (in 
/etc/depmod.conf  or those in /etc/depmod.d directory), do nothing.
2) if there is a search command in any of config files and does not 
contain updates directory before built-in add search command
    "search updates" in
   a) if system has version >=3.7, create config file in /etc/depmod.d 
directory which name is alphabeticaly less than all you will find
      in that directory
   b) if system has version <=3.6 add search command "search updates" at 
the begining of /etc/depmod.conf file

But such adding of "search updates" can break depmod configuration in 
some systems or it is not desirable to make search in
updates directory at all. So maybe it would be better to use another 
name for directory than updates

Or it would be also interesting to use override command for all modules 
compiled in compat-wireless
and put it all to configuration file /etc/depmod.d/compat-wireless.conf 
and not bothering with version of depmod nor
finding the search command in all configuration files, e.g

compat-wireless.conf
======================================
override iwlagn * updates/drivers/net/wireless/iwlwifi
override iwlcore * updates/drivers/net/wireless/iwlwifi
....
....
....
======================================

it can make problem only when some other config file in /etc/depmod.d 
directory contains override command for
any module from compat-wireless


I hope this help you

Regards

Roman

Luis R. Rodriguez wrote:
> On Thu, Jul 30, 2009 at 9:59 AM, Roman Macko<rmacko72@gmail.com> wrote:
>   
>> Yes, I tested it. When you place that config file containing "search updates
>> built-in" in /etc/depmod.d
>> directory, it doesn't work.
>>     
>
> OK you probably have an old version of depmod. depmod is provided by
> module-init-tools, what version of module-init-tools do you have?
>
> I have 3.10 (as on Ubuntu Karmic)
>
>   
>> You have to place it in global config file
>> /etc/depmod.conf.
>>     
>
> If this is an old depmod thing we will have to check the version of
> depmod and do this for that case.
>
>   
>> How depmod works with config files in /etc/depmod.d directory is a mystery
>> for me.
>>     
>
> Its not that tricky, the new version reads /etc/depmod.conf and if
> that is not found then moves on to check /etc/depmod.d/* files.
>
>   
>> I wasn't able to learn
>> this from manual pages.
>>     
>
> That's probably because your version doesn't use depmod.d dir.
>
>   
>> And I tested another thing too. When some of config files (either global
>> /etc/depmod.conf or one of those in /etc/depmod.d directory)
>> doesn't contain search command ,
>> everything works fine, according to manual page for depmod, using builtin
>> search string "updates built-in" what  is
>> what you need.
>>     
>
> Right, built-in will use /lib/modules/$(uname -r)/kernel/ for modules,
> chances are if no depmod.conf file or depmod.d dir is present default
> may be to use built-in.
>
>   
>> As soon as one of them (either global or one of those in
>> /etc/depmod.d directory) contains search command,
>> then depmod uses this one. It seems seach command in global config file
>> (/etc/depmod.conf) has higher priory. But as I say
>> I really don't know how depmod works with all config files.
>>     
>
> I believe this is built-in by default, then read depmod.conf first, if
> that is not present read depmod.d dir.
>
>   Luis
>   


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Linux Wireless] Update of "en/users/Download" by ReinetteChatre
  2009-07-31  1:20               ` Roman Macko
@ 2009-07-31  1:31                 ` Luis R. Rodriguez
  2009-07-31 14:36                   ` Roman Macko
  2009-07-31 21:19                   ` Roman Macko
  0 siblings, 2 replies; 12+ messages in thread
From: Luis R. Rodriguez @ 2009-07-31  1:31 UTC (permalink / raw)
  To: Roman Macko; +Cc: reinette chatre, linux-wireless

On Thu, Jul 30, 2009 at 6:20 PM, Roman Macko<rmacko72@gmail.com> wrote:
> Hi Luis,
>
> I have version 3.6 of module-init-tools and this version reads /etc/depmod.d
> directory too.
>
> But I wanted to understand how depmod reads config files, so I looked into
> source codes (both version 3.6 and 3.10)
> and finally found out how it works.
>
> Assume depmod is run without -C or --config option
>
> Version 3.6 reads firstly /etc/depmod.conf file and then it reads config
> files in directory /etc/depmod.d.
> Files in directory /etc/depmod.d are read and parsed in unpredictable order
> by readdir function (this function uses
> raw directory structures of filesystem)
>
> Version 3.10 reads /etc/depmod.conf firstly as well, but this config file is
> considered as deprecated in this version
> and prints out warning about that. Then it reads config files in directory
> /etc/depmod.d by readdir function as well, but before it starts
> to parse them, it sorts them accord to filename, so you know the order in
> which they are going to be parsed
> and this is very improtant!!! This behavior should be from version 3.7
>
> The same for both versions:
> 1) List of directories to be searched is created from search commands from
> all config files in order how particular
> search commands are found in config files (so order of parsed config files
> is important). If no search command is found,
> updates directory is added before "built-in" directory.
>
> 2) As for override command, the last one found for particular module and
> kernel in all config files wins,
> so again the order of parsed config files is important.
>
> From this is evident, that both versions can work differently which depends
> on the order of parsed config files from
> /etc/depmod.d directory that is different in both versions.
>
> So solution would be:
> 1) if there is no search command in any of config files (in /etc/depmod.conf
>  or those in /etc/depmod.d directory), do nothing.
> 2) if there is a search command in any of config files and does not contain
> updates directory before built-in add search command
>   "search updates" in
>  a) if system has version >=3.7, create config file in /etc/depmod.d
> directory which name is alphabeticaly less than all you will find
>     in that directory
>  b) if system has version <=3.6 add search command "search updates" at the
> begining of /etc/depmod.conf file
>
> But such adding of "search updates" can break depmod configuration in some
> systems or it is not desirable to make search in
> updates directory at all. So maybe it would be better to use another name
> for directory than updates
>
> Or it would be also interesting to use override command for all modules
> compiled in compat-wireless
> and put it all to configuration file /etc/depmod.d/compat-wireless.conf and
> not bothering with version of depmod nor
> finding the search command in all configuration files, e.g
>
> compat-wireless.conf
> ======================================
> override iwlagn * updates/drivers/net/wireless/iwlwifi
> override iwlcore * updates/drivers/net/wireless/iwlwifi
> ....
> ....
> ....
> ======================================
>
> it can make problem only when some other config file in /etc/depmod.d
> directory contains override command for
> any module from compat-wireless
>
>
> I hope this help you

Thanks, since you have read this and can read code, mind putting
together a patch for the script on compat-wireless?

  Luis

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Linux Wireless] Update of "en/users/Download" by ReinetteChatre
  2009-07-31  1:31                 ` Luis R. Rodriguez
@ 2009-07-31 14:36                   ` Roman Macko
  2009-07-31 21:19                   ` Roman Macko
  1 sibling, 0 replies; 12+ messages in thread
From: Roman Macko @ 2009-07-31 14:36 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: reinette chatre, linux-wireless

ok, I'm going to do a patch of check_depmod script and I'll send it to you
as soon as I do it.

roman

Luis R. Rodriguez wrote:
> On Thu, Jul 30, 2009 at 6:20 PM, Roman Macko<rmacko72@gmail.com> wrote:
>   
>> Hi Luis,
>>
>> I have version 3.6 of module-init-tools and this version reads /etc/depmod.d
>> directory too.
>>
>> But I wanted to understand how depmod reads config files, so I looked into
>> source codes (both version 3.6 and 3.10)
>> and finally found out how it works.
>>
>> Assume depmod is run without -C or --config option
>>
>> Version 3.6 reads firstly /etc/depmod.conf file and then it reads config
>> files in directory /etc/depmod.d.
>> Files in directory /etc/depmod.d are read and parsed in unpredictable order
>> by readdir function (this function uses
>> raw directory structures of filesystem)
>>
>> Version 3.10 reads /etc/depmod.conf firstly as well, but this config file is
>> considered as deprecated in this version
>> and prints out warning about that. Then it reads config files in directory
>> /etc/depmod.d by readdir function as well, but before it starts
>> to parse them, it sorts them accord to filename, so you know the order in
>> which they are going to be parsed
>> and this is very improtant!!! This behavior should be from version 3.7
>>
>> The same for both versions:
>> 1) List of directories to be searched is created from search commands from
>> all config files in order how particular
>> search commands are found in config files (so order of parsed config files
>> is important). If no search command is found,
>> updates directory is added before "built-in" directory.
>>
>> 2) As for override command, the last one found for particular module and
>> kernel in all config files wins,
>> so again the order of parsed config files is important.
>>
>> From this is evident, that both versions can work differently which depends
>> on the order of parsed config files from
>> /etc/depmod.d directory that is different in both versions.
>>
>> So solution would be:
>> 1) if there is no search command in any of config files (in /etc/depmod.conf
>>  or those in /etc/depmod.d directory), do nothing.
>> 2) if there is a search command in any of config files and does not contain
>> updates directory before built-in add search command
>>   "search updates" in
>>  a) if system has version >=3.7, create config file in /etc/depmod.d
>> directory which name is alphabeticaly less than all you will find
>>     in that directory
>>  b) if system has version <=3.6 add search command "search updates" at the
>> begining of /etc/depmod.conf file
>>
>> But such adding of "search updates" can break depmod configuration in some
>> systems or it is not desirable to make search in
>> updates directory at all. So maybe it would be better to use another name
>> for directory than updates
>>
>> Or it would be also interesting to use override command for all modules
>> compiled in compat-wireless
>> and put it all to configuration file /etc/depmod.d/compat-wireless.conf and
>> not bothering with version of depmod nor
>> finding the search command in all configuration files, e.g
>>
>> compat-wireless.conf
>> ======================================
>> override iwlagn * updates/drivers/net/wireless/iwlwifi
>> override iwlcore * updates/drivers/net/wireless/iwlwifi
>> ....
>> ....
>> ....
>> ======================================
>>
>> it can make problem only when some other config file in /etc/depmod.d
>> directory contains override command for
>> any module from compat-wireless
>>
>>
>> I hope this help you
>>     
>
> Thanks, since you have read this and can read code, mind putting
> together a patch for the script on compat-wireless?
>
>   Luis
>   


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Linux Wireless] Update of "en/users/Download" by ReinetteChatre
  2009-07-31  1:31                 ` Luis R. Rodriguez
  2009-07-31 14:36                   ` Roman Macko
@ 2009-07-31 21:19                   ` Roman Macko
  2009-07-31 23:36                     ` Luis R. Rodriguez
  1 sibling, 1 reply; 12+ messages in thread
From: Roman Macko @ 2009-07-31 21:19 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: reinette chatre, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 3646 bytes --]

Hi Luis,

here is promised patch

roman

Luis R. Rodriguez wrote:
> On Thu, Jul 30, 2009 at 6:20 PM, Roman Macko<rmacko72@gmail.com> wrote:
>   
>> Hi Luis,
>>
>> I have version 3.6 of module-init-tools and this version reads /etc/depmod.d
>> directory too.
>>
>> But I wanted to understand how depmod reads config files, so I looked into
>> source codes (both version 3.6 and 3.10)
>> and finally found out how it works.
>>
>> Assume depmod is run without -C or --config option
>>
>> Version 3.6 reads firstly /etc/depmod.conf file and then it reads config
>> files in directory /etc/depmod.d.
>> Files in directory /etc/depmod.d are read and parsed in unpredictable order
>> by readdir function (this function uses
>> raw directory structures of filesystem)
>>
>> Version 3.10 reads /etc/depmod.conf firstly as well, but this config file is
>> considered as deprecated in this version
>> and prints out warning about that. Then it reads config files in directory
>> /etc/depmod.d by readdir function as well, but before it starts
>> to parse them, it sorts them accord to filename, so you know the order in
>> which they are going to be parsed
>> and this is very improtant!!! This behavior should be from version 3.7
>>
>> The same for both versions:
>> 1) List of directories to be searched is created from search commands from
>> all config files in order how particular
>> search commands are found in config files (so order of parsed config files
>> is important). If no search command is found,
>> updates directory is added before "built-in" directory.
>>
>> 2) As for override command, the last one found for particular module and
>> kernel in all config files wins,
>> so again the order of parsed config files is important.
>>
>> From this is evident, that both versions can work differently which depends
>> on the order of parsed config files from
>> /etc/depmod.d directory that is different in both versions.
>>
>> So solution would be:
>> 1) if there is no search command in any of config files (in /etc/depmod.conf
>>  or those in /etc/depmod.d directory), do nothing.
>> 2) if there is a search command in any of config files and does not contain
>> updates directory before built-in add search command
>>   "search updates" in
>>  a) if system has version >=3.7, create config file in /etc/depmod.d
>> directory which name is alphabeticaly less than all you will find
>>     in that directory
>>  b) if system has version <=3.6 add search command "search updates" at the
>> begining of /etc/depmod.conf file
>>
>> But such adding of "search updates" can break depmod configuration in some
>> systems or it is not desirable to make search in
>> updates directory at all. So maybe it would be better to use another name
>> for directory than updates
>>
>> Or it would be also interesting to use override command for all modules
>> compiled in compat-wireless
>> and put it all to configuration file /etc/depmod.d/compat-wireless.conf and
>> not bothering with version of depmod nor
>> finding the search command in all configuration files, e.g
>>
>> compat-wireless.conf
>> ======================================
>> override iwlagn * updates/drivers/net/wireless/iwlwifi
>> override iwlcore * updates/drivers/net/wireless/iwlwifi
>> ....
>> ....
>> ....
>> ======================================
>>
>> it can make problem only when some other config file in /etc/depmod.d
>> directory contains override command for
>> any module from compat-wireless
>>
>>
>> I hope this help you
>>     
>
> Thanks, since you have read this and can read code, mind putting
> together a patch for the script on compat-wireless?
>
>   Luis
>   


[-- Attachment #2: check_depmod.patch --]
[-- Type: text/plain, Size: 3270 bytes --]

--- compat-wireless-2009-07-31/scripts/check_depmod	2009-07-31 10:42:52.000000000 -0400
+++ compat-wireless-patch/scripts/check_depmod	2009-07-31 16:30:22.000000000 -0400
@@ -7,50 +7,77 @@
 # Seems Mandriva has an $DEPMOD_DIR but it doesn't have any files,
 # so lets deal with those distributions.
 DEPMOD_CONF="/etc/depmod.conf"
+DEPMOD_CONF_TMP="$DEPMOD_CONF.compat-wireless.old"
 DEPMOD_DIR="/etc/depmod.d/"
 COMPAT_DEPMOD_FILE=compat-wireless.conf
+GREP_REGEX_UPDATES="^[[:space:]]*search.*[[:space:]]updates\([[:space:]]\|$\)"
+GREP_REGEX_SEARCH="^[[:space:]]*search[[:space:]].\+$"
+DEPMOD_CMD="depmod"
 
 function add_compat_depmod_conf {
 	echo "NOTE: Your distribution lacks an $DEPMOD_DIR directory with "
-	echo "updates/ directory being prioritized for mouldes, we're adding "
+	echo "updates/ directory being prioritized for modules, we're adding "
 	echo "one for you."
 	mkdir -p $DEPMOD_DIR
-	echo "search updates extra built-in" > $DEPMOD_DIR/$COMPAT_DEPMOD_FILE
+	FIRST_FILE=$(ls $DEPMOD_DIR|head -1)
+	[ -n "$FIRST_FILE" ] && while [[ $FIRST_FILE < $COMPAT_DEPMOD_FILE ]]; do
+		COMPAT_DEPMOD_FILE="0$COMPAT_DEPMOD_FILE"
+	done
+	echo "search updates" > $DEPMOD_DIR/$COMPAT_DEPMOD_FILE
 }
 
-function depmod_updates_ok {
-	echo "depmod will prefer updates/ over kernel/ -- OK!"
+function add_global_depmod_conf {
+	echo "NOTE: Your distribution lacks updates/ directory being"
+ 	echo "prioritized for modules, we're adding it to $DEPMOD_CONF."
+	rm -f $DEPMOD_CONF_TMP
+	[ -f $DEPMOD_CONF ] && cp -f $DEPMOD_CONF $DEPMOD_CONF_TMP
+	echo "search updates" > $DEPMOD_CONF
+	[ -f $DEPMOD_CONF_TMP ] && cat $DEPMOD_CONF_TMP >> $DEPMOD_CONF
 }
 
-function check_depmod_conf {
-	if [ -f $DEPMOD_CONF ]; then
-		grep -q updates $DEPMOD_CONF
-		return $?
-	fi
-	return 1
+function depmod_updates_ok {
+	echo "depmod will prefer updates/ over kernel/ -- OK!"
 }
 
-function add_depmod_conf_if_missing {
-	check_depmod_conf
-	if [[ $? -ne 0 ]]; then
-		add_compat_depmod_conf
+function add_depmod_conf {
+	if [ -f "$DEPMOD_CONF" ]; then
+		add_global_depmod_conf
 	else
-		depmod_updates_ok
+		DEPMOD_VERSION=$($DEPMOD_CMD --version | cut -d" " -f2 | sed "s/\.//")
+		if [[ $DEPMOD_VERSION -gt 36 ]]; then
+			add_compat_depmod_conf
+		else
+			add_global_depmod_conf
+		fi
 	fi
 }
 
+# =============================================================================
+# === MAIN ====================================================================
+# =============================================================================
+
+GREP_FILES=""
+[ -f $DEPMOD_CONF ] && GREP_FILES="$DEPMOD_CONF"
 if [ -d $DEPMOD_DIR ]; then
 	DEPMOD_FILE_COUNT=$(ls $DEPMOD_DIR | wc -l)
-	if [[ $DEPMOD_FILE_COUNT -eq 0 ]]; then
-		add_depmod_conf_if_missing
-	else
-		grep -q updates $DEPMOD_DIR/*
-		if [[ $? -ne 0 ]]; then
-			add_depmod_conf_if_missing
-		else
+	[[ $DEPMOD_FILE_COUNT -gt 0 ]] && GREP_FILES="$GREP_FILES $DEPMOD_DIR/*"
+fi
+
+if [ -n "$GREP_FILES" ]; then
+	grep -q "$GREP_REGEX_SEARCH" $GREP_FILES
+	if [[ $? -eq 0 ]]; then
+		grep -q "$GREP_REGEX_UPDATES" $GREP_FILES
+		if [[ $? -eq 0 ]]; then
 			depmod_updates_ok
+		else
+			add_depmod_conf
 		fi
+	else
+		depmod_updates_ok
 	fi
 else
-	add_depmod_conf_if_missing
+	depmod_updates_ok
 fi
+
+exit 0
+

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Linux Wireless] Update of "en/users/Download" by ReinetteChatre
  2009-07-31 21:19                   ` Roman Macko
@ 2009-07-31 23:36                     ` Luis R. Rodriguez
  0 siblings, 0 replies; 12+ messages in thread
From: Luis R. Rodriguez @ 2009-07-31 23:36 UTC (permalink / raw)
  To: Roman Macko; +Cc: reinette chatre, linux-wireless

On Fri, Jul 31, 2009 at 2:19 PM, Roman Macko<rmacko72@gmail.com> wrote:
> Hi Luis,
>
> here is promised patch

Patch applied, thanks!

  Luis

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-07-31 23:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20090729214510.31738.90990@cl-1649.ham-01.de.sixxs.net>
2009-07-29 21:53 ` [Linux Wireless] Update of "en/users/Download" by ReinetteChatre Luis R. Rodriguez
2009-07-29 21:57   ` reinette chatre
2009-07-29 22:04     ` Luis R. Rodriguez
2009-07-30 13:12       ` Roman Macko
2009-07-30 14:43         ` Luis R. Rodriguez
2009-07-30 16:59           ` Roman Macko
2009-07-30 17:06             ` Luis R. Rodriguez
2009-07-31  1:20               ` Roman Macko
2009-07-31  1:31                 ` Luis R. Rodriguez
2009-07-31 14:36                   ` Roman Macko
2009-07-31 21:19                   ` Roman Macko
2009-07-31 23:36                     ` Luis R. Rodriguez

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