linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
@ 2008-04-29 18:35 Sam Ravnborg
  2008-04-29 21:24 ` Andres Salomon
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Sam Ravnborg @ 2008-04-29 18:35 UTC (permalink / raw)
  To: linux-kbuild, LKML; +Cc: Dave Jones, Roland McGrath, Andres Salomon

Recently there has been request for a number of new
kconfig related targets.

In general it boils down to the following:

We need to be flexible in what configuration
we start out from and how we apply it.

We need to be able to apply it in following ways:
1) automated - select defaults for all new symbols
   => It is used for "make defconfig, make *_defconfig" today

2) interactive - asking user for all new symbols
   and error out if stdin is redirected

3) list unknown - list all new symbols and do not
   create a new config

With oldconfig today we have two modes:
-> One mode where we are very chatty and show
   all output.
-> And the 'silent' mode where we only start being
   chatty when we see a new symbol.

I plan to drop the 'very chatty' mode as I
do not see it usefull.
So in essense 'make oldconfig' and 'make silentoldconfig'
become equal.

The commands we have today for kconfig is:

# Command line variants
make oldconfig
make silentoldconfig
make defconfig
make XXX_defconfig

(The other frontends are left out on purpose).
The challenge here is to come up with a syntax that
allows us to select between the three behaviours,
while keeping backward compatibility.

The best suggestion I have so far is to say that:
a) if defconfig is specified then we use method 1)
b) if oldconfig is specified then we use method 2)
c) if newconfig is specified then we use method 3)

And we add support for a new 'commandline' parameter
'K' so I can say:

make K=/proc/config.gz defconfig
make K=i386_defconfig  defconfig
make K=i386_defconfig  oldconfig
make K=/proc/config.gz newconfig

So K is used to specify what config file we use
to start out from.

Care should be taken to keep the known good
targets working as before.

Andres Salomon already did some preparational work
for this but I need to find a good way to handle the K=
parameter.
Dave J also posted patches that is useful for 'newconfig'.

But I wanted to ask for opinions before diving into
implmenting this.

	Sam

[Random notes..]

# Enviroment variables affecting kconfig
KCONFIG_ALLCONFIG
KCONFIG_NOSILENTUPDATE
KCONFIG_CONFIG
KCONFIG_OVERWRITECONFIG
KCONFIG_NOTIMESTAMP
KCONFIG_AUTOCONFIG
KCONFIG_AUTOHEADER

#input files (aparts from the mandatory ones)
all.config
allno.config
allmod.config
allyes.config
allrandom.config


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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-04-29 18:35 Additional kconfig targets (cloneconfig, nonint_oldconfig etc) Sam Ravnborg
@ 2008-04-29 21:24 ` Andres Salomon
  2008-04-30  6:35   ` Sam Ravnborg
  2008-04-30 10:45   ` SL Baur
  2008-04-30 14:44 ` Jan Engelhardt
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 22+ messages in thread
From: Andres Salomon @ 2008-04-29 21:24 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kbuild, LKML, Dave Jones, Roland McGrath

On Tue, 29 Apr 2008 20:35:31 +0200
Sam Ravnborg <sam@ravnborg.org> wrote:

> Recently there has been request for a number of new
> kconfig related targets.
> 
> In general it boils down to the following:
> 
> We need to be flexible in what configuration
> we start out from and how we apply it.
> 
> We need to be able to apply it in following ways:
> 1) automated - select defaults for all new symbols
>    => It is used for "make defconfig, make *_defconfig" today
> 
> 2) interactive - asking user for all new symbols
>    and error out if stdin is redirected
> 
> 3) list unknown - list all new symbols and do not
>    create a new config
> 
> With oldconfig today we have two modes:
> -> One mode where we are very chatty and show
>    all output.
> -> And the 'silent' mode where we only start being
>    chatty when we see a new symbol.
> 
> I plan to drop the 'very chatty' mode as I
> do not see it usefull.

I'd certainly agree with that.

> So in essense 'make oldconfig' and 'make silentoldconfig'
> become equal.
> 
> The commands we have today for kconfig is:
> 
> # Command line variants
> make oldconfig
> make silentoldconfig
> make defconfig
> make XXX_defconfig
> 
> (The other frontends are left out on purpose).
> The challenge here is to come up with a syntax that
> allows us to select between the three behaviours,
> while keeping backward compatibility.
> 
> The best suggestion I have so far is to say that:
> a) if defconfig is specified then we use method 1)
> b) if oldconfig is specified then we use method 2)
> c) if newconfig is specified then we use method 3)
> 

'newconfig' sounds to me like you're creating a new config; the exact
opposite of what it does.  I'd suggest 'listnewconfig' or some such thing.
Then again, 'defconfig' and 'oldconfig' are primarily what I care about,
as I haven't been in a situation where I would have found method 3) to
be useful.

> And we add support for a new 'commandline' parameter
> 'K' so I can say:
> 
> make K=/proc/config.gz defconfig
> make K=i386_defconfig  defconfig
> make K=i386_defconfig  oldconfig
> make K=/proc/config.gz newconfig
> 
> So K is used to specify what config file we use
> to start out from.

Sounds good, I highly prefer specifying the config via env variable
rather than embedded in the target (ie, 'make olpc_defconfig').

> 
> Care should be taken to keep the known good
> targets working as before.
> 
> Andres Salomon already did some preparational work
> for this but I need to find a good way to handle the K=
> parameter.
> Dave J also posted patches that is useful for 'newconfig'.
> 
> But I wanted to ask for opinions before diving into
> implmenting this.
> 
> 	Sam
> 
> [Random notes..]
> 
> # Enviroment variables affecting kconfig
> KCONFIG_ALLCONFIG
> KCONFIG_NOSILENTUPDATE
> KCONFIG_CONFIG
> KCONFIG_OVERWRITECONFIG
> KCONFIG_NOTIMESTAMP
> KCONFIG_AUTOCONFIG
> KCONFIG_AUTOHEADER
> 
> #input files (aparts from the mandatory ones)
> all.config
> allno.config
> allmod.config
> allyes.config
> allrandom.config
> 

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-04-29 21:24 ` Andres Salomon
@ 2008-04-30  6:35   ` Sam Ravnborg
  2008-04-30 14:43     ` Jan Engelhardt
  2008-04-30 10:45   ` SL Baur
  1 sibling, 1 reply; 22+ messages in thread
From: Sam Ravnborg @ 2008-04-30  6:35 UTC (permalink / raw)
  To: Andres Salomon; +Cc: linux-kbuild, LKML, Dave Jones, Roland McGrath

> > The commands we have today for kconfig is:
> > 
> > # Command line variants
> > make oldconfig
> > make silentoldconfig
> > make defconfig
> > make XXX_defconfig
> > 
> > (The other frontends are left out on purpose).
> > The challenge here is to come up with a syntax that
> > allows us to select between the three behaviours,
> > while keeping backward compatibility.
> > 
> > The best suggestion I have so far is to say that:
> > a) if defconfig is specified then we use method 1)
> > b) if oldconfig is specified then we use method 2)
> > c) if newconfig is specified then we use method 3)
> > 
> 
> 'newconfig' sounds to me like you're creating a new config; the exact
> opposite of what it does.  I'd suggest 'listnewconfig' or some such thing.
listnewconfig is better - will use that.

> Then again, 'defconfig' and 'oldconfig' are primarily what I care about,
> as I haven't been in a situation where I would have found method 3) to
> be useful.
> 
> > And we add support for a new 'commandline' parameter
> > 'K' so I can say:
> > 
> > make K=/proc/config.gz defconfig
> > make K=i386_defconfig  defconfig
> > make K=i386_defconfig  oldconfig
> > make K=/proc/config.gz newconfig
> > 
> > So K is used to specify what config file we use
> > to start out from.
> 
> Sounds good, I highly prefer specifying the config via env variable
> rather than embedded in the target (ie, 'make olpc_defconfig').
I will try to come up with some simple algorithm to locate the file.
I guess something like:

a) Try in local dir with name supplied
b) If filname does not start with '/' try in arch/$ARCH/configs/*
c) If filname does not start with '/' try in arch/$ARCH/configs/*_defconfig

If filename is prefixed .gz unpack it

	Sam

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-04-29 21:24 ` Andres Salomon
  2008-04-30  6:35   ` Sam Ravnborg
@ 2008-04-30 10:45   ` SL Baur
  2008-04-30 15:01     ` Randy Dunlap
  1 sibling, 1 reply; 22+ messages in thread
From: SL Baur @ 2008-04-30 10:45 UTC (permalink / raw)
  To: Andres Salomon
  Cc: Sam Ravnborg, linux-kbuild, LKML, Dave Jones, Roland McGrath

On 4/29/08, Andres Salomon <dilinger@queued.net> wrote:
> On Tue, 29 Apr 2008 20:35:31 +0200
>  Sam Ravnborg <sam@ravnborg.org> wrote:

>  > And we add support for a new 'commandline' parameter
>  > 'K' so I can say:
>  >
>  > make K=/proc/config.gz defconfig
>  > make K=i386_defconfig  defconfig
>  > make K=i386_defconfig  oldconfig
>  > make K=/proc/config.gz newconfig
>  >
>  > So K is used to specify what config file we use
>  > to start out from.

I like this idea a lot.  I didn't like the hardcoded `.config' 13
years ago and I still
don't like it now.

