[OE-core] [PATCH] kernel: use oldnoconfig instead of yes '' | make oldconfig

Hart, Darren darren.hart at intel.com
Tue Jan 7 18:11:15 UTC 2014


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


-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20140107/36990a42/attachment-0002.sig>


More information about the Openembedded-core mailing list