KVM modules not added to image target

450 Views Asked by At

I am working with yocto to build a target for imx6ull from NXP. I have the meta-virtualization layer added, I have set up the local.conf file to have virtualization and kvm enable as Distro_features. In meta-virtualization, I made sure that the kernel-modules for kvm were added. Could someone please give me assistance? I have been working on this for weeks. The kvm modules are not added to the target, even after the command "modprobe kvm_intel", it cannot find the module in lib/modules folder. Below is the content of the recipe for the linux kernel in meta-virtualization

FILESEXTRAPATHS_prepend := "${THISDIR}/linux-yocto:"

SRC_URI += "file://xt-checksum.scc \
            file://ebtables.scc \
        file://vswitch.scc \
        file://lxc.scc \
            file://docker.scc \
            file://kvm-enable.scc\
        "
KERNEL_FEATURES_append = " ${THISDIR}/linux-yocto/kvm-enable.scc"

KERNEL_MODULE_AUTOLOAD += "openvswitch"
KERNEL_MODULE_AUTOLOAD += "kvm"
KERNEL_MODULE_AUTOLOAD += "kvm-amd"
KERNEL_MODULE_AUTOLOAD += "kvm-intel"

KERNEL_MODULE_AUTOLOAD += "nf_conntrack_ipv6 openvswitch"
KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('DISTRO_FEATURES', 'kvm', 'kvm', '', d)}"

KERNEL_FEATURES_append = " cfg/virtio.scc"
1

There are 1 best solutions below

0
On

I don't think KERNEL_MODULE_AUTOLOAD is enough to get the modules included in the target rootfs.

Kernel modules built as loadable will be packaged in individual packages (RPMs) named kernel-module-X and a meta package named kernel-modules that REPENDS on all of the individual RPMs.
The kernel-modules package is not automatically included in the rootfs. It can be added in various ways;

  • MACHINE_EXTRA_RRECOMMENDS += "kernel-modules" can be added to the MACHINE.conf file
  • IMAGE_INSTALL_append = "kernel-modules" in local.conf is good for quick testing,
  • image recipes like meta-virtualization/recipes-extended/images/cloud-image-guest.bb can add it directly to IMAGE_INSTALL.