[v2] vm-img: move templates from meta-isar to meta again

Message ID 20230616110615.25091-1-henning.schild@siemens.com
State Accepted, archived
Headers show
Series [v2] vm-img: move templates from meta-isar to meta again | expand

Commit Message

Henning Schild June 16, 2023, 11:06 a.m. UTC
The vm image class needs these templates to work in cases where people
do not have their own copies in their layers. Having them in meta-isar
means that layers using the class with the default templates would have
to use that example layer as well.

Fixes: 3ac61204e1ed ("replace custom OVA logic with imagetype logic")
Signed-off-by: Henning Schild <henning.schild@siemens.com>
Reported-by: Clara Kowalsky <clara.kowalsky@siemens.com>
---
 meta/classes/imagetypes_vm.bbclass                               | 1 +
 .../recipes-core/images/virtualbox/vm-img-virtualbox.ovf.tmpl    | 0
 .../recipes-core/images/vmware/vm-img-vmware.ovf.tmpl            | 0
 3 files changed, 1 insertion(+)
 rename {meta-isar => meta}/recipes-core/images/virtualbox/vm-img-virtualbox.ovf.tmpl (100%)
 rename {meta-isar => meta}/recipes-core/images/vmware/vm-img-vmware.ovf.tmpl (100%)

Comments

Uladzimir Bely June 16, 2023, 11:27 a.m. UTC | #1
On Fri, 2023-06-16 at 13:06 +0200, 'Henning Schild' via isar-users
wrote:
> The vm image class needs these templates to work in cases where
> people
> do not have their own copies in their layers. Having them in meta-
> isar
> means that layers using the class with the default templates would
> have
> to use that example layer as well.
> 

We had the similar issue with new `meta-test` layer we are going to use
for CI purposes. Since it doesn't have its own copy of mentioned files
(and some files for `imx6-sabrelite` and `phyboard-mira` in `meta-
isar/recipes-core/images/`), we used the similar approach:

```
FILESEXTRAPATHS:append = ":${LAYERDIR_isar}/recipes-core/images:"
```

I'm still not sure we need to move any files to the "upper" layer,
since `virtualbox` and `vmware` machines using them are defined in
'meta-isar' layer.

But if we move files for vmware/virtualbox (in order to reduce
downstream dependency from meta-isar layer), why we don't do it for
phyboard-mira/imx6-sablrelite?..


> Fixes: 3ac61204e1ed ("replace custom OVA logic with imagetype logic")
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> Reported-by: Clara Kowalsky <clara.kowalsky@siemens.com>
> ---
>  meta/classes/imagetypes_vm.bbclass                               | 1
> +
>  .../recipes-core/images/virtualbox/vm-img-virtualbox.ovf.tmpl    | 0
>  .../recipes-core/images/vmware/vm-img-vmware.ovf.tmpl            | 0
>  3 files changed, 1 insertion(+)
>  rename {meta-isar => meta}/recipes-core/images/virtualbox/vm-img-
> virtualbox.ovf.tmpl (100%)
>  rename {meta-isar => meta}/recipes-core/images/vmware/vm-img-
> vmware.ovf.tmpl (100%)
> 
> diff --git a/meta/classes/imagetypes_vm.bbclass
> b/meta/classes/imagetypes_vm.bbclass
> index 41f2af067331..cd56d31b0fe0 100644
> --- a/meta/classes/imagetypes_vm.bbclass
> +++ b/meta/classes/imagetypes_vm.bbclass
> @@ -6,6 +6,7 @@
>  
>  inherit buildchroot
>  
> +FILESEXTRAPATHS:prepend = "${LAYERDIR_core}/recipes-core/images:"
>  OVF_TEMPLATE_FILE ?= "vm-img-virtualbox.ovf.tmpl"
>  IMAGE_SRC_URI:ova = "file://${OVF_TEMPLATE_FILE}"
>  
> diff --git a/meta-isar/recipes-core/images/virtualbox/vm-img-
> virtualbox.ovf.tmpl b/meta/recipes-core/images/virtualbox/vm-img-
> virtualbox.ovf.tmpl
> similarity index 100%
> rename from meta-isar/recipes-core/images/virtualbox/vm-img-
> virtualbox.ovf.tmpl
> rename to meta/recipes-core/images/virtualbox/vm-img-
> virtualbox.ovf.tmpl
> diff --git a/meta-isar/recipes-core/images/vmware/vm-img-
> vmware.ovf.tmpl b/meta/recipes-core/images/vmware/vm-img-
> vmware.ovf.tmpl
> similarity index 100%
> rename from meta-isar/recipes-core/images/vmware/vm-img-
> vmware.ovf.tmpl
> rename to meta/recipes-core/images/vmware/vm-img-vmware.ovf.tmpl
> -- 
> 2.39.3
>
Henning Schild June 16, 2023, 11:54 a.m. UTC | #2
Am Fri, 16 Jun 2023 14:27:59 +0300
schrieb Uladzimir Bely <ubely@ilbers.de>:

