Patchwork kernel: use oldnoconfig instead of yes '' | make oldconfig

login
register
mail settings
Submitter Alexandre Belloni
Date Jan. 7, 2014, 2:18 p.m.
Message ID <1389104317-11042-1-git-send-email-alexandre.belloni@free-electrons.com>
Download mbox | patch
Permalink /patch/64299/
State New
Headers show

Comments

Alexandre Belloni - Jan. 7, 2014, 2:18 p.m.
When using a defconfig, using yes '' | make oldconfig may not result in
the correct configuration being set. For example:

 $ grep USB_ETH .config
 CONFIG_USB_ETH=y
 CONFIG_USB_ETH_RNDIS=y
 CONFIG_USB_ETH_EEM=y
 $ make savedefconfig
 scripts/kconfig/conf --savedefconfig=defconfig Kconfig
 $ cp defconfig .config
 ‘defconfig’ -> ‘.config’
 $ yes '' | make oldconfig
 [...]
 #
 # configuration written to .config
 #
 $ grep USB_ETH .config
 CONFIG_USB_ETH=m
 CONFIG_USB_ETH_RNDIS=y
 CONFIG_USB_ETH_EEM=y

Using make olddefconfig solves that but we'll use oldnoconfig for
backward compatibility with older kernels.

 $ cp defconfig .config
 ‘defconfig’ -> ‘.config’
 $ make oldnoconfig
 scripts/kconfig/conf --olddefconfig Kconfig
 #
 # configuration written to .config
 #
 $ grep USB_ETH .config
 CONFIG_USB_ETH=y
 CONFIG_USB_ETH_RNDIS=y
 CONFIG_USB_ETH_EEM=y

For more information, please refer to:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=fbe98bb9ed3dae23e320c6b113e35f129538d14a

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 meta/classes/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Martin Jansa - Jan. 7, 2014, 2:35 p.m.
On Tue, Jan 07, 2014 at 03:18:37PM +0100, Alexandre Belloni wrote:
> When using a defconfig, using yes '' | make oldconfig may not result in
> the correct configuration being set. For example:

>  $ grep USB_ETH .config
>  CONFIG_USB_ETH=y
>  CONFIG_USB_ETH_RNDIS=y
>  CONFIG_USB_ETH_EEM=y
>  $ make savedefconfig
>  scripts/kconfig/conf --savedefconfig=defconfig Kconfig
>  $ cp defconfig .config
>  ‘defconfig’ -> ‘.config’
>  $ yes '' | make oldconfig
>  [...]
>  #
>  # configuration written to .config
>  #
>  $ grep USB_ETH .config
>  CONFIG_USB_ETH=m
>  CONFIG_USB_ETH_RNDIS=y
>  CONFIG_USB_ETH_EEM=y
> 
> Using make olddefconfig solves that but we'll use oldnoconfig for
> backward compatibility with older kernels.

Looks good, I have few kernel recipes where I had to fixup resulting
.config after "make savedefconfig", "yes '' | make oldconfig" combo
exactly because of some =y changing to -m.

1) Do you know since when oldnoconfig is supported?

IIRC oldest kernel I've in BSPs is 2.6.24. 

2) Could you send similar patch for
meta-openembedded/meta-oe/recipes-kernel/linux/linux.inc
?

>  $ cp defconfig .config
>  ‘defconfig’ -> ‘.config’
>  $ make oldnoconfig
>  scripts/kconfig/conf --olddefconfig Kconfig
>  #
>  # configuration written to .config
>  #
>  $ grep USB_ETH .config
>  CONFIG_USB_ETH=y
>  CONFIG_USB_ETH_RNDIS=y
>  CONFIG_USB_ETH_EEM=y
> 
> For more information, please refer to:
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=fbe98bb9ed3dae23e320c6b113e35f129538d14a
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  meta/classes/kernel.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 61a6d102d7a8..644d7937923d 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -313,7 +313,7 @@ kernel_do_configure() {
>  	if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then
>  		cp "${WORKDIR}/defconfig" "${B}/.config"
>  	fi
> -	yes '' | oe_runmake oldconfig
> +	oe_runmake oldnoconfig
>  }
>  
>  do_savedefconfig() {
> -- 
> 1.8.3.2
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Alexandre Belloni - Jan. 7, 2014, 3:20 p.m.
On 07/01/2014 15:35, Martin Jansa wrote:
> On Tue, Jan 07, 2014 at 03:18:37PM +0100, Alexandre Belloni wrote:
>> When using a defconfig, using yes '' | make oldconfig may not result in
>> the correct configuration being set. For example:
> 
>>  $ grep USB_ETH .config
>>  CONFIG_USB_ETH=y
>>  CONFIG_USB_ETH_RNDIS=y
>>  CONFIG_USB_ETH_EEM=y
>>  $ make savedefconfig
>>  scripts/kconfig/conf --savedefconfig=defconfig Kconfig
>>  $ cp defconfig .config
>>  ‘defconfig’ -> ‘.config’
>>  $ yes '' | make oldconfig
>>  [...]
>>  #
>>  # configuration written to .config
>>  #
>>  $ grep USB_ETH .config
>>  CONFIG_USB_ETH=m
>>  CONFIG_USB_ETH_RNDIS=y
>>  CONFIG_USB_ETH_EEM=y
>>
>> Using make olddefconfig solves that but we'll use oldnoconfig for
>> backward compatibility with older kernels.
> 
> Looks good, I have few kernel recipes where I had to fixup resulting
> .config after "make savedefconfig", "yes '' | make oldconfig" combo
> exactly because of some =y changing to -m.
> 
> 1) Do you know since when oldnoconfig is supported?
> 
> IIRC oldest kernel I've in BSPs is 2.6.24. 

