All of lore.kernel.org
 help / color / mirror / Atom feed
* Adding KVM kernel modules to Yocto Kernel
@ 2019-11-06 16:28 Wayne Li
  2019-11-06 16:40   ` [yocto] " Bruce Ashfield
  0 siblings, 1 reply; 7+ messages in thread
From: Wayne Li @ 2019-11-06 16:28 UTC (permalink / raw)
  To: bitbake-devel, yocto

[-- Attachment #1: Type: text/plain, Size: 2535 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 3075 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Adding KVM kernel modules to Yocto Kernel
  2019-11-06 16:28 Adding KVM kernel modules to Yocto Kernel Wayne Li
@ 2019-11-06 16:40   ` Bruce Ashfield
  0 siblings, 0 replies; 7+ messages in thread
From: Bruce Ashfield @ 2019-11-06 16:40 UTC (permalink / raw)
  To: Wayne Li; +Cc: Yocto Project Discussion, bitbake-devel

On Wed, Nov 6, 2019 at 11:30 AM Wayne Li <waynli329@gmail.com> 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 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

>
> 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
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto



-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] Adding KVM kernel modules to Yocto Kernel
@ 2019-11-06 16:40   ` Bruce Ashfield
  0 siblings, 0 replies; 7+ messages in thread
From: Bruce Ashfield @ 2019-11-06 16:40 UTC (permalink / raw)
  To: Wayne Li; +Cc: Yocto Project Discussion, bitbake-devel

On Wed, Nov 6, 2019 at 11:30 AM Wayne Li <waynli329@gmail.com> 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 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

>
> 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
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto



-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Adding KVM kernel modules to Yocto Kernel
  2019-11-06 16:40   ` [yocto] " Bruce Ashfield
@ 2019-11-06 16:56     ` Wayne Li
  -1 siblings, 0 replies; 7+ messages in thread
From: Wayne Li @ 2019-11-06 16:56 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: Yocto Project Discussion, bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 4439 bytes --]

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 10:40 AM Bruce Ashfield <bruce.ashfield@gmail.com>
wrote:

> On Wed, Nov 6, 2019 at 11:30 AM Wayne Li <waynli329@gmail.com> 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 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
>
> >
> > 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
> > --
> > _______________________________________________
> > yocto mailing list
> > yocto@yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/yocto
>
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>

[-- Attachment #2: Type: text/html, Size: 5511 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] Adding KVM kernel modules to Yocto Kernel
@ 2019-11-06 16:56     ` Wayne Li
  0 siblings, 0 replies; 7+ messages in thread
From: Wayne Li @ 2019-11-06 16:56 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: Yocto Project Discussion, bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 4439 bytes --]

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 10:40 AM Bruce Ashfield <bruce.ashfield@gmail.com>
wrote:

> On Wed, Nov 6, 2019 at 11:30 AM Wayne Li <waynli329@gmail.com> 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 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
>
> >
> > 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
> > --
> > _______________________________________________
> > yocto mailing list
> > yocto@yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/yocto
>
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>

[-- Attachment #2: Type: text/html, Size: 5511 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Adding KVM kernel modules to Yocto Kernel
  2019-11-06 16:56     ` [yocto] " Wayne Li
@ 2019-11-06 21:22       ` Bruce Ashfield
  -1 siblings, 0 replies; 7+ messages in thread
From: Bruce Ashfield @ 2019-11-06 21:22 UTC (permalink / raw)
  To: Wayne Li; +Cc: Yocto Project Discussion, bitbake-devel

On Wed, Nov 6, 2019 at 11:56 AM Wayne Li <waynli329@gmail.com> 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.

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.

Bruce

>
> -Thanks!, Wayne Li
>
> On Wed, Nov 6, 2019 at 10:40 AM Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
>>
>> On Wed, Nov 6, 2019 at 11:30 AM Wayne Li <waynli329@gmail.com> 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 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
>>
>> >
>> > 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
>> > --
>> > _______________________________________________
>> > yocto mailing list
>> > yocto@yoctoproject.org
>> > https://lists.yoctoproject.org/listinfo/yocto
>>
>>
>>
>> --
>> - Thou shalt not follow the NULL pointer, for chaos and madness await
>> thee at its end
>> - "Use the force Harry" - Gandalf, Star Trek II



-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] Adding KVM kernel modules to Yocto Kernel
@ 2019-11-06 21:22       ` Bruce Ashfield
  0 siblings, 0 replies; 7+ messages in thread
From: Bruce Ashfield @ 2019-11-06 21:22 UTC (permalink / raw)
  To: Wayne Li; +Cc: Yocto Project Discussion, bitbake-devel

On Wed, Nov 6, 2019 at 11:56 AM Wayne Li <waynli329@gmail.com> 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.

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.

Bruce

>
> -Thanks!, Wayne Li
>
> On Wed, Nov 6, 2019 at 10:40 AM Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
>>
>> On Wed, Nov 6, 2019 at 11:30 AM Wayne Li <waynli329@gmail.com> 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 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
>>
>> >
>> > 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
>> > --
>> > _______________________________________________
>> > yocto mailing list
>> > yocto@yoctoproject.org
>> > https://lists.yoctoproject.org/listinfo/yocto
>>
>>
>>
>> --
>> - Thou shalt not follow the NULL pointer, for chaos and madness await
>> thee at its end
>> - "Use the force Harry" - Gandalf, Star Trek II



-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-11-06 21:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 16:28 Adding KVM kernel modules to Yocto Kernel Wayne Li
2019-11-06 16:40 ` Bruce Ashfield
2019-11-06 16:40   ` [yocto] " Bruce Ashfield
2019-11-06 16:56   ` Wayne Li
2019-11-06 16:56     ` [yocto] " Wayne Li
2019-11-06 21:22     ` Bruce Ashfield
2019-11-06 21:22       ` [yocto] " Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.