summaryrefslogtreecommitdiffstats
path: root/recipes-kernel
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel')
-rw-r--r--recipes-kernel/linux/linux-yocto_virtualization.inc42
1 files changed, 21 insertions, 21 deletions
diff --git a/recipes-kernel/linux/linux-yocto_virtualization.inc b/recipes-kernel/linux/linux-yocto_virtualization.inc
index 8d14ce92..486e77ce 100644
--- a/recipes-kernel/linux/linux-yocto_virtualization.inc
+++ b/recipes-kernel/linux/linux-yocto_virtualization.inc
@@ -11,18 +11,24 @@ KERNEL_FEATURES:append = "${@bb.utils.contains('DISTRO_FEATURES', 'aufs', ' feat
11# Always add a local/layer fragment for easy debug and enabling of options 11# Always add a local/layer fragment for easy debug and enabling of options
12SRC_URI += "file://extra-configs.cfg" 12SRC_URI += "file://extra-configs.cfg"
13 13
14# Inject the kcfg sysroot root into the scc search path so compound .scc 14# Inject the kcfg sysroot into the scc search path so compound .scc
15# files (like container.scc) can resolve their include directives. 15# files (like container.scc) can resolve their include directives.
16# kernel-yocto.bbclass adds type=kmeta directories to -I includes via 16# Only needed for kernels that do NOT have a type=kmeta SRC_URI entry
17# find_kernel_feature_dirs/feat_dirs. The prefunc replaces the placeholder 17# (i.e. no kernel-cache). The prefunc replaces this placeholder with
18# directory with a symlink to the kcfg sysroot so that spp can resolve 18# a symlink to the kcfg sysroot only for non-kernel-cache kernels.
19# include directives within .scc files that reference other fragments 19# For kernel-cache kernels the placeholder stays empty (harmless).
20# by relative path (e.g. "include cfg/9p.scc" inside container.scc).
21SRC_URI:append = " file://kcfg-search-path;type=kmeta;destsuffix=kcfg-sysroot" 20SRC_URI:append = " file://kcfg-search-path;type=kmeta;destsuffix=kcfg-sysroot"
22 21
23python inject_kcfg_search_path() { 22python inject_kcfg_search_path() {
24 import os, shutil 23 import os, shutil
25 24
25 # Skip if the kernel has its own kmeta (kernel-cache)
26 src_uri = d.getVar('SRC_URI')
27 # Check for type=kmeta entries other than our own kcfg-search-path
28 for entry in src_uri.split():
29 if 'type=kmeta' in entry and 'kcfg-search-path' not in entry:
30 return
31
26 unpackdir = d.getVar('UNPACKDIR') 32 unpackdir = d.getVar('UNPACKDIR')
27 workdir = d.getVar('WORKDIR') 33 workdir = d.getVar('WORKDIR')
28 search_dir = os.path.join(unpackdir, 'kcfg-sysroot') 34 search_dir = os.path.join(unpackdir, 'kcfg-sysroot')
@@ -41,26 +47,20 @@ python inject_kcfg_search_path() {
41 47
42do_kernel_metadata[prefuncs] += "inject_kcfg_search_path" 48do_kernel_metadata[prefuncs] += "inject_kcfg_search_path"
43 49
44# if the kernel-yocto meta-data routine automatically starts to add the 50# Return the correct path for a kernel configuration fragment.
45# recipe-sysroot-native, we can do away with this conditional, since all 51# Kernels with their own kernel-cache (type=kmeta in SRC_URI) already
46# features will be found at the same relative offset from a search 52# have fragments on spp's search path, so we use short paths that
47# directory 53# resolve directly. Kernels without kernel-cache need the sysroot-
48def kernel_cache_cond_feature(src_uri,feature): 54# relative path (which requires the kcfg-search-path injection above).
49 import re
50 kernel_cache = re.search("kernel-cache", src_uri )
51 if kernel_cache:
52 return feature
53
54 return "../../recipe-sysroot-native/kcfg/" + feature
55
56# no conditional, just use the yocto-kernel-cache addition, yes
57# the src_uri isn't used, but we may need to check it in the future
58def kernel_cache_feature(src_uri,feature): 55def kernel_cache_feature(src_uri,feature):
56 for entry in src_uri.split():
57 if 'type=kmeta' in entry and 'kcfg-search-path' not in entry:
58 return feature
59 return "../../recipe-sysroot-native/kcfg/" + feature 59 return "../../recipe-sysroot-native/kcfg/" + feature
60 60
61def distro_cond_feature(feature_fragment,distro_feature,d): 61def distro_cond_feature(feature_fragment,distro_feature,d):
62 import bb 62 import bb
63 feat = kernel_cache_feature("",feature_fragment) 63 feat = kernel_cache_feature(d.getVar('SRC_URI'),feature_fragment)
64 return bb.utils.contains('DISTRO_FEATURES', distro_feature, ' ' + feat, ' ', d) 64 return bb.utils.contains('DISTRO_FEATURES', distro_feature, ' ' + feat, ' ', d)
65 65
66# kept as a reference if we go back to a dynamically calculated 66# kept as a reference if we go back to a dynamically calculated