oldnoconfig seems to be present since 2.6.36. olddefconfig is an alias
that appeared with fb16d8912db5268f29706010ecafff74b971c58d which is
present since v3.7.

Then hat about using:

oe_runmake oldnoconfig || yes '' | oe_runmake oldconfig

> 
> 2) Could you send similar patch for
> meta-openembedded/meta-oe/recipes-kernel/linux/linux.inc
> ?
> 

Sure, will do once we agreed on this patch
Bruce Ashfield - Jan. 7, 2014, 3:32 p.m.
On 14-01-07 09:18 AM, Alexandre Belloni wrote:
> When using a defconfig, using yes '' | make oldconfig may not result in
> the correct configuration being set. For example:
>
>   $ grep USB_ETH .config
>   CONFIG_USB_ETH=y
>   CONFIG_USB_ETH_RNDIS=y
>   CONFIG_USB_ETH_EEM=y
>   $ make savedefconfig
>   scripts/kconfig/conf --savedefconfig=defconfig Kconfig
>   $ cp defconfig .config
>   ‘defconfig’ -> ‘.config’
>   $ yes '' | make oldconfig
>   [...]
>   #
>   # configuration written to .config
>   #
>   $ grep USB_ETH .config
>   CONFIG_USB_ETH=m
>   CONFIG_USB_ETH_RNDIS=y
>   CONFIG_USB_ETH_EEM=y
>
> Using make olddefconfig solves that but we'll use oldnoconfig for
> backward compatibility with older kernels.
>
>   $ cp defconfig .config
>   ‘defconfig’ -> ‘.config’
>   $ make oldnoconfig
>   scripts/kconfig/conf --olddefconfig Kconfig
>   #
>   # configuration written to .config
>   #
>   $ grep USB_ETH .config
>   CONFIG_USB_ETH=y
>   CONFIG_USB_ETH_RNDIS=y
>   CONFIG_USB_ETH_EEM=y
>
> For more information, please refer to:
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=fbe98bb9ed3dae23e320c6b113e35f129538d14a

It was my understanding that this commit changed the Kconfig behaviour
to set the selected options to =y and prevent the menu choice from
"hiding" the options in a depedent choice menu. But maybe I'm remembering
wrong.

The point being, that with that commit in place. Doesn't the behaviour
match what we want with yes and oldconfig ?

.. I'll run some tests to confirm for myself, but I thought I'd throw
the question out as well. I don't typically use defconfigs, so I need
to do a bit of leg work.

I don't have any big issues with the patch, but I just want to be sure,
since changing this default could change the configs of many defconfig
users, and they may have been unknowingly relying on the old behaviour.

Bruce

>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>   meta/classes/kernel.bbclass | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 61a6d102d7a8..644d7937923d 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -313,7 +313,7 @@ kernel_do_configure() {
>   	if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then
>   		cp "${WORKDIR}/defconfig" "${B}/.config"
>   	fi
> -	yes '' | oe_runmake oldconfig
> +	oe_runmake oldnoconfig
>   }
>
>   do_savedefconfig() {
>
Martin Jansa - Jan. 7, 2014, 3:54 p.m.
On Tue, Jan 07, 2014 at 04:20:37PM +0100, Alexandre Belloni wrote:
> On 07/01/2014 15:35, Martin Jansa wrote:
> > On Tue, Jan 07, 2014 at 03:18:37PM +0100, Alexandre Belloni wrote:
> >> When using a defconfig, using yes '' | make oldconfig may not result in
> >> the correct configuration being set. For example:
> > 
> >>  $ grep USB_ETH .config
> >>  CONFIG_USB_ETH=y
> >>  CONFIG_USB_ETH_RNDIS=y
> >>  CONFIG_USB_ETH_EEM=y
> >>  $ make savedefconfig
> >>  scripts/kconfig/conf --savedefconfig=defconfig Kconfig
> >>  $ cp defconfig .config
> >>  ‘defconfig’ -> ‘.config’
> >>  $ yes '' | make oldconfig
> >>  [...]
> >>  #
> >>  # configuration written to .config
> >>  #
> >>  $ grep USB_ETH .config
> >>  CONFIG_USB_ETH=m
> >>  CONFIG_USB_ETH_RNDIS=y
> >>  CONFIG_USB_ETH_EEM=y
> >>
> >> Using make olddefconfig solves that but we'll use oldnoconfig for
> >> backward compatibility with older kernels.
> > 
> > Looks good, I have few kernel recipes where I had to fixup resulting
> > .config after "make savedefconfig", "yes '' | make oldconfig" combo
> > exactly because of some =y changing to -m.
> > 
> > 1) Do you know since when oldnoconfig is supported?
> > 
> > IIRC oldest kernel I've in BSPs is 2.6.24. 
> 
> oldnoconfig seems to be present since 2.6.36. olddefconfig is an alias
> that appeared with fb16d8912db5268f29706010ecafff74b971c58d which is
> present since v3.7.
> 
> Then hat about using:
> 
> oe_runmake oldnoconfig || yes '' | oe_runmake oldconfig

