Skip to content

Instantly share code, notes, and snippets.

@WayneZhenLi
Created November 18, 2019 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WayneZhenLi/d5d7a5e8c30e6d4b7cd4541d0c24cab5 to your computer and use it in GitHub Desktop.
Save WayneZhenLi/d5d7a5e8c30e6d4b7cd4541d0c24cab5 to your computer and use it in GitHub Desktop.
===On Wed, Nov 6, 2019 at 10:40 AM Wayne Li wrote:
Dear Yocto Developers,
I'm trying to get KVM added and working on a Yocto kernel I built up for a T4240 RDB (has a PowerPC CPU). KVM isn't working and the reason why it isn't working seems to be I'm missing the necessary kernel modules. More specifically, I don't seem to have a kvm.ko file that I can load. Here's how I attempted to add KVM to the kernel.
I went to the SDK install folder and ran ". fsl-setup-env -m t4240rdb-64b" and then "bitbake virtual/kernel -c menuconfig". After the GUI comes up, I went to Virtualization -> KVM support for PowerPC E500MC/E5500/E6500 processors and hit "Save" to save the configuration. I then went and copied the content of the .config file created by this into the kernel configuration file specified by the following path; "build_t4240rdb-64b/virt1.config". This path was specified by the variable KERNEL_DEFCONFIG in sources/meta_freescale/conf/machine/t4240rdb-64b.conf. Here's what I currently have in the kernel configuration file (i.e. the virt1.config file I mentioned above):
https://gist.github.com/WayneZhenLi/4172cd4a819b71a11b85fc5aaa57ebd1
After this, I built the kernel by running "bitbake -c compile -f virtual/kernel" and rebuilt the full linux image. I re-added everything to the SD card and booted up the T4240 RDB with the newly modified Yocto kernel. At this point if I run lsmod, only the following two kernel modules show up:
Module Size Used by
nfsd 100940 11
exportfs 6723 1 nfsd
But if I do a "find . -name "kvm"" I get the following:
./usr/src/kernel/Documentation/virtual/kvm
./usr/src/kernel/arch/arm/kvm
./usr/src/kernel/arch/arm64/kvm
./usr/src/kernel/arch/mips/kvm
./usr/src/kernel/arch/powerpc/kvm
./usr/src/kernel/arch/s390/kvm
./usr/src/kernel/arch/tile/kvm
./usr/src/kernel/arch/x86/kvm
./usr/src/kernel/drivers/s390/kvm
./usr/src/kernel/include/config/kvm
./usr/src/kernel/include/config/have/kvm
./usr/src/kernel/include/kvm
./usr/src/kernel/virt/kvm
./dev/kvm
./sys/devices/virtual/misc/kvm
./sys/class/misc/kvm
./sys/kernel/debug/kvm
./sys/module/kvm
So it does look like kvm-related files were added to the Yocto kernel because of the changes I made to the kernel configuration file. But there is no kvm.ko (or any .ko file related to kvm) anywhere in the file system.
Is there something I'm doing wrong here? Am I missing important lines in my kernel configuration file? Let me know your thoughts.
-Thanks!, Wayne Li
===On Wed, Nov 6, 2019 at 11:30 AM Bruce Ashfield
Is the image you are building installing the specific kernel modules
you need, or the generic meta package "kernel-modules" ? Without
something like that, you can build the support, but the modules won't
be present on the image.
Bruce
===On Wed, Nov 6, 2019 at 11:56 AM Wayne Li wrote:
The thing is I don't know how to pick specific kernel modules and add it to the system. Me and my coworker were able to add missing TUN/TAP kernel modules using the same process I described (i.e. pulling up the GUI, saving a .config file for TUN/TAP device driver support, and copying the .config file's content into the kernel configuration file). And that worked and the TUN module was added. So I was just trying the same thing as that but for KVM. I assumed that picking the right option in the GUI and using the right .config file from there would build the right specific kernel modules into the kernel.
I mean is there another way to specify specific kernel modules I want built into the system? What do you mean by the generic meta package "kernel-modules". Just so you know, my coworker was the one who did most of the work building the Yocto kernel. But he's left the company so now I'm picking up the pieces.
-Thanks!, Wayne Li
===On Wed, Nov 6, 2019 at 3:22 PM Bruce Ashfield
> The thing is I don't know how to pick specific kernel modules and add it to the system. Me and my coworker were able to add missing TUN/TAP kernel modules using the same process I described (i.e. pulling up the GUI, saving a .config file for TUN/TAP device driver support, and copying the .config file's content into the kernel configuration file). And that worked and the TUN module was added. So I was just trying the same thing as that but for KVM. I assumed that picking the right option in the GUI and using the right .config file from there would build the right specific kernel modules into the kernel.
That will ensure the kernel is configured to build the modules, but
that doesn't mean they are installed to the image.
>
> I mean is there another way to specify specific kernel modules I want built into the system? What do you mean by the generic meta package "kernel-modules". Just so you know, my coworker was the one who did most of the work building the Yocto kernel. But he's left the company so now I'm picking up the pieces.
The "kernel-modules" package is a meta package that installs all built
modules onto the system.
So unless you are really size constrained on the device, use it, and
you'll get everything that was configured and built as a module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment