From b9443cee1a139b65e420800c67dc58afd10dc5f5 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 22 Sep 2006 22:19:56 +0000 Subject: kernel.bbclass: Update get_kernelversion for changes in kernels >= 2.6.18 --- classes/kernel.bbclass | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'classes/kernel.bbclass') diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass index c81112ede7..f5938a798f 100644 --- a/classes/kernel.bbclass +++ b/classes/kernel.bbclass @@ -45,11 +45,18 @@ export CMDLINE_CONSOLE = "console=${@bb.data.getVar("KERNEL_CONSOLE",d,1) or "tt # parse kernel ABI version out of def get_kernelversion(p): + import re, os + + fn = p + '/include/linux/utsrelease.h' + if not os.path.isfile(fn): + fn = p + '/include/linux/version.h' + import re try: - f = open(p, 'r') + f = open(fn, 'r') except IOError: return None + l = f.readlines() f.close() r = re.compile("#define UTS_RELEASE \"(.*)\"") @@ -67,7 +74,7 @@ def get_kernelmajorversion(p): return m.group(1) return None -KERNEL_VERSION = "${@get_kernelversion('${S}/include/linux/version.h')}" +KERNEL_VERSION = "${@get_kernelversion('${S}')}" KERNEL_MAJOR_VERSION = "${@get_kernelmajorversion('${KERNEL_VERSION}')}" KERNEL_LOCALVERSION ?= "" -- cgit v1.2.3