Looks safer (assuming that oldnoconfig will return error only in cases
where oldnoconfig target doesn't exist in Makefile, otherwise fall-back
to yes '' could be a bit confusing).

In worst case you can add KERNEL_VERSION check or show bb.warn when
oldnoconfig isn't supported.

> > 2) Could you send similar patch for
> > meta-openembedded/meta-oe/recipes-kernel/linux/linux.inc
> > ?
> > 
> 
> Sure, will do once we agreed on this patch

Thanks
Darren Hart - Jan. 7, 2014, 6:11 p.m.
On Tue, 2014-01-07 at 16:54 +0100, Martin Jansa wrote:
> On Tue, Jan 07, 2014 at 04:20:37PM +0100, Alexandre Belloni wrote:
> > On 07/01/2014 15:35, Martin Jansa wrote:
> > > On Tue, Jan 07, 2014 at 03:18:37PM +0100, Alexandre Belloni wrote:
> > >> When using a defconfig, using yes '' | make oldconfig may not result in
> > >> the correct configuration being set. For example:
> > > 
> > >>  $ grep USB_ETH .config
> > >>  CONFIG_USB_ETH=y
> > >>  CONFIG_USB_ETH_RNDIS=y
> > >>  CONFIG_USB_ETH_EEM=y
> > >>  $ make savedefconfig
> > >>  scripts/kconfig/conf --savedefconfig=defconfig Kconfig
> > >>  $ cp defconfig .config
> > >>  ‘defconfig’ -> ‘.config’
> > >>  $ yes '' | make oldconfig
> > >>  [...]
> > >>  #
> > >>  # configuration written to .config
> > >>  #
> > >>  $ grep USB_ETH .config
> > >>  CONFIG_USB_ETH=m
> > >>  CONFIG_USB_ETH_RNDIS=y
> > >>  CONFIG_USB_ETH_EEM=y
> > >>
> > >> Using make olddefconfig solves that but we'll use oldnoconfig for
> > >> backward compatibility with older kernels.
> > > 
> > > Looks good, I have few kernel recipes where I had to fixup resulting
> > > .config after "make savedefconfig", "yes '' | make oldconfig" combo
> > > exactly because of some =y changing to -m.
> > > 
> > > 1) Do you know since when oldnoconfig is supported?
> > > 
> > > IIRC oldest kernel I've in BSPs is 2.6.24. 
> > 
> > oldnoconfig seems to be present since 2.6.36. olddefconfig is an alias
> > that appeared with fb16d8912db5268f29706010ecafff74b971c58d which is
> > present since v3.7.
> > 
> > Then hat about using:
> > 
> > oe_runmake oldnoconfig || yes '' | oe_runmake oldconfig
> 
> Looks safer (assuming that oldnoconfig will return error only in cases
> where oldnoconfig target doesn't exist in Makefile, otherwise fall-back
> to yes '' could be a bit confusing).
> 
> In worst case you can add KERNEL_VERSION check or show bb.warn when
> oldnoconfig isn't supported.

Please check for the functionality, not KERNEL_VERSION. The
KERNEL_VERSION doesn't allow for backports and such which might add this
ability. Grep the Makefile for the target, for example, if the above OR
statement isn't adequate.