>  Sounds good, I highly prefer specifying the config via env variable
>  rather than embedded in the target (ie, 'make olpc_defconfig').

Is there any reasonable way to embed the configuration file name in the kernel
image like BSD does it?  /proc/config.gz is a good way to retrieve way to
retrieve configuration information on a running system, not so good for pushing
kernels out to a network and keeping track of the config files on the build
machine.

I don't have any way of checking this now, but can /proc files like
/proc/config.gz
be exported via NFS or the equivalent?

-sb

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-04-30  6:35   ` Sam Ravnborg
@ 2008-04-30 14:43     ` Jan Engelhardt
  0 siblings, 0 replies; 22+ messages in thread
From: Jan Engelhardt @ 2008-04-30 14:43 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Andres Salomon, linux-kbuild, LKML, Dave Jones, Roland McGrath


On Wednesday 2008-04-30 08:35, Sam Ravnborg wrote:
>> 
>> 'newconfig' sounds to me like you're creating a new config; the exact
>> opposite of what it does.  I'd suggest 'listnewconfig' or some such thing.
>
>listnewconfig is better - will use that.

Mh, newconfig sounds like  make K=/dev/null oldconfig/defconfig

>> Sounds good, I highly prefer specifying the config via env variable
>> rather than embedded in the target (ie, 'make olpc_defconfig').
>I will try to come up with some simple algorithm to locate the file.
>I guess something like:
>
>a) Try in local dir with name supplied
>b) If filname does not start with '/' try in arch/$ARCH/configs/*
>c) If filname does not start with '/' try in arch/$ARCH/configs/*_defconfig

Scan ./ before arch/$ARCH/configs/

>If filename is prefixed .gz unpack it

 /proc/.gzconfig? :-D (scnr)


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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-04-29 18:35 Additional kconfig targets (cloneconfig, nonint_oldconfig etc) Sam Ravnborg
  2008-04-29 21:24 ` Andres Salomon
@ 2008-04-30 14:44 ` Jan Engelhardt
  2008-05-02 10:56   ` Sam Ravnborg
  2008-05-01  4:40 ` Roman Zippel
  2008-05-02 19:09 ` Sam Ravnborg
  3 siblings, 1 reply; 22+ messages in thread
From: Jan Engelhardt @ 2008-04-30 14:44 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: linux-kbuild, LKML, Dave Jones, Roland McGrath, Andres Salomon


On Tuesday 2008-04-29 20:35, Sam Ravnborg wrote:
>
>I plan to drop the 'very chatty' mode as I
>do not see it usefull.
>So in essense 'make oldconfig' and 'make silentoldconfig'
>become equal.

Sounds good.


>The commands we have today for kconfig is:
>
># Command line variants
>make oldconfig
>make silentoldconfig
>make defconfig
>make XXX_defconfig
>
>(The other frontends are left out on purpose).
>The challenge here is to come up with a syntax that
>allows us to select between the three behaviours,
>while keeping backward compatibility.
>
>The best suggestion I have so far is to say that:
>a) if defconfig is specified then we use method 1)
>b) if oldconfig is specified then we use method 2)
>c) if newconfig is specified then we use method 3)

[Where is 1) defined?]

>And we add support for a new 'commandline' parameter
>'K' so I can say:
>
>make K=/proc/config.gz defconfig
>make K=i386_defconfig  defconfig
>make K=i386_defconfig  oldconfig
>make K=/proc/config.gz newconfig
>
>So K is used to specify what config file we use
>to start out from.

Oh that's real good, even better than cloneconfig.

># Enviroment variables affecting kconfig
>KCONFIG_ALLCONFIG
>KCONFIG_NOSILENTUPDATE
>KCONFIG_CONFIG
>KCONFIG_OVERWRITECONFIG
>KCONFIG_NOTIMESTAMP
>KCONFIG_AUTOCONFIG
>KCONFIG_AUTOHEADER

Ok and these are doing .. what?

>#input files (aparts from the mandatory ones)
>all.config
>allno.config
>allmod.config
>allyes.config
>allrandom.config

Used for..?

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-04-30 10:45   ` SL Baur
@ 2008-04-30 15:01     ` Randy Dunlap
  2008-04-30 20:32       ` SL Baur
  0 siblings, 1 reply; 22+ messages in thread
From: Randy Dunlap @ 2008-04-30 15:01 UTC (permalink / raw)
  To: SL Baur
  Cc: Andres Salomon, Sam Ravnborg, linux-kbuild, LKML, Dave Jones,
	Roland McGrath

On Wed, 30 Apr 2008 03:45:57 -0700 SL Baur wrote:

> On 4/29/08, Andres Salomon <dilinger@queued.net> wrote:
> > On Tue, 29 Apr 2008 20:35:31 +0200
> >  Sam Ravnborg <sam@ravnborg.org> wrote:
> 
> >  > And we add support for a new 'commandline' parameter
> >  > 'K' so I can say:
> >  >
> >  > make K=/proc/config.gz defconfig
> >  > make K=i386_defconfig  defconfig
> >  > make K=i386_defconfig  oldconfig
> >  > make K=/proc/config.gz newconfig
> >  >
> >  > So K is used to specify what config file we use
> >  > to start out from.
> 
> I like this idea a lot.  I didn't like the hardcoded `.config' 13
> years ago and I still
> don't like it now.
> 
> >  Sounds good, I highly prefer specifying the config via env variable
> >  rather than embedded in the target (ie, 'make olpc_defconfig').
> 
> Is there any reasonable way to embed the configuration file name in the kernel
> image like BSD does it?  /proc/config.gz is a good way to retrieve way to
> retrieve configuration information on a running system, not so good for pushing
> kernels out to a network and keeping track of the config files on the build
> machine.

I don't know how BSD does it, but CONFIG_IKCONFIG does embed the
config image in the kernel.  It can be extracted with
scripts/extract-ikconfig.

> I don't have any way of checking this now, but can /proc files like
> /proc/config.gz
> be exported via NFS or the equivalent?

---
~Randy

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-04-30 15:01     ` Randy Dunlap
@ 2008-04-30 20:32       ` SL Baur
  2008-04-30 20:35         ` Roland McGrath
  2008-04-30 20:37         ` Sam Ravnborg
  0 siblings, 2 replies; 22+ messages in thread
From: SL Baur @ 2008-04-30 20:32 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Andres Salomon, Sam Ravnborg, linux-kbuild, LKML, Dave Jones,
	Roland McGrath

On 4/30/08, Randy Dunlap <randy.dunlap@oracle.com> wrote:
> On Wed, 30 Apr 2008 03:45:57 -0700 SL Baur wrote:

>  > Is there any reasonable way to embed the configuration file name in the kernel
>  > image like BSD does it?  /proc/config.gz is a good way to retrieve way to
>  > retrieve configuration information on a running system, not so good for pushing
>  > kernels out to a network and keeping track of the config files on the build
>  > machine.
>
>
> I don't know how BSD does it, but CONFIG_IKCONFIG does embed the
>  config image in the kernel.  It can be extracted with
>  scripts/extract-ikconfig.

No, that's not what I meant.  Now that we have a means of specifying
a configuration file by name, it would be nice if the file name could,
for example, be appended to EXTRAVERSION.  That's all it would
take to duplicate the behavior I misdescribed.


Eg. `make K=HPxw4300.config ...' would have "-HPxw4300" appended
to EXTRAVERSION.  Maybe this doesn't make sense any more, but it
was once something I wanted very much.

-sb

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-04-30 20:32       ` SL Baur
@ 2008-04-30 20:35         ` Roland McGrath
  2008-04-30 20:37         ` Sam Ravnborg
  1 sibling, 0 replies; 22+ messages in thread
From: Roland McGrath @ 2008-04-30 20:35 UTC (permalink / raw)
  To: SL Baur
  Cc: Randy Dunlap, Andres Salomon, Sam Ravnborg, linux-kbuild, LKML,
	Dave Jones

> Eg. `make K=HPxw4300.config ...' would have "-HPxw4300" appended
> to EXTRAVERSION.  Maybe this doesn't make sense any more, but it
> was once something I wanted very much.

We have "echo .foo > localversion" or CONFIG_LOCALVERSION=.foo for that.
Maybe what you would like is a variable on that make command line to
magically set CONFIG_LOCALVERSION with less typing.


Thanks,
Roland

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-04-30 20:32       ` SL Baur
  2008-04-30 20:35         ` Roland McGrath
@ 2008-04-30 20:37         ` Sam Ravnborg
  1 sibling, 0 replies; 22+ messages in thread
From: Sam Ravnborg @ 2008-04-30 20:37 UTC (permalink / raw)
  To: SL Baur
  Cc: Randy Dunlap, Andres Salomon, linux-kbuild, LKML, Dave Jones,
	Roland McGrath

On Wed, Apr 30, 2008 at 01:32:52PM -0700, SL Baur wrote:
> On 4/30/08, Randy Dunlap <randy.dunlap@oracle.com> wrote:
> > On Wed, 30 Apr 2008 03:45:57 -0700 SL Baur wrote:
> 
> >  > Is there any reasonable way to embed the configuration file name in the kernel
> >  > image like BSD does it?  /proc/config.gz is a good way to retrieve way to
> >  > retrieve configuration information on a running system, not so good for pushing
> >  > kernels out to a network and keeping track of the config files on the build
> >  > machine.
> >
> >
> > I don't know how BSD does it, but CONFIG_IKCONFIG does embed the
> >  config image in the kernel.  It can be extracted with
> >  scripts/extract-ikconfig.
> 
> No, that's not what I meant.  Now that we have a means of specifying
> a configuration file by name, it would be nice if the file name could,
> for example, be appended to EXTRAVERSION.  That's all it would
> take to duplicate the behavior I misdescribed.
> 
> 
> Eg. `make K=HPxw4300.config ...' would have "-HPxw4300" appended
> to EXTRAVERSION.  Maybe this doesn't make sense any more, but it
> was once something I wanted very much.
You can just do:
echo "-HPxw4300" > localversion

Then it gets appended to the kernel version. While not automatic is
solves your need.

	Sam

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-04-29 18:35 Additional kconfig targets (cloneconfig, nonint_oldconfig etc) Sam Ravnborg
  2008-04-29 21:24 ` Andres Salomon
  2008-04-30 14:44 ` Jan Engelhardt
@ 2008-05-01  4:40 ` Roman Zippel
  2008-05-01  6:12   ` Sam Ravnborg
  2008-05-03 21:49   ` Sam Ravnborg
  2008-05-02 19:09 ` Sam Ravnborg
  3 siblings, 2 replies; 22+ messages in thread
From: Roman Zippel @ 2008-05-01  4:40 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: linux-kbuild, LKML, Dave Jones, Roland McGrath, Andres Salomon

Hi,

On Tuesday 29. April 2008, Sam Ravnborg wrote:

> Recently there has been request for a number of new
> kconfig related targets.
>
> In general it boils down to the following:
>
> We need to be flexible in what configuration
> we start out from and how we apply it.
>
> We need to be able to apply it in following ways:
> 1) automated - select defaults for all new symbols
>    => It is used for "make defconfig, make *_defconfig" today
>
> 2) interactive - asking user for all new symbols
>    and error out if stdin is redirected
>
> 3) list unknown - list all new symbols and do not
>    create a new config

A general comment about the intendend design:
conf.c is primarily meant as interactive tool. defconfig isn't exactly 
interactive, but is included for historical reasons as it produces the same 
output.
The patch I've seen for the last point put it into conf.c, which is the wrong 
place for it. For this sort of thing we should create a small query tool, 
which then can export all sorts of information.

If we silence the defconfig output (which IMO is a good thing, as I don't 
think anyone looked at the output seriously for a long time and the current 
behaviour has purely historical reasons), it would also open up the 
possibility to separate it from conf.c.
This also fits into an idea I'm playing with to extend the .config format like 
this:

%defaultmode: mod
CONFIG_FOO=n

Basically this could replace "make allmodconfig KCONFIG_ALLCONFIG=..." and the 
current way to produce an allmodconfig would be replaced by a dedicated 
function.

bye, Roman

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-05-01  4:40 ` Roman Zippel
@ 2008-05-01  6:12   ` Sam Ravnborg
  2008-05-03 21:49   ` Sam Ravnborg
  1 sibling, 0 replies; 22+ messages in thread
From: Sam Ravnborg @ 2008-05-01  6:12 UTC (permalink / raw)
  To: Roman Zippel
  Cc: linux-kbuild, LKML, Dave Jones, Roland McGrath, Andres Salomon

On Thu, May 01, 2008 at 06:40:29AM +0200, Roman Zippel wrote:
> Hi,
> 
> On Tuesday 29. April 2008, Sam Ravnborg wrote:
> 
> > Recently there has been request for a number of new
> > kconfig related targets.
> >
> > In general it boils down to the following:
> >
> > We need to be flexible in what configuration
> > we start out from and how we apply it.
> >
> > We need to be able to apply it in following ways:
> > 1) automated - select defaults for all new symbols
> >    => It is used for "make defconfig, make *_defconfig" today
> >
> > 2) interactive - asking user for all new symbols
> >    and error out if stdin is redirected
> >
> > 3) list unknown - list all new symbols and do not
> >    create a new config
> 
> A general comment about the intendend design:
> conf.c is primarily meant as interactive tool. defconfig isn't exactly 
> interactive, but is included for historical reasons as it produces the same 
> output.
> The patch I've seen for the last point put it into conf.c, which is the wrong 
> place for it. For this sort of thing we should create a small query tool, 
> which then can export all sorts of information.

Hi Roman.
This is work in progress...
I have created a new frontend: aconf.c that is a trimmed down version
of conf.c. aconf.c are intended to take care of all the automated configurations
such as: all*config, randconfig and the automated defconfig

In this way we have conf.c for all the interactive targets and aconf for
all the automated targets.

This is not exactly what you suggest but I thik a step in the right direction.

Comments?

	Sam

/*
 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
 * Copyright (C) 2008 Sam Ravnborg <sam@ravnborg.org>
 * Released under the terms of the GNU GPL v2.0.
 */