> On Fri, 2023-06-16 at 13:06 +0200, 'Henning Schild' via isar-users
> wrote:
> > The vm image class needs these templates to work in cases where
> > people
> > do not have their own copies in their layers. Having them in meta-
> > isar
> > means that layers using the class with the default templates would
> > have
> > to use that example layer as well.
> >   
> 
> We had the similar issue with new `meta-test` layer we are going to
> use for CI purposes. Since it doesn't have its own copy of mentioned
> files (and some files for `imx6-sabrelite` and `phyboard-mira` in
> `meta- isar/recipes-core/images/`), we used the similar approach:
> 
> ```
> FILESEXTRAPATHS:append = ":${LAYERDIR_isar}/recipes-core/images:"
> ```
>
> I'm still not sure we need to move any files to the "upper" layer,
> since `virtualbox` and `vmware` machines using them are defined in
> 'meta-isar' layer.

The issue was found in a layer building a vmware and a virtualbox vm.
Using somewhat custom machine configs but wanting to use the default
ovf templates without having to include meta-isar.

The class defaults to templates living in another (optional) layer and
any downstream layer could define a machine to use the class.
 
> But if we move files for vmware/virtualbox (in order to reduce
> downstream dependency from meta-isar layer), why we don't do it for
> phyboard-mira/imx6-sablrelite?..

These other files might well share similar problems. But i guess the
ubinize.cfg in meta-isar is really more of an example that people would
overload anyhow. While the ovf templates are pretty useful downstream
and the chance people have to bring their own copies might simply be
smaller.

Henning
 