As Bruce stated, it seems that the fix would be to use the updated
Kconfig, not default to setting things to NO. The problem with that
approach is it doesn't accept defaults for non-specified options (which
when updating kernel versions, is often the preferred approach).
Alexandre Belloni - Jan. 7, 2014, 8:27 p.m.
On 07/01/2014 16:32, Bruce Ashfield wrote:
> On 14-01-07 09:18 AM, Alexandre Belloni wrote:
>> When using a defconfig, using yes '' | make oldconfig may not result in
>> the correct configuration being set. For example:
>>
>>   $ grep USB_ETH .config
>>   CONFIG_USB_ETH=y
>>   CONFIG_USB_ETH_RNDIS=y
>>   CONFIG_USB_ETH_EEM=y
>>   $ make savedefconfig
>>   scripts/kconfig/conf --savedefconfig=defconfig Kconfig
>>   $ cp defconfig .config
>>   ‘defconfig’ -> ‘.config’
>>   $ yes '' | make oldconfig
>>   [...]
>>   #
>>   # configuration written to .config
>>   #
>>   $ grep USB_ETH .config
>>   CONFIG_USB_ETH=m
>>   CONFIG_USB_ETH_RNDIS=y
>>   CONFIG_USB_ETH_EEM=y
>>
>> Using make olddefconfig solves that but we'll use oldnoconfig for
>> backward compatibility with older kernels.
>>
>>   $ cp defconfig .config
>>   ‘defconfig’ -> ‘.config’
>>   $ make oldnoconfig
>>   scripts/kconfig/conf --olddefconfig Kconfig
>>   #
>>   # configuration written to .config
>>   #
>>   $ grep USB_ETH .config
>>   CONFIG_USB_ETH=y
>>   CONFIG_USB_ETH_RNDIS=y
>>   CONFIG_USB_ETH_EEM=y
>>
>> For more information, please refer to:
>> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=fbe98bb9ed3dae23e320c6b113e35f129538d14a
>>
> 
> It was my understanding that this commit changed the Kconfig behaviour
> to set the selected options to =y and prevent the menu choice from
> "hiding" the options in a depedent choice menu. But maybe I'm remembering
> wrong.
> 
> The point being, that with that commit in place. Doesn't the behaviour
> match what we want with yes and oldconfig ?
> 

Nope, that commit is fixing the issue when using make <target>_defconfig
or make olddefconfig. Note that using make menuconfig already had the
correct behavior before that commit.

As shown in my commit log, using yes '' | make oldconfig is still
getting it wrong.

> .. I'll run some tests to confirm for myself, but I thought I'd throw
> the question out as well. I don't typically use defconfigs, so I need
> to do a bit of leg work.
> 

Yeah, using a full .config doesn't trigger that behavior.

> I don't have any big issues with the patch, but I just want to be sure,
> since changing this default could change the configs of many defconfig
> users, and they may have been unknowingly relying on the old behaviour.
> 

I can understand that. But I don't see any other way to make the really
expected behavior to work without risking breaking anything.
Alexandre Belloni - Jan. 7, 2014, 8:32 p.m.
On 07/01/2014 19:11, Hart, Darren wrote:
> 
> Please check for the functionality, not KERNEL_VERSION. The
> KERNEL_VERSION doesn't allow for backports and such which might add this
> ability. Grep the Makefile for the target, for example, if the above OR
> statement isn't adequate.
> 

I guess the OR is perfectly fine then. For whatever reason make
oldnoconfig fails, we'll fall back to the old behavior.

> As Bruce stated, it seems that the fix would be to use the updated
> Kconfig, not default to setting things to NO. The problem with that
> approach is it doesn't accept defaults for non-specified options (which
> when updating kernel versions, is often the preferred approach).
> 

I think you got it wrong:
 - I am already using an updated kconfig (I even backported it on the
older kernel version)
 - make oldnoconfig is NOT setting things to NO but to the default value
of the unspecified options (exactly what we need). The choice of the
name was not wise and It has been renamed olddefconfig since 3.7
Bruce Ashfield - Jan. 7, 2014, 8:39 p.m.
On 14-01-07 03:27 PM, Alexandre Belloni wrote:
> On 07/01/2014 16:32, Bruce Ashfield wrote:
>> On 14-01-07 09:18 AM, Alexandre Belloni wrote:
>>> When using a defconfig, using yes '' | make oldconfig may not result in
>>> the correct configuration being set. For example:
>>>
>>>    $ grep USB_ETH .config
>>>    CONFIG_USB_ETH=y
>>>    CONFIG_USB_ETH_RNDIS=y
>>>    CONFIG_USB_ETH_EEM=y
>>>    $ make savedefconfig
>>>    scripts/kconfig/conf --savedefconfig=defconfig Kconfig
>>>    $ cp defconfig .config
>>>    ‘defconfig’ -> ‘.config’
>>>    $ yes '' | make oldconfig
>>>    [...]
>>>    #
>>>    # configuration written to .config
>>>    #
>>>    $ grep USB_ETH .config
>>>    CONFIG_USB_ETH=m
>>>    CONFIG_USB_ETH_RNDIS=y
>>>    CONFIG_USB_ETH_EEM=y
>>>
>>> Using make olddefconfig solves that but we'll use oldnoconfig for
>>> backward compatibility with older kernels.
>>>
>>>    $ cp defconfig .config
>>>    ‘defconfig’ -> ‘.config’
>>>    $ make oldnoconfig
>>>    scripts/kconfig/conf --olddefconfig Kconfig
>>>    #
>>>    # configuration written to .config
>>>    #
>>>    $ grep USB_ETH .config
>>>    CONFIG_USB_ETH=y
>>>    CONFIG_USB_ETH_RNDIS=y
>>>    CONFIG_USB_ETH_EEM=y
>>>
>>> For more information, please refer to:
>>> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=fbe98bb9ed3dae23e320c6b113e35f129538d14a
>>>
>>
>> It was my understanding that this commit changed the Kconfig behaviour
>> to set the selected options to =y and prevent the menu choice from
>> "hiding" the options in a depedent choice menu. But maybe I'm remembering
>> wrong.
>>
>> The point being, that with that commit in place. Doesn't the behaviour
>> match what we want with yes and oldconfig ?
>>
>
> Nope, that commit is fixing the issue when using make <target>_defconfig
> or make olddefconfig. Note that using make menuconfig already had the
> correct behavior before that commit.