/*
 * Generate the automated configs
 */

#include <locale.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/stat.h>

#define LKC_DIRECT_LINK
#include "lkc.h"

static void check_conf(struct menu *menu);
static void conf(struct menu *menu);

enum {
	set_default,
	set_yes,
	set_mod,
	set_no,
	set_random
} input_mode;

static char *defconfig_file;

static int conf_cnt;
static struct menu *rootEntry;

/* Set strig value - it this a nop as it looks like? */
static void conf_string(struct menu *menu)
{
	struct symbol *sym = menu->sym;
	const char *def;


	if (!sym_is_changable(sym))
		return;

	if (sym_has_value(sym) && (input_mode != set_default))
		return;

	def = sym_get_string_value(sym);
	if (def)
		sym_set_string_value(sym, def);
}

static void conf_sym(struct menu *menu)
{
	struct symbol *sym = menu->sym;
	int type;
	tristate val;

	if (!sym_is_changable(sym))
		return;

	if (sym_has_value(sym) && (input_mode != set_default))
		return;

	type = sym_get_type(sym);
	switch (input_mode) {
	case set_yes:
		if (sym_tristate_within_range(sym, yes)) {
			sym_set_tristate_value(sym, yes);
			break;
		}
	/* fallthrough */
	case set_mod:
		if (type == S_TRISTATE) {
			if (sym_tristate_within_range(sym, mod)) {
				sym_set_tristate_value(sym, mod);
				break;
			}
		} else if (sym_tristate_within_range(sym, yes)) {
			sym_set_tristate_value(sym, yes);
			break;
		}
	/* fallthrough */
	case set_no:
		if (sym_tristate_within_range(sym, no)) {
			sym_set_tristate_value(sym, no);
			break;
		}
	/* fallthrough */
	case set_random:
		 do {
			val = (tristate)(rand() % 3);
		} while (!sym_tristate_within_range(sym, val));
		switch (val) {
		case no:  sym_set_tristate_value(sym, no); break;
		case mod: sym_set_tristate_value(sym, mod); break;
		case yes: sym_set_tristate_value(sym, yes); break;
		}
		break;
	/* silence gcc warning */
	case set_default:
		sym_set_tristate_value(sym, sym_get_tristate_value(sym));
		break;
	}
}

