mirror of
git://git.yoctoproject.org/meta-virtualization.git
synced 2025-07-19 20:59:41 +02:00
kernel/cfg: allow multiple kernel configuration options
When more than one kernel is supported in oe-core, we may have situations where the options from an older (or newer) kernel are not appropriate for the other version (i.e. options have been added, removed or renamed). To support this we check the preferred version of the kernel and depend on a specific yocto-cfg recipe. This is similar to how the virtualization .inc files are chosen. If this technique proves to be correct, we can factor the common routines into a .inc and just set SRCREVs in the individual .bb files. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
parent
f7bb126b39
commit
a940a0e873
|
@ -33,6 +33,21 @@ def distro_cond_feature(feature_fragment,distro_feature,d):
|
||||||
feat = kernel_cache_feature("",feature_fragment)
|
feat = kernel_cache_feature("",feature_fragment)
|
||||||
return bb.utils.contains('DISTRO_FEATURES', distro_feature, ' ' + feat, ' ', d)
|
return bb.utils.contains('DISTRO_FEATURES', distro_feature, ' ' + feat, ' ', d)
|
||||||
|
|
||||||
|
def kernel_meta_ver_depends(d):
|
||||||
|
import re
|
||||||
|
|
||||||
|
t = d.getVar("PREFERRED_PROVIDER_virtual/kernel")
|
||||||
|
pv = d.getVar( "PREFERRED_VERSION_%s" % t )
|
||||||
|
pv = re.sub( '%', '', pv )
|
||||||
|
|
||||||
|
yocto_enabled = bb.data.inherits_class('kernel-yocto', d)
|
||||||
|
if yocto_enabled:
|
||||||
|
return "yocto-cfg-fragments-%s-native:do_populate_sysroot" % pv
|
||||||
|
else:
|
||||||
|
return ""
|
||||||
|
|
||||||
|
KERNEL_CFG_DEPENDS ?= "${@kernel_meta_ver_depends(d)}"
|
||||||
|
|
||||||
KERNEL_CACHE_FEATURES ?= "${@kernel_cache_feature(d.getVar('SRC_URI'),'cfg/virtio.scc')} \
|
KERNEL_CACHE_FEATURES ?= "${@kernel_cache_feature(d.getVar('SRC_URI'),'cfg/virtio.scc')} \
|
||||||
${@kernel_cache_feature(d.getVar('SRC_URI'),'cfg/xt-checksum.scc')} \
|
${@kernel_cache_feature(d.getVar('SRC_URI'),'cfg/xt-checksum.scc')} \
|
||||||
${@kernel_cache_feature(d.getVar('SRC_URI'),'cfg/vswitch.scc')} \
|
${@kernel_cache_feature(d.getVar('SRC_URI'),'cfg/vswitch.scc')} \
|
||||||
|
@ -47,7 +62,7 @@ KERNEL_FEATURES:append = " ${KERNEL_CACHE_FEATURES}"
|
||||||
# fragment merging suport at the moment, then add a dependency on the
|
# fragment merging suport at the moment, then add a dependency on the
|
||||||
# configuration fragment repository. This allows us to be sure that our
|
# configuration fragment repository. This allows us to be sure that our
|
||||||
# features can be enabled via the fragments
|
# features can be enabled via the fragments
|
||||||
do_kernel_metadata[depends] += "${@['', 'yocto-cfg-fragments-native:do_populate_sysroot'][(bb.data.inherits_class('kernel-yocto', d))]}"
|
do_kernel_metadata[depends] += "${KERNEL_CFG_DEPENDS}"
|
||||||
|
|
||||||
# xen kernel support
|
# xen kernel support
|
||||||
# SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
|
# SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
|
||||||
|
@ -58,4 +73,3 @@ KERNEL_FEATURES:append = "${@distro_cond_feature('cfg/xen.scc', 'xen', d )}"
|
||||||
# SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'k3s', ' file://kubernetes.scc', '', d)}"
|
# SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'k3s', ' file://kubernetes.scc', '', d)}"
|
||||||
KERNEL_FEATURES:append = "${@distro_cond_feature('cfg/kubernetes.scc', 'k8s', d )}"
|
KERNEL_FEATURES:append = "${@distro_cond_feature('cfg/kubernetes.scc', 'k8s', d )}"
|
||||||
KERNEL_FEATURES:append = "${@distro_cond_feature('cfg/kubernetes.scc', 'k3s', d )}"
|
KERNEL_FEATURES:append = "${@distro_cond_feature('cfg/kubernetes.scc', 'k3s', d )}"
|
||||||
|
|
||||||
|
|
37
recipes-kernel/linux/yocto-cfg-fragments-6.10.bb
Normal file
37
recipes-kernel/linux/yocto-cfg-fragments-6.10.bb
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
HOMEPAGE = "https://git.yoctoproject.org/cgit/cgit.cgi/yocto-kernel-cache/"
|
||||||
|
SUMMARY = "Kernel configuration fragments"
|
||||||
|
DESCRIPTION = "Typically used as part of a kernel clone, this is the standalone \
|
||||||
|
fragment repository. Making it available to other fragment management schemes \
|
||||||
|
"
|
||||||
|
SECTION = "devel"
|
||||||
|
|
||||||
|
LICENSE = "MIT"
|
||||||
|
LIC_FILES_CHKSUM = "file://COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
|
||||||
|
|
||||||
|
do_configure[noexec] = "1"
|
||||||
|
do_compile[noexec] = "1"
|
||||||
|
INHIBIT_DEFAULT_DEPS = "1"
|
||||||
|
|
||||||
|
LINUX_VERSION ?= "6.10"
|
||||||
|
PV = "v${LINUX_VERSION}+git${SRCREV}"
|
||||||
|
|
||||||
|
SRCREV = "5161bedbdc3ff6f22a75fb5afb96a4077f4b4ab0"
|
||||||
|
SRC_URI = "\
|
||||||
|
git://git.yoctoproject.org/yocto-kernel-cache;branch=yocto-${LINUX_VERSION} \
|
||||||
|
"
|
||||||
|
|
||||||
|
S = "${WORKDIR}/git"
|
||||||
|
|
||||||
|
do_install() {
|
||||||
|
install -d ${D}${base_prefix}/kcfg
|
||||||
|
|
||||||
|
# copy the configuration fragments over to the native deploy
|
||||||
|
cp -r ${S}/* ${D}${base_prefix}/kcfg
|
||||||
|
# scripts bring in a bash dependency we don't want
|
||||||
|
rm -rf ${D}${base_prefix}/kcfg/scripts
|
||||||
|
}
|
||||||
|
|
||||||
|
FILES:${PN} += "kcfg/"
|
||||||
|
SYSROOT_DIRS += "${base_prefix}/kcfg"
|
||||||
|
BBCLASSEXTEND = "native nativesdk"
|
||||||
|
|
|
@ -15,7 +15,7 @@ INHIBIT_DEFAULT_DEPS = "1"
|
||||||
LINUX_VERSION ?= "6.6"
|
LINUX_VERSION ?= "6.6"
|
||||||
PV = "v${LINUX_VERSION}+git${SRCREV}"
|
PV = "v${LINUX_VERSION}+git${SRCREV}"
|
||||||
|
|
||||||
SRCREV = "eb283ea577df80542d48f0c498365960b4c4ecd9"
|
SRCREV = "4a494b202029e94a72ebb3c3966d9f1d249900f3"
|
||||||
SRC_URI = "\
|
SRC_URI = "\
|
||||||
git://git.yoctoproject.org/yocto-kernel-cache;branch=yocto-${LINUX_VERSION} \
|
git://git.yoctoproject.org/yocto-kernel-cache;branch=yocto-${LINUX_VERSION} \
|
||||||
"
|
"
|
Loading…
Reference in New Issue
Block a user