right. I'm pretty familiar with that code, so I knew this worked.

>
> As shown in my commit log, using yes '' | make oldconfig is still
> getting it wrong.

But that was also my point. Since the target suggested in this
patch hasn't always existed (and hence has a kernel version binding),
why not use olddefconfig with this patch, and leave the functionality
closer to its existing behaviour ? We'd still have a kernel capability
binding, but we'd not have the =y converted to =m, and the default of
'y' for new functionality would be maintained.

>
>> .. I'll run some tests to confirm for myself, but I thought I'd throw
>> the question out as well. I don't typically use defconfigs, so I need
>> to do a bit of leg work.
>>
>
> Yeah, using a full .config doesn't trigger that behavior.

I don't use those either :) but the end result is the same.

Cheers,

Bruce

>
>> I don't have any big issues with the patch, but I just want to be sure,
>> since changing this default could change the configs of many defconfig
>> users, and they may have been unknowingly relying on the old behaviour.
>>
>
> I can understand that. But I don't see any other way to make the really
> expected behavior to work without risking breaking anything.
>
Alexandre Belloni - Jan. 7, 2014, 8:52 p.m.
On 07/01/2014 21:39, Bruce Ashfield wrote:

>>
>> As shown in my commit log, using yes '' | make oldconfig is still
>> getting it wrong.
> 
> But that was also my point. Since the target suggested in this
> patch hasn't always existed (and hence has a kernel version binding),
> why not use olddefconfig with this patch, and leave the functionality
> closer to its existing behaviour ? We'd still have a kernel capability
> binding, but we'd not have the =y converted to =m, and the default of
> 'y' for new functionality would be maintained.
> 

Hum, I'm not sure I follow you. oldnoconfig and olddefconfig are exactly
the same. oldnoconfig has been renamed olddefconfig in 3.7 and
oldnoconfig is an alias to olddefconfig since then. I'm using
oldnoconfig only to be able to use that on a wider range of kernel versions.
Bruce Ashfield - Jan. 7, 2014, 9:14 p.m.
On 14-01-07 03:52 PM, Alexandre Belloni wrote:
> On 07/01/2014 21:39, Bruce Ashfield wrote:
>
>>>
>>> As shown in my commit log, using yes '' | make oldconfig is still
>>> getting it wrong.
>>
>> But that was also my point. Since the target suggested in this
>> patch hasn't always existed (and hence has a kernel version binding),
>> why not use olddefconfig with this patch, and leave the functionality
>> closer to its existing behaviour ? We'd still have a kernel capability
>> binding, but we'd not have the =y converted to =m, and the default of
>> 'y' for new functionality would be maintained.
>>
>
> Hum, I'm not sure I follow you. oldnoconfig and olddefconfig are exactly
> the same. oldnoconfig has been renamed olddefconfig in 3.7 and
> oldnoconfig is an alias to olddefconfig since then. I'm using
> oldnoconfig only to be able to use that on a wider range of kernel versions.

I need to go run some of my own tests (and poke that the code). I'm
running out of time for the day, so need to have a closer look when
things slow down.

I'm not so much concerned about the differences between:

   defconfig -> savedefconfig -> config

and

   defconfig -> new kernel (oldconfig) -> config

vs

   defconfig -> new kernel (olddefconfig) -> config

i.e. What do the new config options offered by the new kernel
generate in the final .config between the two techniques.

Personally, I think the make target that is run should be configurable
via a variable (yes, I know we all hate new variables), but getting
this right for everyone is hard, and also not forcing everyone to write
their own kernel_do_configure() if they don't like this behaviour.

