diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2024-03-06 18:56:18 +0000 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2024-03-15 17:17:20 +0000 |
commit | 628d9430a8316bde742e5defbc6be3733e183624 (patch) | |
tree | 88a02a07004cc25b73f5f3d329d928527d9e57ef /recipes-kernel/linux/linux-yocto_virtualization.inc | |
parent | 1482ea31acdfc29cb6c4199073d0dff6a39bf41b (diff) | |
download | meta-virtualization-628d9430a8316bde742e5defbc6be3733e183624.tar.gz |
kernel/cfg: move to a kernel-cache / central location for configuration
We've had duplicate fragments in the kernel-cache and the meta-virt
layer for quite some time (i.e. docker).
To more easily keep these in sync, promote the sharing of fragments
and to allow them to be used even when meta-virt isn't part of
a build, we change our feature additions to use the yocto-kernel-cfg
clone of the kernel-cache instead of the ones in our layer.
It remains to be seen if any other kernel recipes will run into
issues with this movement of the fragments, so we mark this as a
WIP/RFC.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-kernel/linux/linux-yocto_virtualization.inc')
-rw-r--r-- | recipes-kernel/linux/linux-yocto_virtualization.inc | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/recipes-kernel/linux/linux-yocto_virtualization.inc b/recipes-kernel/linux/linux-yocto_virtualization.inc index a37759ef..0ace9a75 100644 --- a/recipes-kernel/linux/linux-yocto_virtualization.inc +++ b/recipes-kernel/linux/linux-yocto_virtualization.inc | |||
@@ -1,14 +1,6 @@ | |||
1 | FILESEXTRAPATHS:prepend := "${THISDIR}/linux-yocto:" | 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/linux-yocto:" |
2 | 2 | ||
3 | SRC_URI += "file://xt-checksum.scc \ | 3 | KERNEL_FEATURES:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'kvm', ' features/kvm/qemu-kvm-enable.scc', '', d)}" |
4 | file://ebtables.scc \ | ||
5 | file://vswitch.scc \ | ||
6 | file://lxc.scc \ | ||
7 | file://docker.scc \ | ||
8 | file://cgroup-hugetlb.scc \ | ||
9 | file://criu.scc \ | ||
10 | " | ||
11 | KERNEL_FEATURES:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'kvm', 'features/kvm/qemu-kvm-enable.scc', '', d)}" | ||
12 | 4 | ||
13 | KERNEL_MODULE_AUTOLOAD += "nf_conntrack_ipv6 openvswitch" | 5 | KERNEL_MODULE_AUTOLOAD += "nf_conntrack_ipv6 openvswitch" |
14 | KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('DISTRO_FEATURES', 'kvm', 'kvm', '', d)}" | 6 | KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('DISTRO_FEATURES', 'kvm', 'kvm', '', d)}" |
@@ -16,6 +8,16 @@ KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('DISTRO_FEATURES', 'kvm', 'kvm', | |||
16 | # aufs kernel support required for xen-image-minimal | 8 | # aufs kernel support required for xen-image-minimal |
17 | KERNEL_FEATURES:append = "${@bb.utils.contains('DISTRO_FEATURES', 'aufs', ' features/aufs/aufs-enable.scc', '', d)}" | 9 | KERNEL_FEATURES:append = "${@bb.utils.contains('DISTRO_FEATURES', 'aufs', ' features/aufs/aufs-enable.scc', '', d)}" |
18 | 10 | ||
11 | |||
12 | # SRC_URI += "file://xt-checksum.scc \ | ||
13 | # file://ebtables.scc \ | ||
14 | # file://vswitch.scc \ | ||
15 | # file://lxc.scc \ | ||
16 | # file://docker.scc \ | ||
17 | # file://cgroup-hugetlb.scc \ | ||
18 | # file://criu.scc \ | ||
19 | # " | ||
20 | |||
19 | # if the kernel-yocto meta-data routine automatically starts to add the | 21 | # if the kernel-yocto meta-data routine automatically starts to add the |
20 | # recipe-sysroot-native, we can do away with this conditional, since all | 22 | # recipe-sysroot-native, we can do away with this conditional, since all |
21 | # features will be found at the same relative offset from a search | 23 | # features will be found at the same relative offset from a search |
@@ -28,7 +30,24 @@ def kernel_cache_cond_feature(src_uri,feature): | |||
28 | 30 | ||
29 | return "../recipe-sysroot-native/kcfg/" + feature | 31 | return "../recipe-sysroot-native/kcfg/" + feature |
30 | 32 | ||
31 | KERNEL_CACHE_FEATURES ?= "${@kernel_cache_cond_feature(d.getVar('SRC_URI'),'cfg/virtio.scc')}" | 33 | # no conditional, just use the yocto-kernel-cache addition, yes |
34 | # the src_uri isn't used, but we may need to check it in the future | ||
35 | def kernel_cache_feature(src_uri,feature): | ||
36 | return "../recipe-sysroot-native/kcfg/" + feature | ||
37 | |||
38 | def distro_cond_feature(feature_fragment,distro_feature,d): | ||
39 | import bb | ||
40 | feat = kernel_cache_feature("",feature_fragment) | ||
41 | return bb.utils.contains('DISTRO_FEATURES', distro_feature, feat, '', d) | ||
42 | |||
43 | KERNEL_CACHE_FEATURES ?= "${@kernel_cache_feature(d.getVar('SRC_URI'),'cfg/virtio.scc')} \ | ||
44 | ${@kernel_cache_feature(d.getVar('SRC_URI'),'cfg/xt-checksum.scc')} \ | ||
45 | ${@kernel_cache_feature(d.getVar('SRC_URI'),'cfg/vswitch.scc')} \ | ||
46 | ${@kernel_cache_feature(d.getVar('SRC_URI'),'cfg/lxc.scc')} \ | ||
47 | ${@kernel_cache_feature(d.getVar('SRC_URI'),'cfg/docker.scc')} \ | ||
48 | ${@kernel_cache_feature(d.getVar('SRC_URI'),'cfg/cgroup-hugetlb.scc')} \ | ||
49 | ${@kernel_cache_feature(d.getVar('SRC_URI'),'cfg/criu.scc')} \ | ||
50 | " | ||
32 | KERNEL_FEATURES:append = " ${KERNEL_CACHE_FEATURES}" | 51 | KERNEL_FEATURES:append = " ${KERNEL_CACHE_FEATURES}" |
33 | 52 | ||
34 | # if kernel-yocto has been inherited (how we can check for configuration | 53 | # if kernel-yocto has been inherited (how we can check for configuration |
@@ -38,8 +57,12 @@ KERNEL_FEATURES:append = " ${KERNEL_CACHE_FEATURES}" | |||
38 | do_kernel_metadata[depends] += "${@['', 'yocto-cfg-fragments-native:do_populate_sysroot'][(bb.data.inherits_class('kernel-yocto', d))]}" | 57 | do_kernel_metadata[depends] += "${@['', 'yocto-cfg-fragments-native:do_populate_sysroot'][(bb.data.inherits_class('kernel-yocto', d))]}" |
39 | 58 | ||
40 | # xen kernel support | 59 | # xen kernel support |
41 | SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}" | 60 | # SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}" |
61 | KERNEL_FEATURES:append = "${@distro_cond_feature('cfg/xen.scc', 'xen', d )}" | ||
42 | 62 | ||
43 | # k8s and k3s kernel support | 63 | # k8s and k3s kernel support |
44 | SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'k8s', ' file://kubernetes.scc', '', d)}" | 64 | # SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'k8s', ' file://kubernetes.scc', '', d)}" |
45 | SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'k3s', ' file://kubernetes.scc', '', d)}" | 65 | # SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'k3s', ' file://kubernetes.scc', '', d)}" |
66 | KERNEL_FEATURES:append = "${@distro_cond_feature('cfg/kubernetes.scc', 'k8s', d )}" | ||
67 | KERNEL_FEATURES:append = "${@distro_cond_feature('cfg/kubernetes.scc', 'k3s', d )}" | ||
68 | |||