mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00

The initial fix for localversion setting in 6.3+ broke older recipes and also broke recipes setting localversion in a kernel recipe, as make-mod-scripts (and other locations) can trigger a regeneration of files and don't have access to the variable. Moving the setting of this variable to the global namespace doesn't make sense, so we follow the example of the kernel-abiversion and save a kernel-localversion to the build artifacts. Recipes that may regenerate scripts/dynamic files, must depend on the do_shared_workedir of the kernel and use the helper function to read the file storing the localversion. (From OE-Core rev: b378eec156998eea55ba61e59103cb34fab0d07c) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
63 lines
1.3 KiB
Plaintext
63 lines
1.3 KiB
Plaintext
#
|
|
# Copyright OpenEmbedded Contributors
|
|
#
|
|
# SPDX-License-Identifier: MIT
|
|
#
|
|
|
|
# parse kernel ABI version out of <linux/version.h>
|
|
def get_kernelversion_headers(p):
|
|
import re
|
|
|
|
fn = p + '/include/linux/utsrelease.h'
|
|
if not os.path.isfile(fn):
|
|
# after 2.6.33-rc1
|
|
fn = p + '/include/generated/utsrelease.h'
|
|
if not os.path.isfile(fn):
|
|
fn = p + '/include/linux/version.h'
|
|
|
|
try:
|
|
f = open(fn, 'r')
|
|
except IOError:
|
|
return None
|
|
|
|
l = f.readlines()
|
|
f.close()
|
|
r = re.compile("#define UTS_RELEASE \"(.*)\"")
|
|
for s in l:
|
|
m = r.match(s)
|
|
if m:
|
|
return m.group(1)
|
|
return None
|
|
|
|
|
|
def get_kernelversion_file(p):
|
|
fn = p + '/kernel-abiversion'
|
|
|
|
try:
|
|
with open(fn, 'r') as f:
|
|
return f.readlines()[0].strip()
|
|
except IOError:
|
|
return None
|
|
|
|
def get_kernellocalversion_file(p):
|
|
fn = p + '/kernel-localversion'
|
|
|
|
try:
|
|
with open(fn, 'r') as f:
|
|
return f.readlines()[0].strip()
|
|
except IOError:
|
|
return ""
|
|
|
|
return ""
|
|
|
|
def linux_module_packages(s, d):
|
|
suffix = ""
|
|
return " ".join(map(lambda s: "kernel-module-%s%s" % (s.lower().replace('_', '-').replace('@', '+'), suffix), s.split()))
|
|
|
|
export KBUILD_BUILD_VERSION = "1"
|
|
export KBUILD_BUILD_USER ?= "oe-user"
|
|
export KBUILD_BUILD_HOST ?= "oe-host"
|
|
|
|
# that's all
|
|
|