Bruce

>
>
Darren Hart - Jan. 7, 2014, 9:32 p.m.
On Tue, 2014-01-07 at 21:32 +0100, Alexandre Belloni wrote:
> On 07/01/2014 19:11, Hart, Darren wrote:
> > 
> > Please check for the functionality, not KERNEL_VERSION. The
> > KERNEL_VERSION doesn't allow for backports and such which might add this
> > ability. Grep the Makefile for the target, for example, if the above OR
> > statement isn't adequate.
> > 
> 
> I guess the OR is perfectly fine then. For whatever reason make
> oldnoconfig fails, we'll fall back to the old behavior.
> 
> > As Bruce stated, it seems that the fix would be to use the updated
> > Kconfig, not default to setting things to NO. The problem with that
> > approach is it doesn't accept defaults for non-specified options (which
> > when updating kernel versions, is often the preferred approach).
> > 
> 
> I think you got it wrong:
>  - I am already using an updated kconfig (I even backported it on the
> older kernel version)
>  - make oldnoconfig is NOT setting things to NO but to the default value
> of the unspecified options (exactly what we need). The choice of the
> name was not wise and It has been renamed olddefconfig since 3.7
> 
> 

I see - you're right, I had misunderstood.
Alexandre Belloni - Jan. 29, 2014, 1:10 p.m.
Hi Bruce,

Any news on that ?

On Tue, Jan 07, 2014 at 15:39:01 -0500, Bruce Ashfield wrote :
> On 14-01-07 03:27 PM, Alexandre Belloni wrote:
> >On 07/01/2014 16:32, Bruce Ashfield wrote:
> >>On 14-01-07 09:18 AM, Alexandre Belloni wrote:
> >>>When using a defconfig, using yes '' | make oldconfig may not result in
> >>>the correct configuration being set. For example:
> >>>
> >>>   $ grep USB_ETH .config
> >>>   CONFIG_USB_ETH=y
> >>>   CONFIG_USB_ETH_RNDIS=y
> >>>   CONFIG_USB_ETH_EEM=y
> >>>   $ make savedefconfig
> >>>   scripts/kconfig/conf --savedefconfig=defconfig Kconfig
> >>>   $ cp defconfig .config
> >>>   ‘defconfig’ -> ‘.config’
> >>>   $ yes '' | make oldconfig
> >>>   [...]
> >>>   #
> >>>   # configuration written to .config
> >>>   #
> >>>   $ grep USB_ETH .config
> >>>   CONFIG_USB_ETH=m
> >>>   CONFIG_USB_ETH_RNDIS=y
> >>>   CONFIG_USB_ETH_EEM=y
> >>>
> >>>Using make olddefconfig solves that but we'll use oldnoconfig for
> >>>backward compatibility with older kernels.
> >>>
> >>>   $ cp defconfig .config
> >>>   ‘defconfig’ -> ‘.config’
> >>>   $ make oldnoconfig
> >>>   scripts/kconfig/conf --olddefconfig Kconfig
> >>>   #
> >>>   # configuration written to .config
> >>>   #
> >>>   $ grep USB_ETH .config
> >>>   CONFIG_USB_ETH=y
> >>>   CONFIG_USB_ETH_RNDIS=y
> >>>   CONFIG_USB_ETH_EEM=y
> >>>
> >>>For more information, please refer to:
> >>>http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=fbe98bb9ed3dae23e320c6b113e35f129538d14a
> >>>
> >>
> >>It was my understanding that this commit changed the Kconfig behaviour
> >>to set the selected options to =y and prevent the menu choice from
> >>"hiding" the options in a depedent choice menu. But maybe I'm remembering
> >>wrong.
> >>
> >>The point being, that with that commit in place. Doesn't the behaviour
> >>match what we want with yes and oldconfig ?
> >>
> >
> >Nope, that commit is fixing the issue when using make <target>_defconfig
> >or make olddefconfig. Note that using make menuconfig already had the
> >correct behavior before that commit.
> 
> right. I'm pretty familiar with that code, so I knew this worked.
> 
> >
> >As shown in my commit log, using yes '' | make oldconfig is still
> >getting it wrong.
> 
> But that was also my point. Since the target suggested in this
> patch hasn't always existed (and hence has a kernel version binding),
> why not use olddefconfig with this patch, and leave the functionality
> closer to its existing behaviour ? We'd still have a kernel capability
> binding, but we'd not have the =y converted to =m, and the default of
> 'y' for new functionality would be maintained.
> 
> >
> >>.. I'll run some tests to confirm for myself, but I thought I'd throw
> >>the question out as well. I don't typically use defconfigs, so I need
> >>to do a bit of leg work.
> >>
> >
> >Yeah, using a full .config doesn't trigger that behavior.
> 
> I don't use those either :) but the end result is the same.
> 
> Cheers,
> 
> Bruce
> 
> >
> >>I don't have any big issues with the patch, but I just want to be sure,
> >>since changing this default could change the configs of many defconfig
> >>users, and they may have been unknowingly relying on the old behaviour.
> >>
> >
> >I can understand that. But I don't see any other way to make the really
> >expected behavior to work without risking breaking anything.
> >
>
Bruce Ashfield - Jan. 29, 2014, 3:03 p.m.
On 14-01-29 08:10 AM, Alexandre Belloni wrote:
> Hi Bruce,
>
> Any news on that ?

