Skip to contentSkip to conversation

KVM integration

PATCH Superseded Mihai Prica 6 participants 18 messages Jan 7, 2013 – Jan 11, 2013

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover KVM integration

More details on building a KVM image can be found on the wiki page at:
https://wiki.yoctoproject.org/wiki/Virtualization_with_KVM

Mihai Prica (2):
linux-yocto: added kernel configuration for KVM
Created new target:kvm-image-minimal

 recipes-extended/images/kvm-image-minimal.bb    |   22 ++++++++++++++++++++++
 recipes-kernel/linux/linux-yocto/kvm-enable.scc |    4 ++++
 recipes-kernel/linux/linux-yocto/kvm.cfg        |    4 ++++
 recipes-kernel/linux/linux-yocto_3.4.bbappend   |    1 +
 4 files changed, 31 insertions(+)
 create mode 100644 recipes-extended/images/kvm-image-minimal.bb
 create mode 100644 recipes-kernel/linux/linux-yocto/kvm-enable.scc
 create mode 100644 recipes-kernel/linux/linux-yocto/kvm.cfg
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/2 linux-yocto: added kernel configuration for KVM

---
 recipes-kernel/linux/linux-yocto/kvm-enable.scc |    4 ++++
 recipes-kernel/linux/linux-yocto/kvm.cfg        |    4 ++++
 recipes-kernel/linux/linux-yocto_3.4.bbappend   |    1 +
 3 files changed, 9 insertions(+)
 create mode 100644 recipes-kernel/linux/linux-yocto/kvm-enable.scc
 create mode 100644 recipes-kernel/linux/linux-yocto/kvm.cfg
recipes-kernel/linux/linux-yocto/kvm-enable.scc new file +4 -0
new file mode 100644
index 0000000..0b5f4fc
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Enable KVM host support"
+define KFEATURE_COMPATIBILITY board
+
+kconf non-hardware kvm.cfg
recipes-kernel/linux/linux-yocto/kvm.cfg new file +4 -0
new file mode 100644
index 0000000..0cfcf58
@@ -0,0 +1,4 @@
+CONFIG_KVM=y
+CONFIG_KVM_INTEL=y
+CONFIG_KVM_AMD=y
+CONFIG_TUN=y
recipes-kernel/linux/linux-yocto_3.4.bbappend +1 -0
index 5b163ff..71bead2 100644
@@ -4,5 +4,6 @@ SRC_URI += "file://xt-checksum.scc \
             file://ebtables.scc \
 	    file://vswitch.scc \
 	    file://lxc.scc \
+            file://kvm-enable.scc \
 	    "
 
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [PATCH 1/2] linux-yocto: added kernel configuration for KVM

recipes-kernel/linux/linux-yocto/kvm.cfg

Quoted 26 lines · Mihai Prica
---
 recipes-kernel/linux/linux-yocto/kvm-enable.scc |    4 ++++
 recipes-kernel/linux/linux-yocto/kvm.cfg        |    4 ++++
 recipes-kernel/linux/linux-yocto_3.4.bbappend   |    1 +
 3 files changed, 9 insertions(+)
 create mode 100644 recipes-kernel/linux/linux-yocto/kvm-enable.scc
 create mode 100644 recipes-kernel/linux/linux-yocto/kvm.cfg
recipes-kernel/linux/linux-yocto/kvm-enable.scc new file +4 -0
new file mode 100644
index 0000000..0b5f4fc
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Enable KVM host support"
+define KFEATURE_COMPATIBILITY board
+
+kconf non-hardware kvm.cfg
recipes-kernel/linux/linux-yocto/kvm.cfg new file +0 -0
new file mode 100644
index 0000000..0cfcf58

We already have an identical config fragment within the kernel tree itself:

http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-3.4/tree/meta/cfg/kernel-cache/features/kvm/qemu-kvm-enable.scc?h=meta

and

http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-3.4/tree/meta/cfg/kernel-cache/features/kvm/qemu-kvm.cfg?h=meta

If there's a reason why the in-tree version won't work, we should definitely fix it
there first. Having a copy outside of the kernel itself is going to cause us maintenance
issues down the road.

Since at the moment, these fragments are targeted to linux-yocto, so there's no reason
to avoid using the meta data that follows the tree, since we get re-use and the added
benefit that I won't break any virtualization use cases when working on the kernel :)

Cheers,

Bruce

Quoted 1 line

@@ -0,0 +1,4 @@

Quoted 24 lines
recipes-kernel/linux/linux-yocto/kvm.cfg new file +4 -0
+CONFIG_KVM=y
+CONFIG_KVM_INTEL=y
+CONFIG_KVM_AMD=y
+CONFIG_TUN=y
recipes-kernel/linux/linux-yocto_3.4.bbappend +1 -1
index 5b163ff..71bead2 100644
@@ -4,5 +4,6 @@ SRC_URI += "file://xt-checksum.scc \
             file://ebtables.scc \
            file://vswitch.scc \
            file://lxc.scc \
+            file://kvm-enable.scc \
            "
 
--

1.7.9.5

_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
#3 lore raw

Re: [PATCH 1/2] linux-yocto: added kernel configuration for KVM

In reply to Mihai Prica

I'm going to show my lack of knowledge in this area, but I know this is going to come up when I push a xen.cfg that I apparently never added.

Is it possible to do something along the lines of PACKAGE_CONFIG in the linux-yocto.bbappend? For example, in the libvirt package one can use PACKAGE_CONFIG to construct a "minimal" build of libvirt. What would be the method for one to do the same in this package?

Yes, I imagine that worst case there can be a SRC_URI_distro definition that includes only the .scc files required for that "minimal" image build, but it seems like we want to keep away from that as much as possible being that this isn't a distro layer.

Thanks,
Ray

Quoted 40 lines · Mihai Prica
---
  recipes-kernel/linux/linux-yocto/kvm-enable.scc |    4 ++++
  recipes-kernel/linux/linux-yocto/kvm.cfg        |    4 ++++
  recipes-kernel/linux/linux-yocto_3.4.bbappend   |    1 +
  3 files changed, 9 insertions(+)

create mode 100644 recipes-kernel/linux/linux-yocto/kvm-enable.scc create mode 100644 recipes-kernel/linux/linux-yocto/kvm.cfg

recipes-kernel/linux/linux-yocto/kvm-enable.scc new file +4 -0
new file mode 100644
index 0000000..0b5f4fc
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Enable KVM host support"
+define KFEATURE_COMPATIBILITY board
+
+kconf non-hardware kvm.cfg
recipes-kernel/linux/linux-yocto/kvm.cfg new file +4 -0
new file mode 100644
index 0000000..0cfcf58
@@ -0,0 +1,4 @@
+CONFIG_KVM=y
+CONFIG_KVM_INTEL=y
+CONFIG_KVM_AMD=y
+CONFIG_TUN=y
recipes-kernel/linux/linux-yocto_3.4.bbappend +1 -0
index 5b163ff..71bead2 100644
@@ -4,5 +4,6 @@ SRC_URI += "file://xt-checksum.scc \
              file://ebtables.scc \
  	    file://vswitch.scc \
  	    file://lxc.scc \
+            file://kvm-enable.scc \
  	    "
 
#4 lore raw

Re: [PATCH 1/2] linux-yocto: added kernel configuration for KVM

Quoted 8 lines · Raymond Danks

I'm going to show my lack of knowledge in this area, but I know this is going to come up when I push a xen.cfg that I apparently never added.