static void conf_choice(struct menu *menu)
{
	struct symbol *sym, *def_sym;
	struct menu *child;
	int type;
	bool is_new;
	int cnt, def;

	sym = menu->sym;
	type = sym_get_type(sym);
	is_new = !sym_has_value(sym);
	if (sym_is_changable(sym)) {
		conf_sym(menu);
		sym_calc_value(sym);
	}
	if (sym_get_tristate_value(sym) != yes)
		return;
	def_sym = sym_get_choice_value(sym);
	cnt = def = 0;
	for (child = menu->list; child; child = child->next) {
		if (!child->sym || !menu_is_visible(child))
			continue;
		cnt++;
		if (child->sym == def_sym)
			def = cnt;
	}
	if (cnt == 1)
		goto conf_childs;

	switch (input_mode) {
	case set_random:
		if (is_new)
			def = (rand() % cnt) + 1;
	/* fallthrough */
	case set_default:
	case set_yes:
	case set_mod:
	case set_no:
		cnt = def;
		break;
	}

conf_childs:
	for (child = menu->list; child; child = child->next) {
		if (!child->sym || !menu_is_visible(child))
			continue;
		if (!--cnt)
			break;
	}
	sym_set_choice_value(sym, child->sym);
	for (child = child->list; child; child = child->next)
		conf(child);
}


static void conf(struct menu *menu)
{
	struct symbol *sym;
	struct property *prop;
	struct menu *child;

	if (!menu_is_visible(menu))
		return;

	sym = menu->sym;
	//if (sym)
	//	printf("sym:%s\n", sym->name);
	prop = menu->prompt;
	if (prop && prop->type == P_MENU) {
		if (menu != rootEntry) {
			check_conf(menu);
			return;
		}
	}

	if (!sym)
		goto conf_childs;

	if (sym_is_choice(sym)) {
		conf_choice(menu);
		if (sym->curr.tri != mod)
			return;
		goto conf_childs;
	}

	switch (sym->type) {
	case S_INT:
	case S_HEX:
	case S_STRING:
		conf_string(menu);
		break;
	default:
		conf_sym(menu);
		break;
	}

conf_childs:
	for (child = menu->list; child; child = child->next)
		conf(child);
}

static void check_conf(struct menu *menu)
{
	struct symbol *sym;
	struct menu *child;

	if (!menu_is_visible(menu))
		return;

	sym = menu->sym;
	if (sym && !sym_has_value(sym)) {
		if (sym_is_changable(sym) ||
		    (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
			conf_cnt++;
			rootEntry = menu_get_parent_menu(menu);
			conf(rootEntry);
		}
	}

	for (child = menu->list; child; child = child->next)
		check_conf(child);
}

int main(int ac, char **av)
{
	int opt;
	const char *name;
	struct stat tmpstat;

	setlocale(LC_ALL, "");
	bindtextdomain(PACKAGE, LOCALEDIR);
	textdomain(PACKAGE);

	while ((opt = getopt(ac, av, "dD:nmyrh")) != -1) {
		switch (opt) {
		case 'd':
			input_mode = set_default;
			break;
		case 'D':
			input_mode = set_default;
			defconfig_file = optarg;
			break;
		case 'n':
			input_mode = set_no;
			break;
		case 'm':
			input_mode = set_mod;
			break;
		case 'y':
			input_mode = set_yes;
			break;
		case 'r':
			input_mode = set_random;
			srand(time(NULL));
			break;
		case 'h':
			printf(_("See README for usage info\n"));
			exit(0);
			break;
		default:
			fprintf(stderr, _("See README for usage info\n"));
			exit(1);
		}
	}
	if (ac == optind) {
		printf(_("%s: Kconfig file missing\n"), av[0]);
		exit(1);
	}
	name = av[optind];
	conf_parse(name);
	//zconfdump(stdout);
	switch (input_mode) {
	case set_default:
		if (!defconfig_file)
			defconfig_file = conf_get_default_confname();
		if (conf_read(defconfig_file)) {
			printf(_("***\n"
				"*** Can't find default configuration \"%s\"!\n"
				"***\n"), defconfig_file);
			exit(1);
		}
		break;
	case set_no:
	case set_mod:
	case set_yes:
	case set_random:
		name = getenv("KCONFIG_ALLCONFIG");
		if (name && !stat(name, &tmpstat)) {
			conf_read_simple(name, S_DEF_USER);
			break;
		}
		switch (input_mode) {
		case set_no:	 name = "allno.config"; break;
		case set_mod:	 name = "allmod.config"; break;
		case set_yes:	 name = "allyes.config"; break;
		case set_random: name = "allrandom.config"; break;
		default: break;
		}
		if (!stat(name, &tmpstat))
			conf_read_simple(name, S_DEF_USER);
		else if (!stat("all.config", &tmpstat))
			conf_read_simple("all.config", S_DEF_USER);
		break;
	default:
		break;
	}

	do {
		conf_cnt = 0;
		check_conf(&rootmenu);
	} while (conf_cnt);
	if (conf_write(NULL)) {
		fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
		return 1;
	}

	if (conf_write_autoconf()) {
		fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
		return 1;
	}

	return 0;
}

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-04-30 14:44 ` Jan Engelhardt
@ 2008-05-02 10:56   ` Sam Ravnborg
  0 siblings, 0 replies; 22+ messages in thread
From: Sam Ravnborg @ 2008-05-02 10:56 UTC (permalink / raw)
  To: Jan Engelhardt
  Cc: linux-kbuild, LKML, Dave Jones, Roland McGrath, Andres Salomon

> >(The other frontends are left out on purpose).
> >The challenge here is to come up with a syntax that
> >allows us to select between the three behaviours,
> >while keeping backward compatibility.
> >
> >The best suggestion I have so far is to say that:
> >a) if defconfig is specified then we use method 1)
> >b) if oldconfig is specified then we use method 2)
> >c) if newconfig is specified then we use method 3)
> 
> [Where is 1) defined?]