Sorry, I hadn't intended for this to sit with no reply for this lenght
of time. I was tied up working with 3.13 and 3.14 yocto kerenls. I'm
now in a position to run some migration tests and will follow up with
the results asap.

Bruce

>
> On Tue, Jan 07, 2014 at 15:39:01 -0500, Bruce Ashfield wrote :
>> On 14-01-07 03:27 PM, Alexandre Belloni wrote:
>>> On 07/01/2014 16:32, Bruce Ashfield wrote:
>>>> On 14-01-07 09:18 AM, Alexandre Belloni wrote:
>>>>> When using a defconfig, using yes '' | make oldconfig may not result in
>>>>> the correct configuration being set. For example:
>>>>>
>>>>>    $ grep USB_ETH .config
>>>>>    CONFIG_USB_ETH=y
>>>>>    CONFIG_USB_ETH_RNDIS=y
>>>>>    CONFIG_USB_ETH_EEM=y
>>>>>    $ make savedefconfig
>>>>>    scripts/kconfig/conf --savedefconfig=defconfig Kconfig
>>>>>    $ cp defconfig .config
>>>>>    ‘defconfig’ -> ‘.config’
>>>>>    $ yes '' | make oldconfig
>>>>>    [...]
>>>>>    #
>>>>>    # configuration written to .config
>>>>>    #
>>>>>    $ grep USB_ETH .config
>>>>>    CONFIG_USB_ETH=m
>>>>>    CONFIG_USB_ETH_RNDIS=yThe enhancements in this release in comparison to previous releases are:
>>>>>    CONFIG_USB_ETH_EEM=y
>>>>>
>>>>> Using make olddefconfig solves that but we'll use oldnoconfig for
>>>>> backward compatibility with older kernels.
>>>>>
>>>>>    $ cp defconfig .config
>>>>>    ‘defconfig’ -> ‘.config’
>>>>>    $ make oldnoconfig
>>>>>    scripts/kconfig/conf --olddefconfig Kconfig
>>>>>    #
>>>>>    # configuration written to .config
>>>>>    #
>>>>>    $ grep USB_ETH .config
>>>>>    CONFIG_USB_ETH=y
>>>>>    CONFIG_USB_ETH_RNDIS=y
>>>>>    CONFIG_USB_ETH_EEM=y
>>>>>
>>>>> For more information, please refer to:
>>>>> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=fbe98bb9ed3dae23e320c6b113e35f129538d14a
>>>>>
>>>>
>>>> It was my understanding that this commit changed the Kconfig behaviour
>>>> to set the selected options to =y and prevent the menu choice from
>>>> "hiding" the options in a depedent choice menu. But maybe I'm remembering
>>>> wrong.
>>>>
>>>> The point being, that with that commit in place. Doesn't the behaviour
>>>> match what we want with yes and oldconfig ?
>>>>
>>>
>>> Nope, that commit is fixing the issue when using make <target>_defconfig
>>> or make olddefconfig. Note that using make menuconfig already had the
>>> correct behavior before that commit.
>>
>> right. I'm pretty familiar with that code, so I knew this worked.
>>
>>>
>>> As shown in my commit log, using yes '' | make oldconfig is still
>>> getting it wrong.
>>
>> But that was also my point. Since the target suggested in this
>> patch hasn't always existed (and hence has a kernel version binding),
>> why not use olddefconfig with this patch, and leave the functionality
>> closer to its existing behaviour ? We'd still have a kernel capability
>> binding, but we'd not have the =y converted to =m, and the default of
>> 'y' for new functionality would be maintained.
>>
>>>
>>>> .. I'll run some tests to confirm for myself, but I thought I'd throw
>>>> the question out as well. I don't typically use defconfigs, so I need
>>>> to do a bit of leg work.
>>>>
>>>
>>> Yeah, using a full .config doesn't trigger that behavior.
>>
>> I don't use those either :) but the end result is the same.
>>
>> Cheers,
>>
>> Bruce
>>
>>>
>>>> I don't have any big issues with the patch, but I just want to be sure,
>>>> since changing this default could change the configs of many defconfig
>>>> users, and they may have been unknowingly relying on the old behaviour.
>>>>
>>>
>>> I can understand that. But I don't see any other way to make the really
>>> expected behavior to work without risking breaking anything.
>>>
>>
>
Bruce Ashfield - Feb. 6, 2014, 1:48 p.m.
On 14-01-29 08:10 AM, Alexandre Belloni wrote:
> Hi Bruce,
>
> Any news on that ?