> 
> > Fixes: 3ac61204e1ed ("replace custom OVA logic with imagetype
> > logic") Signed-off-by: Henning Schild <henning.schild@siemens.com>
> > Reported-by: Clara Kowalsky <clara.kowalsky@siemens.com>
> > ---
> >  meta/classes/imagetypes_vm.bbclass                               |
> > 1 +
> >  .../recipes-core/images/virtualbox/vm-img-virtualbox.ovf.tmpl    |
> > 0 .../recipes-core/images/vmware/vm-img-vmware.ovf.tmpl
> > | 0 3 files changed, 1 insertion(+)
> >  rename {meta-isar => meta}/recipes-core/images/virtualbox/vm-img-
> > virtualbox.ovf.tmpl (100%)
> >  rename {meta-isar => meta}/recipes-core/images/vmware/vm-img-
> > vmware.ovf.tmpl (100%)
> > 
> > diff --git a/meta/classes/imagetypes_vm.bbclass
> > b/meta/classes/imagetypes_vm.bbclass
> > index 41f2af067331..cd56d31b0fe0 100644
> > --- a/meta/classes/imagetypes_vm.bbclass
> > +++ b/meta/classes/imagetypes_vm.bbclass
> > @@ -6,6 +6,7 @@
> >  
> >  inherit buildchroot
> >  
> > +FILESEXTRAPATHS:prepend = "${LAYERDIR_core}/recipes-core/images:"
> >  OVF_TEMPLATE_FILE ?= "vm-img-virtualbox.ovf.tmpl"
> >  IMAGE_SRC_URI:ova = "file://${OVF_TEMPLATE_FILE}"
> >  
> > diff --git a/meta-isar/recipes-core/images/virtualbox/vm-img-
> > virtualbox.ovf.tmpl b/meta/recipes-core/images/virtualbox/vm-img-
> > virtualbox.ovf.tmpl
> > similarity index 100%
> > rename from meta-isar/recipes-core/images/virtualbox/vm-img-
> > virtualbox.ovf.tmpl
> > rename to meta/recipes-core/images/virtualbox/vm-img-
> > virtualbox.ovf.tmpl
> > diff --git a/meta-isar/recipes-core/images/vmware/vm-img-
> > vmware.ovf.tmpl b/meta/recipes-core/images/vmware/vm-img-
> > vmware.ovf.tmpl
> > similarity index 100%
> > rename from meta-isar/recipes-core/images/vmware/vm-img-
> > vmware.ovf.tmpl
> > rename to meta/recipes-core/images/vmware/vm-img-vmware.ovf.tmpl
> > -- 
> > 2.39.3
> >   
>
Uladzimir Bely June 22, 2023, 5:14 a.m. UTC | #3
On Fri, 2023-06-16 at 13:06 +0200, 'Henning Schild' via isar-users
wrote:
> The vm image class needs these templates to work in cases where
> people
> do not have their own copies in their layers. Having them in meta-
> isar
> means that layers using the class with the default templates would
> have
> to use that example layer as well.
> 
> Fixes: 3ac61204e1ed ("replace custom OVA logic with imagetype logic")
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> Reported-by: Clara Kowalsky <clara.kowalsky@siemens.com>
> ---
>  meta/classes/imagetypes_vm.bbclass                               | 1
> +
>  .../recipes-core/images/virtualbox/vm-img-virtualbox.ovf.tmpl    | 0
>  .../recipes-core/images/vmware/vm-img-vmware.ovf.tmpl            | 0
>  3 files changed, 1 insertion(+)
>  rename {meta-isar => meta}/recipes-core/images/virtualbox/vm-img-
> virtualbox.ovf.tmpl (100%)
>  rename {meta-isar => meta}/recipes-core/images/vmware/vm-img-
> vmware.ovf.tmpl (100%)
> 
> diff --git a/meta/classes/imagetypes_vm.bbclass
> b/meta/classes/imagetypes_vm.bbclass
> index 41f2af067331..cd56d31b0fe0 100644
> --- a/meta/classes/imagetypes_vm.bbclass
> +++ b/meta/classes/imagetypes_vm.bbclass
> @@ -6,6 +6,7 @@
>  
>  inherit buildchroot
>  
> +FILESEXTRAPATHS:prepend = "${LAYERDIR_core}/recipes-core/images:"
>  OVF_TEMPLATE_FILE ?= "vm-img-virtualbox.ovf.tmpl"
>  IMAGE_SRC_URI:ova = "file://${OVF_TEMPLATE_FILE}"
>  
> diff --git a/meta-isar/recipes-core/images/virtualbox/vm-img-
> virtualbox.ovf.tmpl b/meta/recipes-core/images/virtualbox/vm-img-
> virtualbox.ovf.tmpl
> similarity index 100%
> rename from meta-isar/recipes-core/images/virtualbox/vm-img-
> virtualbox.ovf.tmpl
> rename to meta/recipes-core/images/virtualbox/vm-img-
> virtualbox.ovf.tmpl
> diff --git a/meta-isar/recipes-core/images/vmware/vm-img-
> vmware.ovf.tmpl b/meta/recipes-core/images/vmware/vm-img-
> vmware.ovf.tmpl
> similarity index 100%
> rename from meta-isar/recipes-core/images/vmware/vm-img-
> vmware.ovf.tmpl
> rename to meta/recipes-core/images/vmware/vm-img-vmware.ovf.tmpl
> -- 
> 2.39.3
> 

Applied to next, thanks.

Patch

diff --git a/meta/classes/imagetypes_vm.bbclass b/meta/classes/imagetypes_vm.bbclass
index 41f2af067331..cd56d31b0fe0 100644
--- a/meta/classes/imagetypes_vm.bbclass
+++ b/meta/classes/imagetypes_vm.bbclass
@@ -6,6 +6,7 @@ 
 
 inherit buildchroot
 
+FILESEXTRAPATHS:prepend = "${LAYERDIR_core}/recipes-core/images:"
 OVF_TEMPLATE_FILE ?= "vm-img-virtualbox.ovf.tmpl"
 IMAGE_SRC_URI:ova = "file://${OVF_TEMPLATE_FILE}"
 
diff --git a/meta-isar/recipes-core/images/virtualbox/vm-img-virtualbox.ovf.tmpl b/meta/recipes-core/images/virtualbox/vm-img-virtualbox.ovf.tmpl
similarity index 100%
rename from meta-isar/recipes-core/images/virtualbox/vm-img-virtualbox.ovf.tmpl
rename to meta/recipes-core/images/virtualbox/vm-img-virtualbox.ovf.tmpl
diff --git a/meta-isar/recipes-core/images/vmware/vm-img-vmware.ovf.tmpl b/meta/recipes-core/images/vmware/vm-img-vmware.ovf.tmpl
similarity index 100%
rename from meta-isar/recipes-core/images/vmware/vm-img-vmware.ovf.tmpl
rename to meta/recipes-core/images/vmware/vm-img-vmware.ovf.tmpl