1) automated - select defaults for all new symbols
   => It is used for "make defconfig, make *_defconfig" today

> Ok and these are doing .. what?

> ># Enviroment variables affecting kconfig
> >KCONFIG_ALLCONFIG

Specify input file in .config format to adjust a all*config run

> >KCONFIG_NOSILENTUPDATE
If set then error out if .config is modified

> >KCONFIG_CONFIG
Provide alternative name for .config

> >KCONFIG_OVERWRITECONFIG
If you set KCONFIG_OVERWRITECONFIG in environment, Kconfig will not break
 symlinks when .config is a symlink to somewhere else

> >KCONFIG_NOTIMESTAMP
Do not put timestamp in .config

> >KCONFIG_AUTOCONFIG
Provide alternative name for: include/config/auto.conf

> >KCONFIG_AUTOHEADER
Provide alternative name for include/linux/autoconf.h 




> Used for..?
All used to hardcode specific values in all*config builds.

> >#input files (aparts from the mandatory ones)
> >all.config
> >allno.config
> >allmod.config
> >allyes.config
> >allrandom.config

	Sam

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-04-29 18:35 Additional kconfig targets (cloneconfig, nonint_oldconfig etc) Sam Ravnborg
                   ` (2 preceding siblings ...)
  2008-05-01  4:40 ` Roman Zippel
@ 2008-05-02 19:09 ` Sam Ravnborg
  2008-05-21 20:47   ` Andres Salomon
  3 siblings, 1 reply; 22+ messages in thread
From: Sam Ravnborg @ 2008-05-02 19:09 UTC (permalink / raw)
  To: linux-kbuild, LKML
  Cc: Dave Jones, Roland McGrath, Andres Salomon, Roman Zippel

With the attached patch you can do:

make K=my_favourite_config defconfig

kconfig will read all config values form 'my_favourite_config'
and set all other symbols to their default value.
The output is now dense like this:
# configuration is based on 'my_favourite_config'
#
# configuration written to .config
#


The K= notations works for the usual suspects:
allnoconfig, allyesconfig, allmodconfig, randconfig and defconfig

alldefconfig with no parameters create a kernel konfiguration
with all parameters set to default.

The difference between alldefconfig and defconfig is that if
no K= parameter is specified the defconfig will try to load
one of the files specified in the defconfig list from
init/Kconfig (see DEFCONFIG_LIST)

I decided to create a new .c file to support this.
It was not strictly necessary but this allows us to
simplify conf.c a lot. I did not do so yet.

What is missing:
1) No support for .gz input file
   But aconf.sh should be easy to adjust to this