And a update. I've been debugging some results that don't look
right, so I have haven't followed up yet.

I'm hopeful to get a consistent set of results by the end of
the day.

Bruce

>
> On Tue, Jan 07, 2014 at 15:39:01 -0500, Bruce Ashfield wrote :
>> On 14-01-07 03:27 PM, Alexandre Belloni wrote:
>>> On 07/01/2014 16:32, Bruce Ashfield wrote:
>>>> On 14-01-07 09:18 AM, Alexandre Belloni wrote:
>>>>> When using a defconfig, using yes '' | make oldconfig may not result in
>>>>> the correct configuration being set. For example:
>>>>>
>>>>>    $ grep USB_ETH .config
>>>>>    CONFIG_USB_ETH=y
>>>>>    CONFIG_USB_ETH_RNDIS=y
>>>>>    CONFIG_USB_ETH_EEM=y
>>>>>    $ make savedefconfig
>>>>>    scripts/kconfig/conf --savedefconfig=defconfig Kconfig
>>>>>    $ cp defconfig .config
>>>>>    ‘defconfig’ -> ‘.config’
>>>>>    $ yes '' | make oldconfig
>>>>>    [...]
>>>>>    #
>>>>>    # configuration written to .config
>>>>>    #
>>>>>    $ grep USB_ETH .config
>>>>>    CONFIG_USB_ETH=m
>>>>>    CONFIG_USB_ETH_RNDIS=y
>>>>>    CONFIG_USB_ETH_EEM=y
>>>>>
>>>>> Using make olddefconfig solves that but we'll use oldnoconfig for
>>>>> backward compatibility with older kernels.
>>>>>
>>>>>    $ cp defconfig .config
>>>>>    ‘defconfig’ -> ‘.config’
>>>>>    $ make oldnoconfig
>>>>>    scripts/kconfig/conf --olddefconfig Kconfig
>>>>>    #
>>>>>    # configuration written to .config
>>>>>    #
>>>>>    $ grep USB_ETH .config
>>>>>    CONFIG_USB_ETH=y
>>>>>    CONFIG_USB_ETH_RNDIS=y
>>>>>    CONFIG_USB_ETH_EEM=y
>>>>>
>>>>> For more information, please refer to:
>>>>> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=fbe98bb9ed3dae23e320c6b113e35f129538d14a
>>>>>
>>>>
>>>> It was my understanding that this commit changed the Kconfig behaviour
>>>> to set the selected options to =y and prevent the menu choice from
>>>> "hiding" the options in a depedent choice menu. But maybe I'm remembering
>>>> wrong.
>>>>
>>>> The point being, that with that commit in place. Doesn't the behaviour
>>>> match what we want with yes and oldconfig ?
>>>>
>>>
>>> Nope, that commit is fixing the issue when using make <target>_defconfig
>>> or make olddefconfig. Note that using make menuconfig already had the
>>> correct behavior before that commit.
>>
>> right. I'm pretty familiar with that code, so I knew this worked.
>>
>>>
>>> As shown in my commit log, using yes '' | make oldconfig is still
>>> getting it wrong.
>>
>> But that was also my point. Since the target suggested in this
>> patch hasn't always existed (and hence has a kernel version binding),
>> why not use olddefconfig with this patch, and leave the functionality
>> closer to its existing behaviour ? We'd still have a kernel capability
>> binding, but we'd not have the =y converted to =m, and the default of
>> 'y' for new functionality would be maintained.
>>
>>>
>>>> .. I'll run some tests to confirm for myself, but I thought I'd throw
>>>> the question out as well. I don't typically use defconfigs, so I need
>>>> to do a bit of leg work.
>>>>
>>>
>>> Yeah, using a full .config doesn't trigger that behavior.
>>
>> I don't use those either :) but the end result is the same.
>>
>> Cheers,
>>
>> Bruce
>>
>>>
>>>> I don't have any big issues with the patch, but I just want to be sure,
>>>> since changing this default could change the configs of many defconfig
>>>> users, and they may have been unknowingly relying on the old behaviour.
>>>>
>>>
>>> I can understand that. But I don't see any other way to make the really
>>> expected behavior to work without risking breaking anything.
>>>
>>
>

Patch

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 61a6d102d7a8..644d7937923d 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -313,7 +313,7 @@  kernel_do_configure() {
 	if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then
 		cp "${WORKDIR}/defconfig" "${B}/.config"
 	fi
-	yes '' | oe_runmake oldconfig
+	oe_runmake oldnoconfig
 }
 
 do_savedefconfig() {