diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-10 18:33:23 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-10 21:04:20 +0000 |
| commit | a4625a1fa2758c0d2496a898ed409b5225efdab1 (patch) | |
| tree | ba9a0fc405ae7b4c43998651974b34649dbbe0fb | |
| parent | c25486a365370dd32e26fbf01cced7ec5f3106cc (diff) | |
| download | meta-virtualization-a4625a1fa2758c0d2496a898ed409b5225efdab1.tar.gz | |
kernel: inject local search path to fragment processing
Inject the kcfg sysroot root into the scc search path so compound .scc
files (like container.scc) can resolve their include directives.
kernel-yocto.bbclass adds type=kmeta directories to -I includes via
find_kernel_feature_dirs/feat_dirs.
The prefunc replaces the placeholder directory with a symlink to the
kcfg sysroot so that spp can resolve include directives within
scc files that reference other fragments by relative path (e.g.
"include cfg/9p.scc" inside container.scc).
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
| -rw-r--r-- | recipes-kernel/linux/linux-yocto/kcfg-search-path/kcfg-search-path.scc | 1 | ||||
| -rw-r--r-- | recipes-kernel/linux/linux-yocto_virtualization.inc | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-yocto/kcfg-search-path/kcfg-search-path.scc b/recipes-kernel/linux/linux-yocto/kcfg-search-path/kcfg-search-path.scc new file mode 100644 index 00000000..aff2903e --- /dev/null +++ b/recipes-kernel/linux/linux-yocto/kcfg-search-path/kcfg-search-path.scc | |||
| @@ -0,0 +1 @@ | |||
| # Placeholder - directory replaced by symlink to kcfg sysroot at build time | |||
diff --git a/recipes-kernel/linux/linux-yocto_virtualization.inc b/recipes-kernel/linux/linux-yocto_virtualization.inc index d67210c4..89e73c48 100644 --- a/recipes-kernel/linux/linux-yocto_virtualization.inc +++ b/recipes-kernel/linux/linux-yocto_virtualization.inc | |||
| @@ -11,6 +11,36 @@ 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 |
| 12 | SRC_URI += "file://extra-configs.cfg" | 12 | SRC_URI += "file://extra-configs.cfg" |
| 13 | 13 | ||
| 14 | # Inject the kcfg sysroot root into the scc search path so compound .scc | ||
| 15 | # files (like container.scc) can resolve their include directives. | ||
| 16 | # kernel-yocto.bbclass adds type=kmeta directories to -I includes via | ||
| 17 | # find_kernel_feature_dirs/feat_dirs. The prefunc replaces the placeholder | ||
| 18 | # directory with a symlink to the kcfg sysroot so that spp can resolve | ||
| 19 | # include directives within .scc files that reference other fragments | ||
| 20 | # by relative path (e.g. "include cfg/9p.scc" inside container.scc). | ||
| 21 | SRC_URI:append = " file://kcfg-search-path;type=kmeta;destsuffix=kcfg-sysroot" | ||
| 22 | |||
| 23 | python inject_kcfg_search_path() { | ||
| 24 | import os, shutil | ||
| 25 | |||
| 26 | unpackdir = d.getVar('UNPACKDIR') | ||
| 27 | workdir = d.getVar('WORKDIR') | ||
| 28 | search_dir = os.path.join(unpackdir, 'kcfg-sysroot') | ||
| 29 | kcfg_sysroot = os.path.join(workdir, 'recipe-sysroot-native', 'kcfg') | ||
| 30 | |||
| 31 | if os.path.isdir(kcfg_sysroot): | ||
| 32 | if os.path.isdir(search_dir) and not os.path.islink(search_dir): | ||
| 33 | shutil.rmtree(search_dir) | ||
| 34 | if os.path.islink(search_dir) or not os.path.exists(search_dir): | ||
| 35 | if os.path.islink(search_dir): | ||
| 36 | os.unlink(search_dir) | ||
| 37 | os.symlink(kcfg_sysroot, search_dir) | ||
| 38 | else: | ||
| 39 | bb.warn("kcfg sysroot not found at %s" % kcfg_sysroot) | ||
| 40 | } | ||
| 41 | |||
| 42 | do_kernel_metadata[prefuncs] += "inject_kcfg_search_path" | ||
| 43 | |||
| 14 | # if the kernel-yocto meta-data routine automatically starts to add the | 44 | # if the kernel-yocto meta-data routine automatically starts to add the |
| 15 | # recipe-sysroot-native, we can do away with this conditional, since all | 45 | # recipe-sysroot-native, we can do away with this conditional, since all |
| 16 | # features will be found at the same relative offset from a search | 46 | # features will be found at the same relative offset from a search |