Is it possible to do something along the lines of PACKAGE_CONFIG in the linux-yocto.bbappend? For example, in the libvirt package one can use PACKAGE_CONFIG to construct a "minimal" build of libvirt. What would be the method for one to do the same in this package?

kernel configuration fragment use are controlled via the KERNEL_FEATURES variable, and
for anything pre-yocto 1.4 that means an in-tree kernel configuration fragment (I'm still pushing
for the fragments to be maintained in tree, since that allows them to be reused and maintained
more easily).

KERNEL_FEATURES is managed like any other variable in the system, including updating
it via optional/dynamic features as we see fit.

Quoted 6 lines

Yes, I imagine that worst case there can be a SRC_URI_distro definition that includes only the .scc files required for that "minimal" image build, but it seems like we want to keep away from that as much as possible being that this isn't a distro layer.

Typically we do this via a base KERNEL_FEATURES specification in the relevant recipe(s), and
distros, or other configurations can override/extend it as required.

Cheers,

Buce

Quoted 56 lines

Thanks,
Ray

Quoted 38 lines · Mihai Prica
---
  recipes-kernel/linux/linux-**yocto/kvm-enable.scc |    4 ++++
  recipes-kernel/linux/linux-**yocto/kvm.cfg        |    4 ++++
  recipes-kernel/linux/linux-**yocto_3.4.bbappend   |    1 +
  3 files changed, 9 insertions(+)

create mode 100644 recipes-kernel/linux/linux-**yocto/kvm-enable.scc create mode 100644 recipes-kernel/linux/linux-**yocto/kvm.cfg

recipes-kernel/linux/linux-**yocto/kvm-enable.scc new file +4 -0
new file mode 100644
index 0000000..0b5f4fc
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Enable KVM host support"
+define KFEATURE_COMPATIBILITY board
+
+kconf non-hardware kvm.cfg
recipes-kernel/linux/linux-**yocto/kvm.cfg new file +4 -0
new file mode 100644
index 0000000..0cfcf58
@@ -0,0 +1,4 @@
+CONFIG_KVM=y
+CONFIG_KVM_INTEL=y
+CONFIG_KVM_AMD=y
+CONFIG_TUN=y
recipes-kernel/linux/linux-**yocto_3.4.bbappend +0 -0
index 5b163ff..71bead2 100644

recipes-kernel/linux/linux-**yocto_3.4.bbappend SRC_URI += "file://xt-checksum.scc \ · line 9

Quoted 6 lines
recipes-kernel/linux/linux-**yocto_3.4.bbappend +1 -0
@@ -4,5 +4,6 @@ SRC_URI += "file://xt-checksum.scc \
              file://ebtables.scc \
            file://vswitch.scc \
            file://lxc.scc \
+            file://kvm-enable.scc \
            "
 

______________________________**_________________
meta-virtualization mailing list meta-virtualization@**yoctoproject.org<[email protected]>
https://lists.yoctoproject.**org/listinfo/meta-**virtualization<https://lists.yoctoproject.org/listinfo/meta-virtualization>

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
#5 lore raw

Re: [PATCH 1/2] linux-yocto: added kernel configuration for KVM

Quoted 16 lines · Bruce Ashfield

On Mon, Jan 7, 2013 at 12:26 PM, Raymond Danks <[email protected] <mailto:[email protected]>> wrote:

I'm going to show my lack of knowledge in this area, but I know this is going to come up when I push a xen.cfg that I apparently never added.

Is it possible to do something along the lines of PACKAGE_CONFIG in the linux-yocto.bbappend? For example, in the libvirt package one can use PACKAGE_CONFIG to construct a "minimal" build of libvirt. What would be the method for one to do the same in this package?

Quoted 7 lines

