diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2006-09-22 22:19:56 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@rpsys.net> | 2006-09-22 22:19:56 +0000 |
commit | b9443cee1a139b65e420800c67dc58afd10dc5f5 (patch) | |
tree | d28df548946e2d827cbfa46a277ab22b9599289c | |
parent | 7460aa74e45f13b05f479550b3d2c9d9afdae494 (diff) |
kernel.bbclass: Update get_kernelversion for changes in kernels >= 2.6.18
-rw-r--r-- | classes/kernel.bbclass | 11 |
1 files changed, 9 insertions, 2 deletions
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 <linux/version.h> 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 ?= "" |