2) We hardcode that files name *_defconfig are found
   in arch/$ARCH/configs/*

3) Implement newsymbolsconfig (any better name?)
   Shall list all new symbols and shall not write
   any config

	Sam

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index fa1a7d5..3e560a4 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -47,30 +47,25 @@ update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
 	$(Q)rm -f arch/um/Kconfig.arch
 	$(Q)rm -f $(obj)/config.pot
 
-PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig
+aconf-targets := allnoconfig allyesconfig allmodconfig alldefconfig randconfig
+PHONY += $(aconf-targets) defconfig
 
-randconfig: $(obj)/conf
-	$< -r $(Kconfig)
+$(aconf-targets): $(src)/aconf.sh $(obj)/aconf
+	$(Q)$(CONFIG_SHELL) $< $@ $(Kconfig)
 
-allyesconfig: $(obj)/conf
-	$< -y $(Kconfig)
+%_defconfig: $(src)/aconf.sh $(obj)/aconf
+	$(Q)K=arch/$(SRCARCH)/configs/$@ \
+	$(CONFIG_SHELL) $< alldefconfig $(Kconfig)
 
-allnoconfig: $(obj)/conf
-	$< -n $(Kconfig)
-
-allmodconfig: $(obj)/conf
-	$< -m $(Kconfig)
-
-defconfig: $(obj)/conf
 ifeq ($(KBUILD_DEFCONFIG),)
+defconfig: $(obj)/conf
 	$< -d $(Kconfig)
 else
-	@echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
-	$(Q)$< -D arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
+defconfig: $(src)/aconf.sh $(obj)/aconf
+	$(Q)K=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) \
+	$(CONFIG_SHELL) $< alldefconfig $(Kconfig)
 endif
 
-%_defconfig: $(obj)/conf
-	$(Q)$< -D arch/$(SRCARCH)/configs/$@ $(Kconfig)
 
 # Help text used by make help
 help:
@@ -100,6 +95,7 @@ HOST_EXTRACFLAGS += -DLOCALE
 # ===========================================================================
 # Shared Makefile for the various kconfig executables:
 # conf:	  Used for defconfig, oldconfig and related targets
+# aconf:  Generate simple configurations (all*config, etc)
 # mconf:  Used for the mconfig target.
 #         Utilizes the lxdialog package
 # qconf:  Used for the xconfig target
@@ -112,10 +108,11 @@ lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o
 lxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o
 
 conf-objs	:= conf.o  zconf.tab.o
+aconf-objs	:= aconf.o zconf.tab.o
 mconf-objs	:= mconf.o zconf.tab.o $(lxdialog)
 kxgettext-objs	:= kxgettext.o zconf.tab.o
 
-hostprogs-y := conf qconf gconf kxgettext
+hostprogs-y := conf aconf qconf gconf kxgettext
 
 ifeq ($(MAKECMDGOALS),menuconfig)
 	hostprogs-y += mconf
diff --git a/scripts/kconfig/aconf.c b/scripts/kconfig/aconf.c
new file mode 100644
index 0000000..db3df0f
--- /dev/null
+++ b/scripts/kconfig/aconf.c
@@ -0,0 +1,316 @@
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Copyright (C) 2008 Sam Ravnborg <sam@ravnborg.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+/*
+ * Generate the automated configs
+ */
+
+#include <locale.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+#define LKC_DIRECT_LINK
+#include "lkc.h"
+
+static void check_conf(struct menu *menu);
+static void conf(struct menu *menu);
+
+enum {
+	set_unknown,
+	set_default,
+	set_yes,
+	set_mod,
+	set_no,
+	set_random
+} default_value = set_unknown;
+
+
+static int conf_cnt;
+static struct menu *rootEntry;
+
+/* Set strig value - it this a nop as it looks like? */
+static void conf_string(struct menu *menu)
+{
+	struct symbol *sym = menu->sym;
+	const char *def;
+
+
+	if (!sym_is_changable(sym))
+		return;
+
+	if (sym_has_value(sym) && (default_value != set_default))
+		return;
+
+	def = sym_get_string_value(sym);
+	if (def)
+		sym_set_string_value(sym, def);
+}
+
+static void conf_sym(struct menu *menu)
+{
+	struct symbol *sym = menu->sym;
+	int type;
+	tristate val;
+
+	if (!sym_is_changable(sym))
+		return;
+
+	if (sym_has_value(sym) && (default_value != set_default))
+		return;
+
+	type = sym_get_type(sym);
+	switch (default_value) {
+	case set_yes:
+		if (sym_tristate_within_range(sym, yes)) {
+			sym_set_tristate_value(sym, yes);
+			break;
+		}
+	/* fallthrough */
+	case set_mod:
+		if (type == S_TRISTATE) {
+			if (sym_tristate_within_range(sym, mod)) {
+				sym_set_tristate_value(sym, mod);
+				break;
+			}
+		} else if (sym_tristate_within_range(sym, yes)) {
+			sym_set_tristate_value(sym, yes);
+			break;
+		}
+	/* fallthrough */
+	case set_no:
+		if (sym_tristate_within_range(sym, no)) {
+			sym_set_tristate_value(sym, no);
+			break;
+		}
+	/* fallthrough */
+	case set_random:
+		 do {
+			val = (tristate)(rand() % 3);
+		} while (!sym_tristate_within_range(sym, val));
+		switch (val) {
+		case no:  sym_set_tristate_value(sym, no); break;
+		case mod: sym_set_tristate_value(sym, mod); break;
+		case yes: sym_set_tristate_value(sym, yes); break;
+		}
+		break;
+	case set_default:
+		sym_set_tristate_value(sym, sym_get_tristate_value(sym));
+		break;
+	/* silence gcc warning */
+	case set_unknown:
+		break;
+	}
+}
+
+static void conf_choice(struct menu *menu)
+{
+	struct symbol *sym, *def_sym;
+	struct menu *child;
+	int type;
+	bool is_new;
+	int cnt, def;
+
+	sym = menu->sym;
+	type = sym_get_type(sym);
+	is_new = !sym_has_value(sym);
+	if (sym_is_changable(sym)) {
+		conf_sym(menu);
+		sym_calc_value(sym);
+	}
+	if (sym_get_tristate_value(sym) != yes)
+		return;
+	def_sym = sym_get_choice_value(sym);
+	cnt = def = 0;
+	for (child = menu->list; child; child = child->next) {
+		if (!child->sym || !menu_is_visible(child))
+			continue;
+		cnt++;
+		if (child->sym == def_sym)
+			def = cnt;
+	}
+	if (cnt == 1)
+		goto conf_childs;
+
+	switch (default_value) {
+	case set_random:
+		if (is_new)
+			def = (rand() % cnt) + 1;
+	/* fallthrough */
+	case set_default:
+	case set_yes:
+	case set_mod:
+	case set_no:
+		cnt = def;
+		break;
+	/* silence gcc warning */
+	case set_unknown:
+		break;
+	}
+
+conf_childs:
+	for (child = menu->list; child; child = child->next) {
+		if (!child->sym || !menu_is_visible(child))
+			continue;
+		if (!--cnt)
+			break;
+	}
+	sym_set_choice_value(sym, child->sym);
+	for (child = child->list; child; child = child->next)
+		conf(child);
+}
+
+
+static void conf(struct menu *menu)
+{
+	struct symbol *sym;
+	struct property *prop;
+	struct menu *child;
+
+	if (!menu_is_visible(menu))
+		return;
+
+	sym = menu->sym;
+	prop = menu->prompt;
+	if (prop && prop->type == P_MENU) {
+		if (menu != rootEntry) {
+			check_conf(menu);
+			return;
+		}
+	}
+
+	if (!sym)
+		goto conf_childs;
+
+	if (sym_is_choice(sym)) {
+		conf_choice(menu);
+		if (sym->curr.tri != mod)
+			return;
+		goto conf_childs;
+	}
+
+	switch (sym->type) {
+	case S_INT:
+	case S_HEX:
+	case S_STRING:
+		conf_string(menu);
+		break;
+	default:
+		conf_sym(menu);
+		break;
+	}
+
+conf_childs:
+	for (child = menu->list; child; child = child->next)
+		conf(child);
+}
+
+static void check_conf(struct menu *menu)
+{
+	struct symbol *sym;
+	struct menu *child;
+
+	if (!menu_is_visible(menu))
+		return;
+
+	sym = menu->sym;
+	if (sym && !sym_has_value(sym)) {
+		if (sym_is_changable(sym) ||
+		    (sym_is_choice(sym) &&
+		     sym_get_tristate_value(sym) == yes)) {
+			conf_cnt++;
+			rootEntry = menu_get_parent_menu(menu);
+			conf(rootEntry);
+		}
+	}
+
+	for (child = menu->list; child; child = child->next)
+		check_conf(child);
+}
+
+int main(int ac, char **av)
+{
+	int opt;
+	char *config_file = NULL;
+	struct stat tmpstat;
+
+	setlocale(LC_ALL, "");
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
+	while ((opt = getopt(ac, av, "dnmyrhi:")) != -1) {
+		switch (opt) {
+		case 'd':
+			default_value = set_default;
+			break;
+		case 'n':
+			default_value = set_no;
+			break;
+		case 'm':
+			default_value = set_mod;
+			break;
+		case 'y':
+			default_value = set_yes;
+			break;
+		case 'r':
+			default_value = set_random;
+			srand(time(NULL));
+			break;
+		case 'i':
+			config_file = optarg;
+			break;
+		case 'h':
+			printf(_("See README for usage info\n"));
+			exit(0);
+			break;
+		default:
+			fprintf(stderr, _("See README for usage info\n"));
+			exit(1);
+		}
+	}
+	if (ac == optind) {
+		fprintf(stderr, _("%s: Kconfig file missing\n"), av[0]);
+		exit(1);
+	}
+	if (default_value == set_unknown) {
+		fprintf(stderr,
+		        _("%s: default value missing. "
+		        "You must use one of: -{d,n,m,y,r}\n"), av[0]);
+		exit(1);
+	}
+	conf_parse(av[optind]);
+	/* debug: zconfdump(stdout); */
+	if (config_file && stat(config_file, &tmpstat)) {
+		fprintf(stderr, _("%s: failed to open %s\n"),
+		        av[0], config_file);
+		exit(1);
+	}
+	if (config_file && conf_read_simple(config_file, S_DEF_USER)) {
+		fprintf(stderr, _("%s: failed to read %s\n"),
+		        av[0], config_file);
+		exit(1);
+	}
+	if (config_file) {
+		printf(_("# configuration is based on '%s'\n"), config_file);
+	}
+	/* generate the config */
+	do {
+		conf_cnt = 0;
+		check_conf(&rootmenu);
+	} while (conf_cnt);
+	/* write out the config */
+	if (conf_write(NULL) || conf_write_autoconf()) {
+		fprintf(stderr,
+		        _("%s: error during write of the configuration.\n"),
+		        av[0]);
+		exit(1);
+	}
+	return 0;
+}
diff --git a/scripts/kconfig/aconf.sh b/scripts/kconfig/aconf.sh
new file mode 100755
index 0000000..c46a868
--- /dev/null
+++ b/scripts/kconfig/aconf.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+set -e
+aconf=scripts/kconfig/aconf
+# Find input file
+if [ ! -z $K ]; then
+	config_file="-i $K";
+fi
+
+case "$1" in
+	"allnoconfig")
+		$aconf -n $config_file $2
+		;;
+	"allyesconfig")
+		$aconf -y $config_file $2
+		;;
+	"allmodconfig")
+		$aconf -m $config_file $2
+		;;
+	"alldefconfig")
+		$aconf -d $config_file $2
+		;;
+	"randconfig")
+		$aconf -r $config_file $2
+		;;
+	*)
+		echo "$0: unknow command $1"
+		exit 1
+	;;
+esac
+

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-05-01  4:40 ` Roman Zippel
  2008-05-01  6:12   ` Sam Ravnborg