kernel configuration fragment use are controlled via the KERNEL_FEATURES variable, and for anything pre-yocto 1.4 that means an in-tree kernel configuration fragment (I'm still pushing for the fragments to be maintained in tree, since that allows them to be reused and maintained more easily).

KERNEL_FEATURES is managed like any other variable in the system, including updating it via optional/dynamic features as we see fit.

Thanks Bruce. Yes, KERNEL_FEATURES is what I was looking for, I believe. I'm seeing some references and examples for this now.

Ray

Quoted 78 lines

Yes, I imagine that worst case there can be a SRC_URI_distro definition that includes only the .scc files required for that "minimal" image build, but it seems like we want to keep away from that as much as possible being that this isn't a distro layer.

Typically we do this via a base KERNEL_FEATURES specification in the relevant recipe(s), and distros, or other configurations can override/extend it as required.

Cheers,

Buce

    Thanks,
    Ray


    On 01/07/2013 05:08 AM, Mihai Prica wrote:

        Signed-off-by: Mihai Prica <[email protected]
        <mailto:[email protected]>>
        ---
          recipes-kernel/linux/linux-yocto/kvm-enable.scc |    4 ++++
          recipes-kernel/linux/linux-yocto/kvm.cfg        |    4 ++++
          recipes-kernel/linux/linux-yocto_3.4.bbappend   |    1 +
          3 files changed, 9 insertions(+)
          create mode 100644
        recipes-kernel/linux/linux-yocto/kvm-enable.scc
          create mode 100644 recipes-kernel/linux/linux-yocto/kvm.cfg

        diff --git a/recipes-kernel/linux/linux-yocto/kvm-enable.scc
        b/recipes-kernel/linux/linux-yocto/kvm-enable.scc
        new file mode 100644
        index 0000000..0b5f4fc
        --- /dev/null
        +++ b/recipes-kernel/linux/linux-yocto/kvm-enable.scc
        @@ -0,0 +1,4 @@
        +define KFEATURE_DESCRIPTION "Enable KVM host support"
        +define KFEATURE_COMPATIBILITY board
        +
        +kconf non-hardware kvm.cfg
        diff --git a/recipes-kernel/linux/linux-yocto/kvm.cfg
        b/recipes-kernel/linux/linux-yocto/kvm.cfg
        new file mode 100644
        index 0000000..0cfcf58
        --- /dev/null
        +++ b/recipes-kernel/linux/linux-yocto/kvm.cfg
        @@ -0,0 +1,4 @@
        +CONFIG_KVM=y
        +CONFIG_KVM_INTEL=y
        +CONFIG_KVM_AMD=y
        +CONFIG_TUN=y
        diff --git a/recipes-kernel/linux/linux-yocto_3.4.bbappend
        b/recipes-kernel/linux/linux-yocto_3.4.bbappend
        index 5b163ff..71bead2 100644
        --- a/recipes-kernel/linux/linux-yocto_3.4.bbappend
        +++ b/recipes-kernel/linux/linux-yocto_3.4.bbappend
        @@ -4,5 +4,6 @@ SRC_URI += "file://xt-checksum.scc \
                      file://ebtables.scc \
                    file://vswitch.scc \
                    file://lxc.scc \
        +            file://kvm-enable.scc \
                    "


    _______________________________________________
    meta-virtualization mailing list
    [email protected]
    <mailto:[email protected]>
    https://lists.yoctoproject.org/listinfo/meta-virtualization
Signature · 1 line
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"
#6 lore raw

Re: [PATCH 1/2] linux-yocto: added kernel configuration for KVM

I didn't know about the configuration fragments from the kernel tree. I'll redo the patch to use those.
I see that the .cfg from the kernel tree enables kvm as modules. In this situation, I think I need to add an extra RRECOMMENDS with the necessary kernel-module-kvm to bring the necessary modules to the sysroot. Where would be the best places to add this, considering there is no specific recipe for kvm? I tried to add them to the image recipe but it didn't worked.

Thanks,
Mihai

From: [email protected] [mailto:[email protected]] On Behalf Of Raymond Danks
Sent: Monday, January 07, 2013 8:32 PM
To: Bruce Ashfield
Cc: [email protected]
Subject: Re: [meta-virtualization] [PATCH 1/2] linux-yocto: added kernel configuration for KVM

On 01/07/2013 11:10 AM, Bruce Ashfield wrote:

On Mon, Jan 7, 2013 at 12:26 PM, Raymond Danks <[email protected]<mailto:[email protected]>> wrote:
I'm going to show my lack of knowledge in this area, but I know this is going to come up when I push a xen.cfg that I apparently never added.

Is it possible to do something along the lines of PACKAGE_CONFIG in the linux-yocto.bbappend? For example, in the libvirt package one can use PACKAGE_CONFIG to construct a "minimal" build of libvirt. What would be the method for one to do the same in this package?

kernel configuration fragment use are controlled via the KERNEL_FEATURES variable, and for anything pre-yocto 1.4 that means an in-tree kernel configuration fragment (I'm still pushing for the fragments to be maintained in tree, since that allows them to be reused and maintained more easily).

KERNEL_FEATURES is managed like any other variable in the system, including updating it via optional/dynamic features as we see fit.

Thanks Bruce. Yes, KERNEL_FEATURES is what I was looking for, I believe. I'm seeing some references and examples for this now.

Ray

Yes, I imagine that worst case there can be a SRC_URI_distro definition that includes only the .scc files required for that "minimal" image build, but it seems like we want to keep away from that as much as possible being that this isn't a distro layer.

Typically we do this via a base KERNEL_FEATURES specification in the relevant recipe(s), and distros, or other configurations can override/extend it as required.

Cheers,

Buce

Thanks,
Ray

On 01/07/2013 05:08 AM, Mihai Prica wrote:

---
  recipes-kernel/linux/linux-yocto/kvm-enable.scc |    4 ++++
  recipes-kernel/linux/linux-yocto/kvm.cfg        |    4 ++++
  recipes-kernel/linux/linux-yocto_3.4.bbappend   |    1 +
  3 files changed, 9 insertions(+)

create mode 100644 recipes-kernel/linux/linux-yocto/kvm-enable.scc create mode 100644 recipes-kernel/linux/linux-yocto/kvm.cfg

recipes-kernel/linux/linux-yocto/kvm-enable.scc new file +4 -0
new file mode 100644
index 0000000..0b5f4fc
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Enable KVM host support"
+define KFEATURE_COMPATIBILITY board
+
+kconf non-hardware kvm.cfg
recipes-kernel/linux/linux-yocto/kvm.cfg new file +4 -0
new file mode 100644
index 0000000..0cfcf58
@@ -0,0 +1,4 @@
+CONFIG_KVM=y
+CONFIG_KVM_INTEL=y
+CONFIG_KVM_AMD=y
+CONFIG_TUN=y
recipes-kernel/linux/linux-yocto_3.4.bbappend +1 -0
index 5b163ff..71bead2 100644
@@ -4,5 +4,6 @@ SRC_URI += "file://xt-checksum.scc<file:///\\xt-checksum.scc> \
              file://ebtables.scc<file:///\\ebtables.scc> \
            file://vswitch.scc<file:///\\vswitch.scc> \
            file://lxc.scc<file:///\\lxc.scc> \
+            file://kvm-enable.scc<file:///\\kvm-enable.scc> \
            "
 

_______________________________________________
meta-virtualization mailing list [email protected]<mailto:[email protected]>
https://lists.yoctoproject.org/listinfo/meta-virtualization

--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"

#7 lore raw

Re: [PATCH 1/2] linux-yocto: added kernel configuration for KVM

Quoted 5 lines · Mihai

I didn't know about the configuration fragments from the kernel tree. I'll redo the patch to use those.

I see that the .cfg from the kernel tree enables kvm as modules. In this situation, I think I need to add an extra RRECOMMENDS with the necessary kernel-module-kvm to bring the necessary modules to the sysroot. Where would be the best places to add this, considering there is no specific recipe for kvm? I tried to add them to the image recipe but it didn't worked.

It often to add below line in conf/machine/**.conf, I don't see it in meta-virt, Bruce may give some better comments

MACHINE_EXTRA_RRECOMMENDS = "kernel-module-kvm"

and need to make sure the kvm moudles built with "M" first

Lei

Quoted 130 lines

Thanks,

Mihai

*From:*[email protected] [mailto:[email protected]] *On Behalf Of *Raymond Danks *Sent:* Monday, January 07, 2013 8:32 PM
*To:* Bruce Ashfield
*Cc:* [email protected]
*Subject:* Re: [meta-virtualization] [PATCH 1/2] linux-yocto: added kernel configuration for KVM

On 01/07/2013 11:10 AM, Bruce Ashfield wrote:

On Mon, Jan 7, 2013 at 12:26 PM, Raymond Danks <[email protected] <mailto:[email protected]>> wrote:

I'm going to show my lack of knowledge in this area, but I know this is going to come up when I push a xen.cfg that I apparently never added.

Is it possible to do something along the lines of PACKAGE_CONFIG in the linux-yocto.bbappend? For example, in the libvirt package one can use PACKAGE_CONFIG to construct a "minimal" build of libvirt. What would be the method for one to do the same in this package?

kernel configuration fragment use are controlled via the KERNEL_FEATURES variable, and

for anything pre-yocto 1.4 that means an in-tree kernel configuration fragment (I'm still pushing

for the fragments to be maintained in tree, since that allows them to be reused and maintained

more easily).

KERNEL_FEATURES is managed like any other variable in the system, including updating

it via optional/dynamic features as we see fit.

Thanks Bruce. Yes, KERNEL_FEATURES is what I was looking for, I believe. I'm seeing some references and examples for this now.

Ray

Yes, I imagine that worst case there can be a SRC_URI_distro definition that includes only the .scc files required for that "minimal" image build, but it seems like we want to keep away from that as much as possible being that this isn't a distro layer.

Typically we do this via a base KERNEL_FEATURES specification in the relevant recipe(s), and

distros, or other configurations can override/extend it as required.

Cheers,

Buce

    Thanks,
    Ray



    On 01/07/2013 05:08 AM, Mihai Prica wrote:

    Signed-off-by: Mihai Prica <[email protected]
    <mailto:[email protected]>>
    ---
      recipes-kernel/linux/linux-yocto/kvm-enable.scc |    4 ++++
      recipes-kernel/linux/linux-yocto/kvm.cfg        |    4 ++++
      recipes-kernel/linux/linux-yocto_3.4.bbappend   |    1 +
      3 files changed, 9 insertions(+)
      create mode 100644 recipes-kernel/linux/linux-yocto/kvm-enable.scc
      create mode 100644 recipes-kernel/linux/linux-yocto/kvm.cfg

    diff --git a/recipes-kernel/linux/linux-yocto/kvm-enable.scc
    b/recipes-kernel/linux/linux-yocto/kvm-enable.scc
    new file mode 100644
    index 0000000..0b5f4fc
    --- /dev/null
    +++ b/recipes-kernel/linux/linux-yocto/kvm-enable.scc
    @@ -0,0 +1,4 @@
    +define KFEATURE_DESCRIPTION "Enable KVM host support"
    +define KFEATURE_COMPATIBILITY board
    +
    +kconf non-hardware kvm.cfg
    diff --git a/recipes-kernel/linux/linux-yocto/kvm.cfg
    b/recipes-kernel/linux/linux-yocto/kvm.cfg
    new file mode 100644
    index 0000000..0cfcf58
    --- /dev/null
    +++ b/recipes-kernel/linux/linux-yocto/kvm.cfg
    @@ -0,0 +1,4 @@
    +CONFIG_KVM=y
    +CONFIG_KVM_INTEL=y
    +CONFIG_KVM_AMD=y
    +CONFIG_TUN=y
    diff --git a/recipes-kernel/linux/linux-yocto_3.4.bbappend
    b/recipes-kernel/linux/linux-yocto_3.4.bbappend
    index 5b163ff..71bead2 100644
    --- a/recipes-kernel/linux/linux-yocto_3.4.bbappend
    +++ b/recipes-kernel/linux/linux-yocto_3.4.bbappend
    @@ -4,5 +4,6 @@ SRC_URI += "file://xt-checksum.scc
    <file:///%5C%5Cxt-checksum.scc> \
    file://ebtables.scc <file:///%5C%5Cebtables.scc> \
    file://vswitch.scc <file:///%5C%5Cvswitch.scc> \
    file://lxc.scc <file:///%5C%5Clxc.scc> \
    + file://kvm-enable.scc <file:///%5C%5Ckvm-enable.scc> \
                "

    _______________________________________________
    meta-virtualization mailing list
    [email protected]
    <mailto:[email protected]>
    https://lists.yoctoproject.org/listinfo/meta-virtualization
Signature · 8 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"



_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization
#8 lore raw

Re: [PATCH 1/2] linux-yocto: added kernel configuration for KVM

In reply to Prica, Mihai
Quoted 5 lines · Mihai

** **

I didn’t know about the configuration fragments from the kernel tree. I’ll redo the patch to use those. ****

Quoted 7 lines

I see that the .cfg from the kernel tree enables kvm as modules. In this situation, I think I need to add an extra RRECOMMENDS with the necessary kernel-module-kvm to bring the necessary modules to the sysroot. Where would be the best places to add this, considering there is no specific recipe for kvm? I tried to add them to the image recipe but it didn’t worked.

You are presumably going to enable the in tree fragments by appending to KERNEL_FEATURES
in the linux-yocto_3.4.bbappend. Which to me, seems like the right place to also add the
RRECOMMENDS. Or had you tried this and it didn't work for some reason I'm missing at the
moment (it's late here, and I've spent all day hunting autobuilder breakage) :)

Cheers,

Bruce

Quoted 161 lines

****

** **

Thanks,****

Mihai****

** **

*From:* [email protected] [mailto:
[email protected]] *On Behalf Of *Raymond Danks *Sent:* Monday, January 07, 2013 8:32 PM
*To:* Bruce Ashfield
*Cc:* [email protected]
*Subject:* Re: [meta-virtualization] [PATCH 1/2] linux-yocto: added kernel configuration for KVM****

** **

On 01/07/2013 11:10 AM, Bruce Ashfield wrote:****

** **

** **

On Mon, Jan 7, 2013 at 12:26 PM, Raymond Danks <[email protected]> wrote:****

I'm going to show my lack of knowledge in this area, but I know this is going to come up when I push a xen.cfg that I apparently never added.

Is it possible to do something along the lines of PACKAGE_CONFIG in the linux-yocto.bbappend? For example, in the libvirt package one can use PACKAGE_CONFIG to construct a "minimal" build of libvirt. What would be the method for one to do the same in this package?****

** **

kernel configuration fragment use are controlled via the KERNEL_FEATURES variable, and****

for anything pre-yocto 1.4 that means an in-tree kernel configuration fragment (I'm still pushing****

for the fragments to be maintained in tree, since that allows them to be reused and maintained****

more easily).****

** **

KERNEL_FEATURES is managed like any other variable in the system, including updating****

it via optional/dynamic features as we see fit.****

Thanks Bruce. Yes, KERNEL_FEATURES is what I was looking for, I believe. I'm seeing some references and examples for this now.

Ray

****

** **

Yes, I imagine that worst case there can be a SRC_URI_distro definition that includes only the .scc files required for that "minimal" image build, but it seems like we want to keep away from that as much as possible being that this isn't a distro layer.****

** **

Typically we do this via a base KERNEL_FEATURES specification in the relevant recipe(s), and****

distros, or other configurations can override/extend it as required.****

** **

Cheers,****

** **

Buce****

****

Thanks,
Ray ****

On 01/07/2013 05:08 AM, Mihai Prica wrote:****

---
  recipes-kernel/linux/linux-yocto/kvm-enable.scc |    4 ++++
  recipes-kernel/linux/linux-yocto/kvm.cfg        |    4 ++++
  recipes-kernel/linux/linux-yocto_3.4.bbappend   |    1 +
  3 files changed, 9 insertions(+)

create mode 100644 recipes-kernel/linux/linux-yocto/kvm-enable.scc create mode 100644 recipes-kernel/linux/linux-yocto/kvm.cfg

recipes-kernel/linux/linux-yocto/kvm-enable.scc new file +4 -0
new file mode 100644
index 0000000..0b5f4fc
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Enable KVM host support"
+define KFEATURE_COMPATIBILITY board
+
+kconf non-hardware kvm.cfg
recipes-kernel/linux/linux-yocto/kvm.cfg new file +4 -0
new file mode 100644
index 0000000..0cfcf58
@@ -0,0 +1,4 @@
+CONFIG_KVM=y
+CONFIG_KVM_INTEL=y
+CONFIG_KVM_AMD=y
+CONFIG_TUN=y
recipes-kernel/linux/linux-yocto_3.4.bbappend +1 -0
index 5b163ff..71bead2 100644
@@ -4,5 +4,6 @@ SRC_URI += "file://xt-checksum.scc \
              file://ebtables.scc \
            file://vswitch.scc \
            file://lxc.scc \
+            file://kvm-enable.scc \
            "
  ****

** **

_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization****

****

** **

--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end" ****

** **

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
#9 lore raw

Re: [PATCH 1/2] linux-yocto: added kernel configuration for KVM

On Tue, Jan 8, 2013 at 1:45 PM, Prica, Mihai <[email protected]<mailto:[email protected]>> wrote:

I didn't know about the configuration fragments from the kernel tree. I'll redo the patch to use those.
I see that the .cfg from the kernel tree enables kvm as modules. In this situation, I think I need to add an extra RRECOMMENDS with the necessary kernel-module-kvm to bring the necessary modules to the sysroot. Where would be the best places to add this, considering there is no specific recipe for kvm? I tried to add them to the image recipe but it didn't worked.

You are presumably going to enable the in tree fragments by appending to KERNEL_FEATURES in the linux-yocto_3.4.bbappend. Which to me, seems like the right place to also add the RRECOMMENDS. Or had you tried this and it didn't work for some reason I'm missing at the moment (it's late here, and I've spent all day hunting autobuilder breakage) :)

It doesn't work in the kernel recipe. I've talked with Richard and he said PACKAGE_INSTALL_ATTEMPTONLY can be used for this in the image recipe. He said he will add a new IMAGE_INSTALL_RECOMMEND option for this.

There is however one more thing. Which is the best way to configure the modules to be loaded at boot-time? I saw some discussion on the mailing list about update-modules becoming obsolete.

Thanks,
Mihai

Cheers,

Bruce

Thanks,
Mihai

From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Raymond Danks
Sent: Monday, January 07, 2013 8:32 PM
To: Bruce Ashfield
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [meta-virtualization] [PATCH 1/2] linux-yocto: added kernel configuration for KVM

On 01/07/2013 11:10 AM, Bruce Ashfield wrote:

On Mon, Jan 7, 2013 at 12:26 PM, Raymond Danks <[email protected]<mailto:[email protected]>> wrote:
I'm going to show my lack of knowledge in this area, but I know this is going to come up when I push a xen.cfg that I apparently never added.

Is it possible to do something along the lines of PACKAGE_CONFIG in the linux-yocto.bbappend? For example, in the libvirt package one can use PACKAGE_CONFIG to construct a "minimal" build of libvirt. What would be the method for one to do the same in this package?

kernel configuration fragment use are controlled via the KERNEL_FEATURES variable, and for anything pre-yocto 1.4 that means an in-tree kernel configuration fragment (I'm still pushing for the fragments to be maintained in tree, since that allows them to be reused and maintained more easily).

KERNEL_FEATURES is managed like any other variable in the system, including updating it via optional/dynamic features as we see fit.

Thanks Bruce. Yes, KERNEL_FEATURES is what I was looking for, I believe. I'm seeing some references and examples for this now.

Ray

Yes, I imagine that worst case there can be a SRC_URI_distro definition that includes only the .scc files required for that "minimal" image build, but it seems like we want to keep away from that as much as possible being that this isn't a distro layer.

Typically we do this via a base KERNEL_FEATURES specification in the relevant recipe(s), and distros, or other configurations can override/extend it as required.

Cheers,

Buce

Thanks,
Ray

On 01/07/2013 05:08 AM, Mihai Prica wrote:

---
  recipes-kernel/linux/linux-yocto/kvm-enable.scc |    4 ++++
  recipes-kernel/linux/linux-yocto/kvm.cfg        |    4 ++++
  recipes-kernel/linux/linux-yocto_3.4.bbappend   |    1 +
  3 files changed, 9 insertions(+)

create mode 100644 recipes-kernel/linux/linux-yocto/kvm-enable.scc create mode 100644 recipes-kernel/linux/linux-yocto/kvm.cfg

recipes-kernel/linux/linux-yocto/kvm-enable.scc new file +4 -0
new file mode 100644
index 0000000..0b5f4fc
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Enable KVM host support"
+define KFEATURE_COMPATIBILITY board
+
+kconf non-hardware kvm.cfg
recipes-kernel/linux/linux-yocto/kvm.cfg new file +4 -0
new file mode 100644
index 0000000..0cfcf58
@@ -0,0 +1,4 @@
+CONFIG_KVM=y
+CONFIG_KVM_INTEL=y
+CONFIG_KVM_AMD=y
+CONFIG_TUN=y
recipes-kernel/linux/linux-yocto_3.4.bbappend +1 -0
index 5b163ff..71bead2 100644
@@ -4,5 +4,6 @@ SRC_URI += "file://xt-checksum.scc \
              file://ebtables.scc \
            file://vswitch.scc \
            file://lxc.scc \
+            file://kvm-enable.scc \
            <file:///\\xt-checksum.scc%20\%0b %20 %20 %20 %20 %20 %20 %20file:\ebtables.scc%20\%0b %20 %20 %20 %20 %20 %20file:\vswitch.scc%20\%0b %20 %20 %20 %20 %20 %20file:\lxc.scc%20\%0b+%20 %20 %20 %20 %20 %20 file:\kvm-enable.scc%20\%0b %20 %20 %20 %20 %20 %20> "
 

_______________________________________________
meta-virtualization mailing list [email protected]<mailto:[email protected]>
https://lists.yoctoproject.org/listinfo/meta-virtualization

--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"

--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"

#10 lore raw

Re: [PATCH 1/2] linux-yocto: added kernel configuration for KVM

Quoted 15 lines · Mihai

On Tue, Jan 8, 2013 at 1:45 PM, Prica, Mihai <[email protected] <mailto:[email protected]>> wrote:

I didn't know about the configuration fragments from the kernel tree. I'll redo the patch to use those.

I see that the .cfg from the kernel tree enables kvm as modules. In this situation, I think I need to add an extra RRECOMMENDS with the necessary kernel-module-kvm to bring the necessary modules to the sysroot. Where would be the best places to add this, considering there is no specific recipe for kvm? I tried to add them to the image recipe but it didn't worked.

You are presumably going to enable the in tree fragments by appending to KERNEL_FEATURES

in the linux-yocto_3.4.bbappend. Which to me, seems like the right place to also add the

RRECOMMENDS. Or had you tried this and it didn't work for some reason I'm missing at the

moment (it's late here, and I've spent all day hunting autobuilder breakage) :)

Quoted 8 lines

It doesn't work in the kernel recipe. I've talked with Richard and he said PACKAGE_INSTALL_ATTEMPTONLY can

be used for this in the image recipe. He said he will add a new IMAGE_INSTALL_RECOMMEND option for this.

There is however one more thing. Which is the best way to configure the modules to be loaded at boot-time? I

saw some discussion on the mailing list about update-modules becoming obsolete.

I think "module_autoload_iwlwifi = "iwlwifi" " is your choice

Lei

Quoted 152 lines

Thanks,

Mihai

Cheers,

Bruce

Thanks,

Mihai

*From:*[email protected] <mailto:[email protected]> [mailto:[email protected] <mailto:[email protected]>] *On Behalf Of *Raymond Danks
*Sent:* Monday, January 07, 2013 8:32 PM
*To:* Bruce Ashfield
*Cc:* [email protected] <mailto:[email protected]> *Subject:* Re: [meta-virtualization] [PATCH 1/2] linux-yocto:
added kernel configuration for KVM

On 01/07/2013 11:10 AM, Bruce Ashfield wrote:

On Mon, Jan 7, 2013 at 12:26 PM, Raymond Danks <[email protected] <mailto:[email protected]>> wrote:

I'm going to show my lack of knowledge in this area, but I know this is going to come up when I push a xen.cfg that I apparently never added.

Is it possible to do something along the lines of PACKAGE_CONFIG in the linux-yocto.bbappend? For example, in the libvirt package one can use PACKAGE_CONFIG to construct a "minimal" build of libvirt. What would be the method for one to do the same in this package?

kernel configuration fragment use are controlled via the KERNEL_FEATURES variable, and

for anything pre-yocto 1.4 that means an in-tree kernel configuration fragment (I'm still pushing

for the fragments to be maintained in tree, since that allows them to be reused and maintained

more easily).

KERNEL_FEATURES is managed like any other variable in the system, including updating

it via optional/dynamic features as we see fit.

Thanks Bruce. Yes, KERNEL_FEATURES is what I was looking for, I believe. I'm seeing some references and examples for this now.

Ray

Yes, I imagine that worst case there can be a SRC_URI_distro definition that includes only the .scc files required for that "minimal" image build, but it seems like we want to keep away from that as much as possible being that this isn't a distro layer.

Typically we do this via a base KERNEL_FEATURES specification in the relevant recipe(s), and

distros, or other configurations can override/extend it as required.

Cheers,

Buce

Thanks,
Ray

On 01/07/2013 05:08 AM, Mihai Prica wrote:

<mailto:[email protected]>>
---
recipes-kernel/linux/linux-yocto/kvm-enable.scc | 4 ++++
recipes-kernel/linux/linux-yocto/kvm.cfg | 4 ++++
recipes-kernel/linux/linux-yocto_3.4.bbappend | 1 +
3 files changed, 9 insertions(+)
create mode 100644
recipes-kernel/linux/linux-yocto/kvm-enable.scc
create mode 100644 recipes-kernel/linux/linux-yocto/kvm.cfg

diff --git a/recipes-kernel/linux/linux-yocto/kvm-enable.scc
b/recipes-kernel/linux/linux-yocto/kvm-enable.scc
new file mode 100644
index 0000000..0b5f4fc
--- /dev/null
+++ b/recipes-kernel/linux/linux-yocto/kvm-enable.scc
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Enable KVM host support"
+define KFEATURE_COMPATIBILITY board
+
+kconf non-hardware kvm.cfg
diff --git a/recipes-kernel/linux/linux-yocto/kvm.cfg
b/recipes-kernel/linux/linux-yocto/kvm.cfg
new file mode 100644
index 0000000..0cfcf58
--- /dev/null
+++ b/recipes-kernel/linux/linux-yocto/kvm.cfg
@@ -0,0 +1,4 @@
+CONFIG_KVM=y
+CONFIG_KVM_INTEL=y
+CONFIG_KVM_AMD=y
+CONFIG_TUN=y
diff --git a/recipes-kernel/linux/linux-yocto_3.4.bbappend
b/recipes-kernel/linux/linux-yocto_3.4.bbappend
index 5b163ff..71bead2 100644
--- a/recipes-kernel/linux/linux-yocto_3.4.bbappend
+++ b/recipes-kernel/linux/linux-yocto_3.4.bbappend
@@ -4,5 +4,6 @@ SRC_URI += "file://xt-checksum.scc \
file://ebtables.scc \
file://vswitch.scc \
file://lxc.scc \
+ file://kvm-enable.scc \
<file:///%5C%5Cxt-checksum.scc%20%5C%0b%A0%20%A0%20%A0%20%A0%20%A0%20%A0%20%A0%20file:%5Cebtables.scc%20%5C%0b%A0%20%A0%20%A0%20%A0%20%A0%20%A0%20file:%5Cvswitch.scc%20%5C%0b%A0%20%A0%20%A0%20%A0%20%A0%20%A0%20file:%5Clxc.scc%20%5C%0b+%20%A0%20%A0%20%A0%20%A0%20%A0%20%A0file:%5Ckvm-enable.scc%20%5C%0b%A0%20%A0%20%A0%20%A0%20%A0%20%A0%20>"

_______________________________________________
meta-virtualization mailing list [email protected] <mailto:[email protected]>
https://lists.yoctoproject.org/listinfo/meta-virtualization

--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"

Signature · 8 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"



_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization
#11 lore raw

Re: [PATCH 1/2] linux-yocto: added kernel configuration for KVM

Quoted 46 lines · Lei Yang

On 01/10/2013 03:43 AM, Prica, Mihai wrote:

On Tue, Jan 8, 2013 at 1:45 PM, Prica, Mihai <[email protected]>
wrote:****

****

I didn’t know about the configuration fragments from the kernel tree. I’ll redo the patch to use those. ****

I see that the .cfg from the kernel tree enables kvm as modules. In this situation, I think I need to add an extra RRECOMMENDS with the necessary kernel-module-kvm to bring the necessary modules to the sysroot. Where would be the best places to add this, considering there is no specific recipe for kvm? I tried to add them to the image recipe but it didn’t worked.****

** **

** **

You are presumably going to enable the in tree fragments by appending to KERNEL_FEATURES****

in the linux-yocto_3.4.bbappend. Which to me, seems like the right place to also add the****

RRECOMMENDS. Or had you tried this and it didn't work for some reason I'm missing at the****

moment (it's late here, and I've spent all day hunting autobuilderbreakage) :)
****

** **

It doesn’t work in the kernel recipe. I’ve talked with Richard and he said PACKAGE_INSTALL_ATTEMPTONLY can ****

be used for this in the image recipe. He said he will add a new IMAGE_INSTALL_RECOMMEND option for this. ****

** **

There is however one more thing. Which is the best way to configure the modules to be loaded at boot-time? I****

Quoted 8 lines

saw some discussion on the mailing list about update-modules becoming obsolete.****

** **

I think "module_autoload_iwlwifi = "iwlwifi" " is your choice

That's the method that use as well, but it is tied into update-modules. I remember the
other thread as well, I'll follow up there.

Cheers,

Bruce

Quoted 194 lines

Lei

   Thanks,****

Mihai****

** **

Cheers,****

** **

Bruce****

****

****

Thanks,****

Mihai****

****

*From:*[email protected] [mailto:
[email protected]] *On Behalf Of *Raymond Danks *Sent:* Monday, January 07, 2013 8:32 PM
*To:* Bruce Ashfield
*Cc:* [email protected]
*Subject:* Re: [meta-virtualization] [PATCH 1/2] linux-yocto: added kernel configuration for KVM****

****

On 01/07/2013 11:10 AM, Bruce Ashfield wrote:****

****

****

On Mon, Jan 7, 2013 at 12:26 PM, Raymond Danks <[email protected]> wrote:****

I'm going to show my lack of knowledge in this area, but I know this is going to come up when I push a xen.cfg that I apparently never added.

Is it possible to do something along the lines of PACKAGE_CONFIG in the linux-yocto.bbappend? For example, in the libvirt package one can use PACKAGE_CONFIG to construct a "minimal" build of libvirt. What would be the method for one to do the same in this package?****

****

kernel configuration fragment use are controlled via the KERNEL_FEATURES variable, and****

for anything pre-yocto 1.4 that means an in-tree kernel configuration fragment (I'm still pushing****

for the fragments to be maintained in tree, since that allows them to be reused and maintained****

more easily).****

****

KERNEL_FEATURES is managed like any other variable in the system, including updating****

it via optional/dynamic features as we see fit.****

Thanks Bruce. Yes, KERNEL_FEATURES is what I was looking for, I believe. I'm seeing some references and examples for this now.

Ray

****

****

Yes, I imagine that worst case there can be a SRC_URI_distro definition that includes only the .scc files required for that "minimal" image build, but it seems like we want to keep away from that as much as possible being that this isn't a distro layer.****

****

Typically we do this via a base KERNEL_FEATURES specification in the relevant recipe(s), and****

distros, or other configurations can override/extend it as required.****

****

Cheers,****

****

Buce****

****

Thanks,
Ray ****

On 01/07/2013 05:08 AM, Mihai Prica wrote:****

---
  recipes-kernel/linux/linux-yocto/kvm-enable.scc |    4 ++++
  recipes-kernel/linux/linux-yocto/kvm.cfg        |    4 ++++
  recipes-kernel/linux/linux-yocto_3.4.bbappend   |    1 +
  3 files changed, 9 insertions(+)

create mode 100644 recipes-kernel/linux/linux-yocto/kvm-enable.scc create mode 100644 recipes-kernel/linux/linux-yocto/kvm.cfg

(quoted diff) +0 -0

linux/linux-yocto/kvm-enable.scc
new file mode 100644
index 0000000..0b5f4fc

recipes-kernel/linux/linux-yocto/kvm-enable.scc new file +4 -0
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Enable KVM host support"
+define KFEATURE_COMPATIBILITY board
+
+kconf non-hardware kvm.cfg
recipes-kernel/ renamed from recipes-kernel/linux/linux-yocto/kvm.cfg +0 -0

linux/linux-yocto/kvm.cfg
new file mode 100644
index 0000000..0cfcf58

recipes-kernel/linux/linux-yocto/kvm.cfg new file +4 -0
@@ -0,0 +1,4 @@
+CONFIG_KVM=y
+CONFIG_KVM_INTEL=y
+CONFIG_KVM_AMD=y
+CONFIG_TUN=y
recipes-kernel/linux/linux-yocto_3.4.bbappend +1 -0
index 5b163ff..71bead2 100644
@@ -4,5 +4,6 @@ SRC_URI += "file://xt-checksum.scc \
              file://ebtables.scc \
            file://vswitch.scc \
            file://lxc.scc \
+            file://kvm-enable.scc \
            "
  ****

****

_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization****

****

****

--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end" ****

****

****

** **

--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end" ****

_______________________________________________
meta-virtualization mailing [email protected]://lists.yoctoproject.org/listinfo/meta-virtualization

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
#12 lore raw

PATCH 2/2 Created new target:kvm-image-minimal

In reply to Mihai Prica
---
 recipes-extended/images/kvm-image-minimal.bb |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 recipes-extended/images/kvm-image-minimal.bb
recipes-extended/images/kvm-image-minimal.bb new file +22 -0
new file mode 100644
index 0000000..486cd9c
@@ -0,0 +1,22 @@
+DESCRIPTION = "A minimal kvm image"
+
+IMAGE_INSTALL = " \
+    packagegroup-core-boot \
+    ${ROOTFS_PKGMANAGE_BOOTSTRAP} \
+    qemu \
+    libvirt \
+    libvirt-libvirtd \
+    libvirt-virsh \
+    "
+
+IMAGE_FEATURES += "ssh-server-openssh"
+
+IMAGE_LINGUAS = " "
+
+LICENSE = "MIT"
+
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+
+ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; "
Signature · 1 line
1.7.9.5
#13 lore raw

Re: [PATCH 2/2] Created new target:kvm-image-minimal

Quoted 15 lines · Mihai Prica
---
 recipes-extended/images/kvm-image-minimal.bb |   22
++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 recipes-extended/images/kvm-image-minimal.bb
(quoted diff) +0 -0

kvm-image-minimal.bb
new file mode 100644
index 0000000..486cd9c

recipes-extended/images/kvm-image-minimal.bb line 4

Quoted 4 lines
recipes-extended/images/kvm-image-minimal.bb new file +4 -0
@@ -0,0 +1,22 @@
+DESCRIPTION = "A minimal kvm image"
+
+IMAGE_INSTALL = " \
+    packagegroup-core-boot \

Have you thought about an image variant that isn't actually bootable ? There are
quite a few use cases where having the build not depend on a kernel, but instead
simply creates a userspace that can be booted via feeding an external kernel
directly to qemu on the command line.

Not having the kernel decadency turns out to be quite useful when you want to
build a KVM host and KVM guest kernel with different configurations, in a single
build.

Cheers,

Bruce

Quoted 26 lines
recipes-extended/images/kvm-image-minimal.bb new file +18 -1
+    ${ROOTFS_PKGMANAGE_BOOTSTRAP} \
+    qemu \
+    libvirt \
+    libvirt-libvirtd \
+    libvirt-virsh \
+    "
+
+IMAGE_FEATURES += "ssh-server-openssh"
+
+IMAGE_LINGUAS = " "
+
+LICENSE = "MIT"
+
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+
+ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; "
--

1.7.9.5

_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
#14 lore raw

Re: [PATCH 2/2] Created new target:kvm-image-minimal

Quoted 32 lines · Bruce Ashfield
Quoted 15 lines · Mihai Prica
---
 recipes-extended/images/kvm-image-minimal.bb |   22
++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 recipes-extended/images/kvm-image-minimal.bb
recipes-extended/images/kvm-image-minimal.bb new file +0 -0
new file mode 100644
index 0000000..486cd9c

recipes-extended/images/kvm-image-minimal.bb line 4

Quoted 4 lines
recipes-extended/images/kvm-image-minimal.bb new file +4 -0
@@ -0,0 +1,22 @@
+DESCRIPTION = "A minimal kvm image"
+
+IMAGE_INSTALL = " \
+    packagegroup-core-boot \

Have you thought about an image variant that isn't actually bootable ? There are
quite a few use cases where having the build not depend on a kernel, but instead
simply creates a userspace that can be booted via feeding an external kernel directly to qemu on the command line.

Quoted 5 lines

Not having the kernel decadency turns out to be quite useful when you want to
build a KVM host and KVM guest kernel with different configurations, in a single
build.

I've shared this with Bruce before so I thought I would share on this list also. It's hacky and possibly not the way to go but we have been doing this in a kvm image. Not the depends, and the post process addition.

fsl-image-kvm.bb:

#
# Copyright (C) 2007 OpenedHand Ltd.
#
IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} u-boot" IMAGE_LINGUAS = " "

PR = "r1"

LICENSE = "MIT"

inherit core-image

IMAGE_ROOTFS_SIZE = "8192"

# remove not needed ipkg informations
ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; mkdir
${IMAGE_ROOTFS}/images; cp
${DEPLOY_DIR_IMAGE}/fsl-image-minimal-${MACHINE}.ext2.gz.u-boot
${IMAGE_ROOTFS}/images"

IMAGE_FSTYPES = "tar.gz ext2.gz.u-boot"

# pkgconfig is here for qemu, and it's not in DEPENDS because of multilib
# build issues. to fix later
IMAGE_INSTALL += "pkgconfig qemu kernel-image"

do_rootfs[depends] += "fsl-image-minimal:do_rootfs"

Quoted 44 lines

Cheers,

Bruce

Quoted 22 lines
recipes-extended/images/kvm-image-minimal.bb new file +18 -1
+    ${ROOTFS_PKGMANAGE_BOOTSTRAP} \
+    qemu \
+    libvirt \
+    libvirt-libvirtd \
+    libvirt-virsh \
+    "
+
+IMAGE_FEATURES += "ssh-server-openssh"
+
+IMAGE_LINGUAS = " "
+
+LICENSE = "MIT"
+
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+
+ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; "
--

1.7.9.5

Quoted 4 lines

_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"

_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

#15 lore raw

Re: [PATCH 2/2] Created new target:kvm-image-minimal

-----Original Message-----
From: McClintock Matthew-B29882 [mailto:[email protected]]
Sent: Monday, January 07, 2013 10:27 PM
To: Bruce Ashfield
Cc: Prica, Mihai; [email protected]
Subject: Re: [meta-virtualization] [PATCH 2/2] Created new target:kvm-image-minimal

Quoted 30 lines · Bruce Ashfield
Quoted 15 lines · Mihai Prica
---
 recipes-extended/images/kvm-image-minimal.bb |   22
++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 recipes-extended/images/kvm-image-minimal.bb
recipes-extended/images/kvm-image-minimal.bb new file +0 -0
new file mode 100644
index 0000000..486cd9c

recipes-extended/images/kvm-image-minimal.bb line 4

Quoted 4 lines
recipes-extended/images/kvm-image-minimal.bb new file +4 -0
@@ -0,0 +1,22 @@
+DESCRIPTION = "A minimal kvm image"
+
+IMAGE_INSTALL = " \
+    packagegroup-core-boot \

Have you thought about an image variant that isn't actually bootable ? There are quite a few use cases where having the build not depend on a kernel, but instead simply creates a userspace that can be booted via feeding an external kernel directly to qemu on the command line.

Quoted 3 lines

Not having the kernel decadency turns out to be quite useful when you want to build a KVM host and KVM guest kernel with different configurations, in a single build.

I don't exactly understand what you mean by " an image variant that isn't actually bootable ?". I just used core-image-minimal as a starting point. Using this recipe you just get the ext3 and the kernel, you don't get an hddimg..

Quoted 22 lines

I've shared this with Bruce before so I thought I would share on this list also. It's hacky and possibly not the way to go but we have been doing this in a kvm image. Not the depends, and the post process addition.

fsl-image-kvm.bb:

#
# Copyright (C) 2007 OpenedHand Ltd.
#
IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} u-boot" IMAGE_LINGUAS = " "

PR = "r1"

LICENSE = "MIT"

inherit core-image

IMAGE_ROOTFS_SIZE = "8192"

# remove not needed ipkg informations
ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; mkdir ${IMAGE_ROOTFS}/images; cp ${DEPLOY_DIR_IMAGE}/fsl-image-minimal-${MACHINE}.ext2.gz.u-boot
${IMAGE_ROOTFS}/images"
Quoted 5 lines

IMAGE_FSTYPES = "tar.gz ext2.gz.u-boot"

# pkgconfig is here for qemu, and it's not in DEPENDS because of multilib # build issues. to fix later IMAGE_INSTALL += "pkgconfig qemu kernel-image"

do_rootfs[depends] += "fsl-image-minimal:do_rootfs"

Thanks for the recipe. I'll see what I can use from it.

Mihai

Quoted 45 lines

Cheers,

Bruce

Quoted 22 lines
recipes-extended/images/kvm-image-minimal.bb new file +18 -1
+    ${ROOTFS_PKGMANAGE_BOOTSTRAP} \
+    qemu \
+    libvirt \
+    libvirt-libvirtd \
+    libvirt-virsh \
+    "
+
+IMAGE_FEATURES += "ssh-server-openssh"
+
+IMAGE_LINGUAS = " "
+
+LICENSE = "MIT"
+
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+
+ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; "
--

1.7.9.5

Quoted 4 lines

_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"

_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

#16 lore raw

Re: [PATCH 2/2] Created new target:kvm-image-minimal

Quoted 41 lines · Mihai

-----Original Message-----
From: McClintock Matthew-B29882 [mailto:[email protected]]
Sent: Monday, January 07, 2013 10:27 PM
To: Bruce Ashfield
Cc: Prica, Mihai; [email protected]
Subject: Re: [meta-virtualization] [PATCH 2/2] Created new target:kvm-image-minimal

Quoted 4 lines · Bruce Ashfield

On Mon, Jan 7, 2013 at 7:08 AM, Mihai Prica <[email protected]>

Quoted 26 lines · wrote:
Quoted 15 lines
---
 recipes-extended/images/kvm-image-minimal.bb |   22
++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 recipes-extended/images/kvm-image-minimal.bb
recipes-extended/images/kvm-image-minimal.bb new file +0 -0
new file mode 100644
index 0000000..486cd9c

recipes-extended/images/kvm-image-minimal.bb line 4

Quoted 4 lines
recipes-extended/images/kvm-image-minimal.bb new file +4 -0
@@ -0,0 +1,22 @@
+DESCRIPTION = "A minimal kvm image"
+
+IMAGE_INSTALL = " \
+    packagegroup-core-boot \

Have you thought about an image variant that isn't actually bootable ? There are quite a few use cases where having the build not depend on a kernel, but instead simply creates a userspace that can be booted via feeding an external kernel directly to qemu on the command line.

Quoted 10 lines
Quoted 3 lines

Not having the kernel decadency turns out to be quite useful when you want to build a KVM host and KVM guest kernel with different configurations, in a single build.

I don't exactly understand what you mean by " an image variant that isn't actually bootable ?". I just used core-image-minimal as a starting point. Using this recipe you just get the ext3 and the kernel, you don't get an hddimg..

What I mean is that a "bootable" image typically depends on virtual/kernel to configure
and build a kernel, and then possibly assemble parts of the kernel output into the image
itself.

We often want to build a rootfs, but have no kernel build as part of that rootfs, since the
kernel is built separately and then passed to qemu-kvm during the launch phase. Not
having that dependency means that you can just build userspace, assemble a rootfs and
then launch the guest.

If you have a dependency on virtual/kernel it turns out that you can end up with a circular
dependency if you use a method like Matthew showed, the nested rootfs depend has
it's own kernel dependency, and you have an image that depends on a kernel, that depends
on an image that depends on a kernel .. etc, and you continue looping.

Having an image that doesn't depend on virtual/kernel at any point, breaks that loop.

Cheers,

Bruce

Quoted 85 lines
Quoted 1 line

I've shared this with Bruce before so I thought I would share on this

list also. It's hacky and possibly not the way to go but we have been doing this in a kvm image. Not the depends, and the post process addition.

Quoted 7 lines

fsl-image-kvm.bb:

#
# Copyright (C) 2007 OpenedHand Ltd.
#
IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP}

u-boot"

Quoted 4 lines

IMAGE_LINGUAS = " "

PR = "r1"

Quoted 8 lines

LICENSE = "MIT"

inherit core-image

IMAGE_ROOTFS_SIZE = "8192"

# remove not needed ipkg informations
ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; mkdir

${IMAGE_ROOTFS}/images; cp ${DEPLOY_DIR_IMAGE}/fsl-image-minimal-${MACHINE}.ext2.gz.u-boot

Quoted 5 lines

${IMAGE_ROOTFS}/images"

IMAGE_FSTYPES = "tar.gz ext2.gz.u-boot"

# pkgconfig is here for qemu, and it's not in DEPENDS because of

multilib # build issues. to fix later IMAGE_INSTALL += "pkgconfig qemu kernel-image"

Quoted 2 lines

do_rootfs[depends] += "fsl-image-minimal:do_rootfs"

Thanks for the recipe. I'll see what I can use from it.

Mihai

Quoted 45 lines

Cheers,

Bruce

Quoted 22 lines
recipes-extended/images/kvm-image-minimal.bb new file +18 -1
+    ${ROOTFS_PKGMANAGE_BOOTSTRAP} \
+    qemu \
+    libvirt \
+    libvirt-libvirtd \
+    libvirt-virsh \
+    "
+
+IMAGE_FEATURES += "ssh-server-openssh"
+
+IMAGE_LINGUAS = " "
+
+LICENSE = "MIT"
+
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+
+ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; "
--

1.7.9.5

Quoted 4 lines

_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"

_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
Reviewed-by on the v1 series
#17 lore raw
In reply to Mihai Prica
Quoted 7 lines · Mihai Prica

More details on building a KVM image can be found on the wiki page at:
https://wiki.yoctoproject.org/wiki/Virtualization_with_KVM

Mihai Prica (2):
linux-yocto: added kernel configuration for KVM Created new target:kvm-image-minimal

Quoted 9 lines
  recipes-extended/images/kvm-image-minimal.bb    |   22 ++++++++++++++++++++++
  recipes-kernel/linux/linux-yocto/kvm-enable.scc |    4 ++++
  recipes-kernel/linux/linux-yocto/kvm.cfg        |    4 ++++
  recipes-kernel/linux/linux-yocto_3.4.bbappend   |    1 +
  4 files changed, 31 insertions(+)

create mode 100644 recipes-extended/images/kvm-image-minimal.bb create mode 100644 recipes-kernel/linux/linux-yocto/kvm-enable.scc create mode 100644 recipes-kernel/linux/linux-yocto/kvm.cfg