[OE-core] [RFC PATCH 5/6] classes/kernel: check OLDEST_KERNEL at configure time

Khem Raj raj.khem at gmail.com
Tue May 10 00:33:32 UTC 2016


> On May 8, 2016, at 9:43 PM, Paul Eggleton <paul.eggleton at linux.intel.com> wrote:
> 
> If the kernel being built is older than OLDEST_KERNEL and we're building
> with glibc, then the C library we're building is probably not going to
> be compatible with the kernel and we should warn the user. (This is
> easier to do here rather than when building glibc, because we don't
> necessarily have the information we need to determine the kernel version
> there, whereas we do here.)
> 
> Fixes [YOCTO #8653].
> 
> Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
> ---
> meta/classes/kernel.bbclass | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
> 
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index fa0864c..af88cc0 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -330,6 +330,20 @@ sysroot_stage_all () {
> 
> KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} oldnoconfig || yes '' | oe_runmake -C ${S} O=${B} oldconfig"
> 
> +python check_oldest_kernel() {
> +    oldest_kernel = d.getVar('OLDEST_KERNEL', True)
> +    kernel_version = d.getVar('KERNEL_VERSION', True)
> +    tclibc = d.getVar('TCLIBC', True)
> +    if tclibc == 'glibc':
> +        kernel_version = kernel_version.split('-', 1)[0]
> +        if oldest_kernel and kernel_version:
> +            if bb.utils.vercmp_string(kernel_version, oldest_kernel) < 0:
> +                bb.warn('%s: OLDEST_KERNEL is "%s" but the version of the kernel you are building is "%s" - therefore %s as built may not be compatible with this kernel. Either set OLDEST_KERNEL to an older version, or build a newer kernel.' % (d.getVar('PN', True), oldest_kernel, kernel_version, tclibc))
> +}

this should be an error infact. system may not boot properly if someone ignored the warning.

> +
> +check_oldest_kernel[vardepsexclude] += "OLDEST_KERNEL KERNEL_VERSION"
> +do_configure[prefuncs] += "check_oldest_kernel"
> +
> kernel_do_configure() {
> 	# fixes extra + in /lib/modules/2.6.37+
> 	# $ scripts/setlocalversion . => +
> --
> 2.5.5
> 
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20160509/c4fbb174/attachment-0002.sig>


More information about the Openembedded-core mailing list