@ 2008-05-03 21:49   ` Sam Ravnborg
  1 sibling, 0 replies; 22+ messages in thread
From: Sam Ravnborg @ 2008-05-03 21:49 UTC (permalink / raw)
  To: Roman Zippel
  Cc: linux-kbuild, LKML, Dave Jones, Roland McGrath, Andres Salomon

Hi Roman.

> The patch I've seen for the last point put it into conf.c, which is the wrong 
> place for it. For this sort of thing we should create a small query tool, 
> which then can export all sorts of information.
> If we silence the defconfig output (which IMO is a good thing, as I don't 
> think anyone looked at the output seriously for a long time and the current 
> behaviour has purely historical reasons), it would also open up the 
> possibility to separate it from conf.c.

aconf is now ready to take care of defconfig, randconfig and all*config.
That leaves us with two simple tasks for conf.c:
config and oldconfig

[silentoldconfig is gone as oldconfig is 'silent' now].

aconf can take a base config for all the targets and avoids being
clever where to locate it. (Read: does not use DEFCONFIG_LIST).

I dunno if this is what you had in mind but I certainly like the result.
A cleaned up set of patches will soon hit the kbuild list.

> This also fits into an idea I'm playing with to extend the .config format like 
> this:
> 
> %defaultmode: mod
> CONFIG_FOO=n
> 
I understand the solution that you describe but I fail to see the
usefulness of it.
Can I request you to elaborate a bit more how you see it used.
I can give it a shot if I see it solving a real issue.

> Basically this could replace "make allmodconfig KCONFIG_ALLCONFIG=..." and the 
> current way to produce an allmodconfig would be replaced by a dedicated 
> function.
This part I did not understand either. I am aware of the current behaviour
but do not get the "dedicated function" thing.

Thanks in advance,

	Sam

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-05-02 19:09 ` Sam Ravnborg
@ 2008-05-21 20:47   ` Andres Salomon
  2008-05-21 21:11     ` Dave Jones
  2008-05-21 21:47     ` Sam Ravnborg
  0 siblings, 2 replies; 22+ messages in thread
From: Andres Salomon @ 2008-05-21 20:47 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kbuild, LKML, Dave Jones, Roland McGrath, Roman Zippel

On Fri, 2 May 2008 21:09:49 +0200
Sam Ravnborg <sam@ravnborg.org> wrote:

> With the attached patch you can do:
> 
> make K=my_favourite_config defconfig
> 
> kconfig will read all config values form 'my_favourite_config'
> and set all other symbols to their default value.
> The output is now dense like this:
> # configuration is based on 'my_favourite_config'
> #
> # configuration written to .config
> #
> 


Is this slated for 2.6.27?


> 
> The K= notations works for the usual suspects:
> allnoconfig, allyesconfig, allmodconfig, randconfig and defconfig

Since this is aconf (automated), if we run 'make K=foo defconfig' and
'foo' doesn't contain one of the necessary values.. the build will fail,
right?

[...]
> 
> What is missing:
> 1) No support for .gz input file
>    But aconf.sh should be easy to adjust to this
> 
> 2) We hardcode that files name *_defconfig are found
>    in arch/$ARCH/configs/*
> 
> 3) Implement newsymbolsconfig (any better name?)
>    Shall list all new symbols and shall not write
>    any config
> 

I'm not sure I see the point of #3.

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-05-21 20:47   ` Andres Salomon
@ 2008-05-21 21:11     ` Dave Jones
  2008-05-21 21:38       ` Andres Salomon
  2008-05-22 19:06       ` Alexey Dobriyan
  2008-05-21 21:47     ` Sam Ravnborg
  1 sibling, 2 replies; 22+ messages in thread
From: Dave Jones @ 2008-05-21 21:11 UTC (permalink / raw)
  To: Andres Salomon
  Cc: Sam Ravnborg, linux-kbuild, LKML, Roland McGrath, Roman Zippel

On Wed, May 21, 2008 at 04:47:03PM -0400, Andres Salomon wrote:

 > > 3) Implement newsymbolsconfig (any better name?)
 > >    Shall list all new symbols and shall not write
 > >    any config
 > 
 > I'm not sure I see the point of #3.

It's something we've had in Fedora kernels forever, because
when rebasing to a new upstream version the process becomes

make newsymbolsconfig
take list of symbols, and make decisions on them
make oldconfig


without it, the process would be..

make oldconfig
note new symbol, make decision
make oldconfig
note a 2nd new symbol, make decision
make oldconfig
note a 3rd new symbol..
make oldconfig..
you get the idea.

The way we have it isn't perfect, (adding a new symbol may unhide
another set of new symbols), but it reduces the number of iterations
needed dramatically.

	Dave

-- 
http://www.codemonkey.org.uk

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-05-21 21:11     ` Dave Jones
@ 2008-05-21 21:38       ` Andres Salomon
  2008-05-22 19:06       ` Alexey Dobriyan
  1 sibling, 0 replies; 22+ messages in thread
From: Andres Salomon @ 2008-05-21 21:38 UTC (permalink / raw)
  To: Dave Jones; +Cc: Sam Ravnborg, linux-kbuild, LKML, Roland McGrath, Roman Zippel

On Wed, 21 May 2008 17:11:39 -0400
Dave Jones <davej@codemonkey.org.uk> wrote:

> On Wed, May 21, 2008 at 04:47:03PM -0400, Andres Salomon wrote:
> 
>  > > 3) Implement newsymbolsconfig (any better name?)
>  > >    Shall list all new symbols and shall not write
>  > >    any config
>  > 
>  > I'm not sure I see the point of #3.
> 
> It's something we've had in Fedora kernels forever, because
> when rebasing to a new upstream version the process becomes
> 
> make newsymbolsconfig
> take list of symbols, and make decisions on them
> make oldconfig
> 
>

Ah, I see.  My process has always been:


cp arch/x86/configs/foo_defconfig .config
make oldconfig
make obvious decisions about new symbols, choose defaults if unknown
diff -u arch/x86/configs/foo_defconfig .config
figure out if any decisions or defaults are incorrect, change accordingly
make oldconfig (more decisions if there are new symbols exposed)
cp .config arch/x86/configs/foo_defconfig && commit


> without it, the process would be..
> 
> make oldconfig
> note new symbol, make decision
> make oldconfig
> note a 2nd new symbol, make decision
> make oldconfig
> note a 3rd new symbol..
> make oldconfig..
> you get the idea.
> 
> The way we have it isn't perfect, (adding a new symbol may unhide
> another set of new symbols), but it reduces the number of iterations
> needed dramatically.
> 
> 	Dave
> 

My build has broken again, which is why I'm inquiring about the status
of this; I'm not going to bother fixing it if my patches are never going
to end up upstream..


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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-05-21 20:47   ` Andres Salomon
  2008-05-21 21:11     ` Dave Jones
@ 2008-05-21 21:47     ` Sam Ravnborg
  2008-06-13 18:10       ` Andres Salomon
  1 sibling, 1 reply; 22+ messages in thread
From: Sam Ravnborg @ 2008-05-21 21:47 UTC (permalink / raw)
  To: Andres Salomon
  Cc: linux-kbuild, LKML, Dave Jones, Roland McGrath, Roman Zippel

On Wed, May 21, 2008 at 04:47:03PM -0400, Andres Salomon wrote:
> On Fri, 2 May 2008 21:09:49 +0200
> Sam Ravnborg <sam@ravnborg.org> wrote:
> 
> > With the attached patch you can do:
> > 
> > make K=my_favourite_config defconfig
> > 
> > kconfig will read all config values form 'my_favourite_config'
> > and set all other symbols to their default value.
> > The output is now dense like this:
> > # configuration is based on 'my_favourite_config'
> > #
> > # configuration written to .config
> > #
> > 
> 
> 
> Is this slated for 2.6.27?

Been busy and got sidetracked after my first version proved broken.
Will try to look at it in the weekend.

	Sam

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-05-21 21:11     ` Dave Jones
  2008-05-21 21:38       ` Andres Salomon
@ 2008-05-22 19:06       ` Alexey Dobriyan
  1 sibling, 0 replies; 22+ messages in thread
From: Alexey Dobriyan @ 2008-05-22 19:06 UTC (permalink / raw)
  To: Dave Jones, Andres Salomon, Sam Ravnborg, linux-kbuild, LKML,
	Roland McGrath, Roman Zippel

On Wed, May 21, 2008 at 05:11:39PM -0400, Dave Jones wrote:
> On Wed, May 21, 2008 at 04:47:03PM -0400, Andres Salomon wrote:
> 
>  > > 3) Implement newsymbolsconfig (any better name?)
>  > >    Shall list all new symbols and shall not write
>  > >    any config
>  > 
>  > I'm not sure I see the point of #3.
> 
> It's something we've had in Fedora kernels forever, because
> when rebasing to a new upstream version the process becomes
> 
> make newsymbolsconfig
> take list of symbols, and make decisions on them
> make oldconfig
> 
> 
> without it, the process would be..
> 
> make oldconfig
> note new symbol, make decision
> make oldconfig
> note a 2nd new symbol, make decision
> make oldconfig
> note a 3rd new symbol..
> make oldconfig..
> you get the idea.

It's actually

	make oldconfig
	[note new symbol, make decision]
	[note new symbol, make decision]
	[note new symbol, make decision]
	make

so the number of decisions and invocations are the same.

> The way we have it isn't perfect, (adding a new symbol may unhide
> another set of new symbols), but it reduces the number of iterations
> needed dramatically.


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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-05-21 21:47     ` Sam Ravnborg
@ 2008-06-13 18:10       ` Andres Salomon
  2008-06-13 18:14         ` Sam Ravnborg
  0 siblings, 1 reply; 22+ messages in thread
From: Andres Salomon @ 2008-06-13 18:10 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kbuild, LKML, Dave Jones, Roland McGrath, Roman Zippel

On Wed, 21 May 2008 23:47:23 +0200
Sam Ravnborg <sam@ravnborg.org> wrote:

> On Wed, May 21, 2008 at 04:47:03PM -0400, Andres Salomon wrote:
> > On Fri, 2 May 2008 21:09:49 +0200
> > Sam Ravnborg <sam@ravnborg.org> wrote:
> > 
> > > With the attached patch you can do:
> > > 
> > > make K=my_favourite_config defconfig
> > > 
> > > kconfig will read all config values form 'my_favourite_config'
> > > and set all other symbols to their default value.
> > > The output is now dense like this:
> > > # configuration is based on 'my_favourite_config'
> > > #
> > > # configuration written to .config
> > > #
> > > 
> > 
> > 
> > Is this slated for 2.6.27?
> 
> Been busy and got sidetracked after my first version proved broken.
> Will try to look at it in the weekend.
> 
> 	Sam


Any updates on this?  I've been forced to use a workaround in the
meantime..

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

* Re: Additional kconfig targets (cloneconfig, nonint_oldconfig etc)
  2008-06-13 18:10       ` Andres Salomon
@ 2008-06-13 18:14         ` Sam Ravnborg
  0 siblings, 0 replies; 22+ messages in thread
From: Sam Ravnborg @ 2008-06-13 18:14 UTC (permalink / raw)
  To: Andres Salomon
  Cc: linux-kbuild, LKML, Dave Jones, Roland McGrath, Roman Zippel

On Fri, Jun 13, 2008 at 02:10:49PM -0400, Andres Salomon wrote:
> On Wed, 21 May 2008 23:47:23 +0200
> Sam Ravnborg <sam@ravnborg.org> wrote:
> 
> > On Wed, May 21, 2008 at 04:47:03PM -0400, Andres Salomon wrote:
> > > On Fri, 2 May 2008 21:09:49 +0200
> > > Sam Ravnborg <sam@ravnborg.org> wrote:
> > > 
> > > > With the attached patch you can do:
> > > > 
> > > > make K=my_favourite_config defconfig
> > > > 
> > > > kconfig will read all config values form 'my_favourite_config'
> > > > and set all other symbols to their default value.
> > > > The output is now dense like this:
> > > > # configuration is based on 'my_favourite_config'
> > > > #
> > > > # configuration written to .config
> > > > #
> > > > 
> > > 
> > > 
> > > Is this slated for 2.6.27?
> > 
> > Been busy and got sidetracked after my first version proved broken.
> > Will try to look at it in the weekend.
> > 
> > 	Sam
> 
> 
> Any updates on this?  I've been forced to use a workaround in the
> meantime..
Nope. I have been busy with other stuff and need to close this first.
Pending stuff before this:

-> Simplify link of vmlinux (about to be dropped for now as I cannot solve um issue)
-> Kill need for ALTARCH in sparc (almost finished)
-> Optimize make headers_* (almost finished)

And a few more things that I cannot remember atm

	Sam

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

end of thread, other threads:[~2008-06-13 18:14 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-29 18:35 Additional kconfig targets (cloneconfig, nonint_oldconfig etc) Sam Ravnborg
2008-04-29 21:24 ` Andres Salomon
2008-04-30  6:35   ` Sam Ravnborg
2008-04-30 14:43     ` Jan Engelhardt
2008-04-30 10:45   ` SL Baur
2008-04-30 15:01     ` Randy Dunlap
2008-04-30 20:32       ` SL Baur
2008-04-30 20:35         ` Roland McGrath
2008-04-30 20:37         ` Sam Ravnborg
2008-04-30 14:44 ` Jan Engelhardt
2008-05-02 10:56   ` Sam Ravnborg
2008-05-01  4:40 ` Roman Zippel
2008-05-01  6:12   ` Sam Ravnborg
2008-05-03 21:49   ` Sam Ravnborg
2008-05-02 19:09 ` Sam Ravnborg
2008-05-21 20:47   ` Andres Salomon
2008-05-21 21:11     ` Dave Jones
2008-05-21 21:38       ` Andres Salomon
2008-05-22 19:06       ` Alexey Dobriyan
2008-05-21 21:47     ` Sam Ravnborg
2008-06-13 18:10       ` Andres Salomon
2008-06-13 18:14         ` Sam Ravnborg

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