All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] meta/conf: move default configuration templates into meta/conf/templates/default
@ 2022-08-24 12:42 Alexander Kanavin
  2022-08-24 12:42 ` [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid Alexander Kanavin
  2022-08-25 13:37 ` [OE-core] [PATCH 1/2] meta/conf: move default configuration templates into meta/conf/templates/default Luca Ceresoli
  0 siblings, 2 replies; 18+ messages in thread
From: Alexander Kanavin @ 2022-08-24 12:42 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

This sets the ground for standardizing (and enforcing) the location of
configuration templates: let's start with the default one.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 .templateconf                                               | 2 +-
 meta/classes-global/sanity.bbclass                          | 6 +++---
 meta/conf/{ => templates/default}/bblayers.conf.sample      | 0
 meta/conf/{ => templates/default}/conf-notes.txt            | 0
 meta/conf/{ => templates/default}/local.conf.sample         | 0
 .../conf/{ => templates/default}/local.conf.sample.extended | 0
 meta/conf/{ => templates/default}/site.conf.sample          | 0
 scripts/oe-setup-builddir                                   | 6 +++---
 8 files changed, 7 insertions(+), 7 deletions(-)
 rename meta/conf/{ => templates/default}/bblayers.conf.sample (100%)
 rename meta/conf/{ => templates/default}/conf-notes.txt (100%)
 rename meta/conf/{ => templates/default}/local.conf.sample (100%)
 rename meta/conf/{ => templates/default}/local.conf.sample.extended (100%)
 rename meta/conf/{ => templates/default}/site.conf.sample (100%)

diff --git a/.templateconf b/.templateconf
index 0bf5ecf1e5..e399e06acd 100644
--- a/.templateconf
+++ b/.templateconf
@@ -1,2 +1,2 @@
 # Template settings
-TEMPLATECONF=${TEMPLATECONF:-meta/conf}
+TEMPLATECONF=${TEMPLATECONF:-meta/conf/templates/default}
diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass
index 4a403a2590..75c453d486 100644
--- a/meta/classes-global/sanity.bbclass
+++ b/meta/classes-global/sanity.bbclass
@@ -42,7 +42,7 @@ BBLAYERS_CONF_UPDATE_FUNCS += " \
 
 SANITY_DIFF_TOOL ?= "meld"
 
-SANITY_LOCALCONF_SAMPLE ?= "${COREBASE}/meta*/conf/local.conf.sample"
+SANITY_LOCALCONF_SAMPLE ?= "${COREBASE}/meta*/conf/templates/default/local.conf.sample"
 python oecore_update_localconf() {
     # Check we are using a valid local.conf
     current_conf  = d.getVar('CONF_VERSION')
@@ -62,7 +62,7 @@ is a good way to visualise the changes."""
     raise NotImplementedError(failmsg)
 }
 
-SANITY_SITECONF_SAMPLE ?= "${COREBASE}/meta*/conf/site.conf.sample"
+SANITY_SITECONF_SAMPLE ?= "${COREBASE}/meta*/conf/templates/default/site.conf.sample"
 python oecore_update_siteconf() {
     # If we have a site.conf, check it's valid
     current_sconf = d.getVar('SCONF_VERSION')
@@ -82,7 +82,7 @@ is a good way to visualise the changes."""
     raise NotImplementedError(failmsg)
 }
 
-SANITY_BBLAYERCONF_SAMPLE ?= "${COREBASE}/meta*/conf/bblayers.conf.sample"
+SANITY_BBLAYERCONF_SAMPLE ?= "${COREBASE}/meta*/conf/templates/default/bblayers.conf.sample"
 python oecore_update_bblayers() {
     # bblayers.conf is out of date, so see if we can resolve that
 
diff --git a/meta/conf/bblayers.conf.sample b/meta/conf/templates/default/bblayers.conf.sample
similarity index 100%
rename from meta/conf/bblayers.conf.sample
rename to meta/conf/templates/default/bblayers.conf.sample
diff --git a/meta/conf/conf-notes.txt b/meta/conf/templates/default/conf-notes.txt
similarity index 100%
rename from meta/conf/conf-notes.txt
rename to meta/conf/templates/default/conf-notes.txt
diff --git a/meta/conf/local.conf.sample b/meta/conf/templates/default/local.conf.sample
similarity index 100%
rename from meta/conf/local.conf.sample
rename to meta/conf/templates/default/local.conf.sample
diff --git a/meta/conf/local.conf.sample.extended b/meta/conf/templates/default/local.conf.sample.extended
similarity index 100%
rename from meta/conf/local.conf.sample.extended
rename to meta/conf/templates/default/local.conf.sample.extended
diff --git a/meta/conf/site.conf.sample b/meta/conf/templates/default/site.conf.sample
similarity index 100%
rename from meta/conf/site.conf.sample
rename to meta/conf/templates/default/site.conf.sample
diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
index 5d644168cb..975619789a 100755
--- a/scripts/oe-setup-builddir
+++ b/scripts/oe-setup-builddir
@@ -69,7 +69,7 @@ fi
 
 unset SHOWYPDOC
 if [ -z "$OECORELOCALCONF" ]; then
-    OECORELOCALCONF="$OEROOT/meta/conf/local.conf.sample"
+    OECORELOCALCONF="$OEROOT/meta/conf/templates/default/local.conf.sample"
 fi
 if [ ! -r "$BUILDDIR/conf/local.conf" ]; then
     cat <<EOM
@@ -85,7 +85,7 @@ EOM
 fi
 
 if [ -z "$OECORELAYERCONF" ]; then
-    OECORELAYERCONF="$OEROOT/meta/conf/bblayers.conf.sample"
+    OECORELAYERCONF="$OEROOT/meta/conf/templates/default/bblayers.conf.sample"
 fi
 if [ ! -r "$BUILDDIR/conf/bblayers.conf" ]; then
     cat <<EOM
@@ -125,7 +125,7 @@ EOM
 fi
 
 if [ -z "$OECORENOTESCONF" ]; then
-    OECORENOTESCONF="$OEROOT/meta/conf/conf-notes.txt"
+    OECORENOTESCONF="$OEROOT/meta/conf/templates/default/conf-notes.txt"
 fi
 [ ! -r "$OECORENOTESCONF" ] || cat "$OECORENOTESCONF"
 unset OECORENOTESCONF
-- 
2.30.2



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

* [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid
  2022-08-24 12:42 [PATCH 1/2] meta/conf: move default configuration templates into meta/conf/templates/default Alexander Kanavin
@ 2022-08-24 12:42 ` Alexander Kanavin
  2022-08-24 13:58   ` [OE-core] " Peter Kjellerstedt
  2022-08-27  7:00   ` Luca Ceresoli
  2022-08-25 13:37 ` [OE-core] [PATCH 1/2] meta/conf: move default configuration templates into meta/conf/templates/default Luca Ceresoli
  1 sibling, 2 replies; 18+ messages in thread
From: Alexander Kanavin @ 2022-08-24 12:42 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

specifically that ../../layer.conf exists, and that second-from-last
component in the path is 'templates'.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 scripts/oe-setup-builddir | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
index 975619789a..db26e3b138 100755
--- a/scripts/oe-setup-builddir
+++ b/scripts/oe-setup-builddir
@@ -61,6 +61,11 @@ if [ -n "$TEMPLATECONF" ]; then
             echo >&2 "Error: TEMPLATECONF value points to nonexistent directory '$TEMPLATECONF'"
             exit 1
         fi
+        templatesdir=$(python3 -c "import sys; print(sys.argv[1].strip('/').split('/')[-2])" $TEMPLATECONF)
+        if [ ! -f "$TEMPLATECONF/../../layer.conf" -o $templatesdir != "templates" ]; then
+            echo >&2 "Error: TEMPLATECONF value must point to meta-some-layer/conf/templates/template-name"
+            exit 1
+        fi
     fi
     OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample"
     OECORELOCALCONF="$TEMPLATECONF/local.conf.sample"
-- 
2.30.2



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

* RE: [OE-core] [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid
  2022-08-24 12:42 ` [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid Alexander Kanavin
@ 2022-08-24 13:58   ` Peter Kjellerstedt
  2022-08-24 14:08     ` Alexander Kanavin
  2022-08-27  7:00   ` Luca Ceresoli
  1 sibling, 1 reply; 18+ messages in thread
From: Peter Kjellerstedt @ 2022-08-24 13:58 UTC (permalink / raw)
  To: Alexander Kanavin, openembedded-core; +Cc: Alexander Kanavin

> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Alexander Kanavin
> Sent: den 24 augusti 2022 14:43
> To: openembedded-core@lists.openembedded.org
> Cc: Alexander Kanavin <alex@linutronix.de>
> Subject: [OE-core] [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid
> 
> specifically that ../../layer.conf exists, and that second-from-last
> component in the path is 'templates'.

Please no. This happens to match your expectations, but doesn't at 
all match our use of TEMPLATECONF. In our .templateconf we set
TEMPLATECONF=${TEMPLATECONF:-templateconf} and create the templateconf 
directory in runtime where we generate the sample files that match the 
layers that repo has fetched for this particular build. It obviously 
has no layer.conf file as it is in no layer, and the path doesn't 
contain "templates/<something>". I can of course change our tools to 
create a couple of extra directories to match your expectations, but 
at the same time it seems very unnecessary.

> 
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> ---
>  scripts/oe-setup-builddir | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
> index 975619789a..db26e3b138 100755
> --- a/scripts/oe-setup-builddir
> +++ b/scripts/oe-setup-builddir
> @@ -61,6 +61,11 @@ if [ -n "$TEMPLATECONF" ]; then
>              echo >&2 "Error: TEMPLATECONF value points to nonexistent directory '$TEMPLATECONF'"
>              exit 1
>          fi
> +        templatesdir=$(python3 -c "import sys; print(sys.argv[1].strip('/').split('/')[-2])" $TEMPLATECONF)
> +        if [ ! -f "$TEMPLATECONF/../../layer.conf" -o $templatesdir != "templates" ]; then
> +            echo >&2 "Error: TEMPLATECONF value must point to meta-some-layer/conf/templates/template-name"
> +            exit 1
> +        fi
>      fi
>      OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample"
>      OECORELOCALCONF="$TEMPLATECONF/local.conf.sample"
> --
> 2.30.2

//Peter



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

* Re: [OE-core] [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid
  2022-08-24 13:58   ` [OE-core] " Peter Kjellerstedt
@ 2022-08-24 14:08     ` Alexander Kanavin
  2022-08-24 14:43       ` Peter Kjellerstedt
  0 siblings, 1 reply; 18+ messages in thread
From: Alexander Kanavin @ 2022-08-24 14:08 UTC (permalink / raw)
  To: Peter Kjellerstedt; +Cc: openembedded-core, Alexander Kanavin

On Wed, 24 Aug 2022 at 15:58, Peter Kjellerstedt
<peter.kjellerstedt@axis.com> wrote:
> Please no. This happens to match your expectations, but doesn't at
> all match our use of TEMPLATECONF. In our .templateconf we set
> TEMPLATECONF=${TEMPLATECONF:-templateconf} and create the templateconf
> directory in runtime where we generate the sample files that match the
> layers that repo has fetched for this particular build. It obviously
> has no layer.conf file as it is in no layer, and the path doesn't
> contain "templates/<something>". I can of course change our tools to
> create a couple of extra directories to match your expectations, but
> at the same time it seems very unnecessary.

If you create the template files on the fly, then you might as well
create the actual configs directly into build/conf and skip the
template step. No?

We do need to standardize the location for the templates for reasons
of discoverability and consistency with machine and distro
definitions, this has been discussed.

Alex


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

* RE: [OE-core] [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid
  2022-08-24 14:08     ` Alexander Kanavin
@ 2022-08-24 14:43       ` Peter Kjellerstedt
  2022-08-24 14:52         ` Alexander Kanavin
  0 siblings, 1 reply; 18+ messages in thread
From: Peter Kjellerstedt @ 2022-08-24 14:43 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-core, Alexander Kanavin

> -----Original Message-----
> From: Alexander Kanavin <alex.kanavin@gmail.com>
> Sent: den 24 augusti 2022 16:09
> To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> Cc: openembedded-core@lists.openembedded.org; Alexander Kanavin
> <alex@linutronix.de>
> Subject: Re: [OE-core] [PATCH 2/2] scripts/oe-setup-builddir: add a check
> that TEMPLATECONF is valid
> 
> On Wed, 24 Aug 2022 at 15:58, Peter Kjellerstedt
> <peter.kjellerstedt@axis.com> wrote:
> > Please no. This happens to match your expectations, but doesn't at
> > all match our use of TEMPLATECONF. In our .templateconf we set
> > TEMPLATECONF=${TEMPLATECONF:-templateconf} and create the templateconf
> > directory in runtime where we generate the sample files that match the
> > layers that repo has fetched for this particular build. It obviously
> > has no layer.conf file as it is in no layer, and the path doesn't
> > contain "templates/<something>". I can of course change our tools to
> > create a couple of extra directories to match your expectations, but
> > at the same time it seems very unnecessary.
> 
> If you create the template files on the fly, then you might as well
> create the actual configs directly into build/conf and skip the
> template step. No?

We create the sample files in a small wrapper for oe-init-build-env 
so that to the users, everything works just as described in the Yocto 
documentation. And since the OE scripts expect TEMPLATECONF to be set 
and contain sample files, that is what we create.

> We do need to standardize the location for the templates for reasons
> of discoverability and consistency with machine and distro
> definitions, this has been discussed.

Sure, that is fine. But the expectation I have is that TEMPLATECONF 
refers to the directory that has the sample files needed to set up 
the build environment. And that is it. As long as the sample files 
exist where it says they should be, why do you need the scripts to 
fail because the environment around the directory does not look 
like what you happen to expect? It is only the contents of the 
directory that matters. Or am I missing something?

> 
> Alex

//Peter


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

* Re: [OE-core] [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid
  2022-08-24 14:43       ` Peter Kjellerstedt
@ 2022-08-24 14:52         ` Alexander Kanavin
  2022-08-25  7:19           ` Peter Kjellerstedt
  0 siblings, 1 reply; 18+ messages in thread
From: Alexander Kanavin @ 2022-08-24 14:52 UTC (permalink / raw)
  To: Peter Kjellerstedt; +Cc: openembedded-core, Alexander Kanavin

On Wed, 24 Aug 2022 at 16:43, Peter Kjellerstedt
<peter.kjellerstedt@axis.com> wrote:
> We create the sample files in a small wrapper for oe-init-build-env
> so that to the users, everything works just as described in the Yocto
> documentation. And since the OE scripts expect TEMPLATECONF to be set
> and contain sample files, that is what we create.

Actually they don't expect that. You can simply create the configs
directly into the target build directory in your wrapper, and drop
TEMPLATECONF altogether. Then the OE scripts will detect that the
configs are already there and will skip the step of copying the
templates.

> Sure, that is fine. But the expectation I have is that TEMPLATECONF
> refers to the directory that has the sample files needed to set up
> the build environment. And that is it. As long as the sample files
> exist where it says they should be, why do you need the scripts to
> fail because the environment around the directory does not look
> like what you happen to expect? It is only the contents of the
> directory that matters. Or am I missing something?

We are trying to move towards standardizing build configuration
management. One step towards that goal is that config templates must
live in meta-some-layer/conf/templates, and aren't scattered around,
or generated on the fly. This rule only makes sense if there is some
way to enforce it, which is what this change does.

Alex


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

* RE: [OE-core] [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid
  2022-08-24 14:52         ` Alexander Kanavin
@ 2022-08-25  7:19           ` Peter Kjellerstedt
  2022-08-25  9:19             ` Alexander Kanavin
  0 siblings, 1 reply; 18+ messages in thread
From: Peter Kjellerstedt @ 2022-08-25  7:19 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-core, Alexander Kanavin

> -----Original Message-----
> From: Alexander Kanavin <alex.kanavin@gmail.com>
> Sent: den 24 augusti 2022 16:53
> To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> Cc: openembedded-core@lists.openembedded.org; Alexander Kanavin
> <alex@linutronix.de>
> Subject: Re: [OE-core] [PATCH 2/2] scripts/oe-setup-builddir: add a check
> that TEMPLATECONF is valid
> 
> On Wed, 24 Aug 2022 at 16:43, Peter Kjellerstedt
> <peter.kjellerstedt@axis.com> wrote:
> > We create the sample files in a small wrapper for oe-init-build-env
> > so that to the users, everything works just as described in the Yocto
> > documentation. And since the OE scripts expect TEMPLATECONF to be set
> > and contain sample files, that is what we create.
> 
> Actually they don't expect that. You can simply create the configs
> directly into the target build directory in your wrapper, and drop
> TEMPLATECONF altogether. Then the OE scripts will detect that the
> configs are already there and will skip the step of copying the
> templates.

Hmm, ok. I will have to look into that...

> > Sure, that is fine. But the expectation I have is that TEMPLATECONF
> > refers to the directory that has the sample files needed to set up
> > the build environment. And that is it. As long as the sample files
> > exist where it says they should be, why do you need the scripts to
> > fail because the environment around the directory does not look
> > like what you happen to expect? It is only the contents of the
> > directory that matters. Or am I missing something?
> 
> We are trying to move towards standardizing build configuration
> management. One step towards that goal is that config templates must
> live in meta-some-layer/conf/templates, and aren't scattered around,
> or generated on the fly. This rule only makes sense if there is some
> way to enforce it, which is what this change does.

Well, we gave up on the static templates almost immediately after we 
started using Yocto when we realized that they did not fit into our 
idea of being able to mix layers in different combinations in different 
builds. We rely on repo fetching the layers that are supposed to be part 
of the build, and then we generate a bblayers.conf.sample that matches 
the fetched layers.

> Alex

//Peter


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

* Re: [OE-core] [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid
  2022-08-25  7:19           ` Peter Kjellerstedt
@ 2022-08-25  9:19             ` Alexander Kanavin
  2022-08-25 19:41               ` Peter Kjellerstedt
  0 siblings, 1 reply; 18+ messages in thread
From: Alexander Kanavin @ 2022-08-25  9:19 UTC (permalink / raw)
  To: Peter Kjellerstedt; +Cc: openembedded-core, Alexander Kanavin, Richard Purdie

On Thu, 25 Aug 2022 at 09:19, Peter Kjellerstedt
<peter.kjellerstedt@axis.com> wrote:
 >
> > We are trying to move towards standardizing build configuration
> > management. One step towards that goal is that config templates must
> > live in meta-some-layer/conf/templates, and aren't scattered around,
> > or generated on the fly. This rule only makes sense if there is some
> > way to enforce it, which is what this change does.
>
> Well, we gave up on the static templates almost immediately after we
> started using Yocto when we realized that they did not fit into our
> idea of being able to mix layers in different combinations in different
> builds. We rely on repo fetching the layers that are supposed to be part
> of the build, and then we generate a bblayers.conf.sample that matches
> the fetched layers.

The static templates is only a starting point. The next step would be
to support prefabricated 'configuration fragments' stored inside
layers that can be dynamically added/removed into local.conf and/or a
distro definition, so ideas for the design and UI would be welcome.

Alex


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

* Re: [OE-core] [PATCH 1/2] meta/conf: move default configuration templates into meta/conf/templates/default
  2022-08-24 12:42 [PATCH 1/2] meta/conf: move default configuration templates into meta/conf/templates/default Alexander Kanavin
  2022-08-24 12:42 ` [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid Alexander Kanavin
@ 2022-08-25 13:37 ` Luca Ceresoli
  2022-08-25 13:45   ` Alexander Kanavin
  1 sibling, 1 reply; 18+ messages in thread
From: Luca Ceresoli @ 2022-08-25 13:37 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-core, Alexander Kanavin

Hello Alex,

On Wed, 24 Aug 2022 14:42:33 +0200
"Alexander Kanavin" <alex.kanavin@gmail.com> wrote:

> This sets the ground for standardizing (and enforcing) the location of
> configuration templates: let's start with the default one.
> 
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>

I have been trying to apply this patch, and it applies on oe-core, but
then combo-layer fails in picking it because poky has a different
.templateconf file. I'm not sure how this should be fixed, maybe the
patch should be done against meta-yocto (which has a .templateconf
identical to the one in poky)?

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


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

* Re: [OE-core] [PATCH 1/2] meta/conf: move default configuration templates into meta/conf/templates/default
  2022-08-25 13:37 ` [OE-core] [PATCH 1/2] meta/conf: move default configuration templates into meta/conf/templates/default Luca Ceresoli
@ 2022-08-25 13:45   ` Alexander Kanavin
  2022-08-26  9:04     ` Luca Ceresoli
  0 siblings, 1 reply; 18+ messages in thread
From: Alexander Kanavin @ 2022-08-25 13:45 UTC (permalink / raw)
  To: Luca Ceresoli; +Cc: OE-core, Alexander Kanavin

I've sent a separate patch for meta-yocto to poky@ list, does that help?

Alex

On Thu, 25 Aug 2022 at 15:37, Luca Ceresoli <luca.ceresoli@bootlin.com> wrote:
>
> Hello Alex,
>
> On Wed, 24 Aug 2022 14:42:33 +0200
> "Alexander Kanavin" <alex.kanavin@gmail.com> wrote:
>
> > This sets the ground for standardizing (and enforcing) the location of
> > configuration templates: let's start with the default one.
> >
> > Signed-off-by: Alexander Kanavin <alex@linutronix.de>
>
> I have been trying to apply this patch, and it applies on oe-core, but
> then combo-layer fails in picking it because poky has a different
> .templateconf file. I'm not sure how this should be fixed, maybe the
> patch should be done against meta-yocto (which has a .templateconf
> identical to the one in poky)?
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com


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

* RE: [OE-core] [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid
  2022-08-25  9:19             ` Alexander Kanavin
@ 2022-08-25 19:41               ` Peter Kjellerstedt
  0 siblings, 0 replies; 18+ messages in thread
From: Peter Kjellerstedt @ 2022-08-25 19:41 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-core, Alexander Kanavin, Richard Purdie

> -----Original Message-----
> From: Alexander Kanavin <alex.kanavin@gmail.com>
> Sent: den 25 augusti 2022 11:19
> To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> Cc: openembedded-core@lists.openembedded.org; Alexander Kanavin
> <alex@linutronix.de>; Richard Purdie <richard.purdie@linuxfoundation.org>
> Subject: Re: [OE-core] [PATCH 2/2] scripts/oe-setup-builddir: add a check
> that TEMPLATECONF is valid
> 
> On Thu, 25 Aug 2022 at 09:19, Peter Kjellerstedt
> <peter.kjellerstedt@axis.com> wrote:
>  >
> > > We are trying to move towards standardizing build configuration
> > > management. One step towards that goal is that config templates must
> > > live in meta-some-layer/conf/templates, and aren't scattered around,
> > > or generated on the fly. This rule only makes sense if there is some
> > > way to enforce it, which is what this change does.
> >
> > Well, we gave up on the static templates almost immediately after we
> > started using Yocto when we realized that they did not fit into our
> > idea of being able to mix layers in different combinations in different
> > builds. We rely on repo fetching the layers that are supposed to be part
> > of the build, and then we generate a bblayers.conf.sample that matches
> > the fetched layers.
> 
> The static templates is only a starting point. The next step would be
> to support prefabricated 'configuration fragments' stored inside
> layers that can be dynamically added/removed into local.conf and/or a
> distro definition, so ideas for the design and UI would be welcome.

Well, the way we have solved that is to allow a layer to contain 
conf/local.conf.sample.XX files (and also conf/conf-notes.txt.XX files) 
where XX is any number between 00 and 99. We also assume the sample 
files from meta-poky have XX == 50. Then when we generate our 
templateconf directory, we concatenate all these files ordered by XX 
(regardless of which layer they come from).

> 
> Alex

//Peter


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

* Re: [OE-core] [PATCH 1/2] meta/conf: move default configuration templates into meta/conf/templates/default
  2022-08-25 13:45   ` Alexander Kanavin
@ 2022-08-26  9:04     ` Luca Ceresoli
  2022-08-26  9:08       ` Alexander Kanavin
  0 siblings, 1 reply; 18+ messages in thread
From: Luca Ceresoli @ 2022-08-26  9:04 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core, Alexander Kanavin

Hi Alex,

On Thu, 25 Aug 2022 15:45:21 +0200
"Alexander Kanavin" <alex.kanavin@gmail.com> wrote:

> I've sent a separate patch for meta-yocto to poky@ list, does that help?

Oops, I can't find any such patch in the poky@ list.

Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


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

* Re: [OE-core] [PATCH 1/2] meta/conf: move default configuration templates into meta/conf/templates/default
  2022-08-26  9:04     ` Luca Ceresoli
@ 2022-08-26  9:08       ` Alexander Kanavin
  2022-08-26 10:27         ` Luca Ceresoli
  0 siblings, 1 reply; 18+ messages in thread
From: Alexander Kanavin @ 2022-08-26  9:08 UTC (permalink / raw)
  To: Luca Ceresoli; +Cc: OE-core, Alexander Kanavin

On Fri, 26 Aug 2022 at 11:04, Luca Ceresoli <luca.ceresoli@bootlin.com> wrote:
> > I've sent a separate patch for meta-yocto to poky@ list, does that help?
>
> Oops, I can't find any such patch in the poky@ list.

This:
https://lists.yoctoproject.org/g/poky/message/12870

Alex


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

* Re: [OE-core] [PATCH 1/2] meta/conf: move default configuration templates into meta/conf/templates/default
  2022-08-26  9:08       ` Alexander Kanavin
@ 2022-08-26 10:27         ` Luca Ceresoli
  2022-08-26 10:46           ` Alexander Kanavin
  0 siblings, 1 reply; 18+ messages in thread
From: Luca Ceresoli @ 2022-08-26 10:27 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core, Alexander Kanavin

Hi Alex,

On Fri, 26 Aug 2022 11:08:15 +0200
"Alexander Kanavin" <alex.kanavin@gmail.com> wrote:

> On Fri, 26 Aug 2022 at 11:04, Luca Ceresoli <luca.ceresoli@bootlin.com> wrote:
> > > I've sent a separate patch for meta-yocto to poky@ list, does that help?  
> >
> > Oops, I can't find any such patch in the poky@ list.  
> 
> This:
> https://lists.yoctoproject.org/g/poky/message/12870

Oh, no! I'm not receiving any poky@ emails anymore! The last I got is
from August 23. On the website my subscription seems OK, and there is
nothing in my spam folder. And, last but not least, the website does
not seem to allow downloading an email as an mbox file. :-(

I wrote to the help address.

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


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

* Re: [OE-core] [PATCH 1/2] meta/conf: move default configuration templates into meta/conf/templates/default
  2022-08-26 10:27         ` Luca Ceresoli
@ 2022-08-26 10:46           ` Alexander Kanavin
  0 siblings, 0 replies; 18+ messages in thread
From: Alexander Kanavin @ 2022-08-26 10:46 UTC (permalink / raw)
  To: Luca Ceresoli; +Cc: OE-core, Alexander Kanavin

On Fri, 26 Aug 2022 at 12:27, Luca Ceresoli <luca.ceresoli@bootlin.com> wrote:
> Oh, no! I'm not receiving any poky@ emails anymore! The last I got is
> from August 23. On the website my subscription seems OK, and there is
> nothing in my spam folder. And, last but not least, the website does
> not seem to allow downloading an email as an mbox file. :-(
>
> I wrote to the help address.

I sent the patch to you directly.

Perhaps you can first try to unsubscribe/resubscribe and send a test
email to poky@ ?

Alex


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

* Re: [OE-core] [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid
  2022-08-24 12:42 ` [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid Alexander Kanavin
  2022-08-24 13:58   ` [OE-core] " Peter Kjellerstedt
@ 2022-08-27  7:00   ` Luca Ceresoli
  2022-08-27 17:00     ` Alexander Kanavin
       [not found]     ` <170F423CB671B42F.16609@lists.openembedded.org>
  1 sibling, 2 replies; 18+ messages in thread
From: Luca Ceresoli @ 2022-08-27  7:00 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-core, Alexander Kanavin

Hi Alex,

On Wed, 24 Aug 2022 14:42:34 +0200
"Alexander Kanavin" <alex.kanavin@gmail.com> wrote:

> specifically that ../../layer.conf exists, and that second-from-last
> component in the path is 'templates'.
> 
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> ---
>  scripts/oe-setup-builddir | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
> index 975619789a..db26e3b138 100755
> --- a/scripts/oe-setup-builddir
> +++ b/scripts/oe-setup-builddir
> @@ -61,6 +61,11 @@ if [ -n "$TEMPLATECONF" ]; then
>              echo >&2 "Error: TEMPLATECONF value points to nonexistent directory '$TEMPLATECONF'"
>              exit 1
>          fi
> +        templatesdir=$(python3 -c "import sys; print(sys.argv[1].strip('/').split('/')[-2])" $TEMPLATECONF)
> +        if [ ! -f "$TEMPLATECONF/../../layer.conf" -o $templatesdir != "templates" ]; then
> +            echo >&2 "Error: TEMPLATECONF value must point to meta-some-layer/conf/templates/template-name"
> +            exit 1
> +        fi

This is making the AB fail:

https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/4140/steps/7/logs/stdio

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


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

* Re: [OE-core] [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid
  2022-08-27  7:00   ` Luca Ceresoli
@ 2022-08-27 17:00     ` Alexander Kanavin
       [not found]     ` <170F423CB671B42F.16609@lists.openembedded.org>
  1 sibling, 0 replies; 18+ messages in thread
From: Alexander Kanavin @ 2022-08-27 17:00 UTC (permalink / raw)
  To: Luca Ceresoli; +Cc: OE-core, Alexander Kanavin

On Sat, 27 Aug 2022 at 09:00, Luca Ceresoli <luca.ceresoli@bootlin.com> wrote:

> This is making the AB fail:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/4140/steps/7/logs/stdio

I believe this needs the patch for poky that moves the template to the
expected location, was it included? I just started a test with both
patches:
https://git.yoctoproject.org/poky-contrib/log/?h=akanavin/force-templateconf

and it is able to proceed fine:
https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/4144

Alex


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

* Re: [OE-core] [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid
       [not found]     ` <170F423CB671B42F.16609@lists.openembedded.org>
@ 2022-08-27 19:13       ` Alexander Kanavin
  0 siblings, 0 replies; 18+ messages in thread
From: Alexander Kanavin @ 2022-08-27 19:13 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: Luca Ceresoli, OE-core, Alexander Kanavin

On Sat, 27 Aug 2022 at 19:00, Alexander Kanavin via
lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org>
wrote:
> > This is making the AB fail:
> >
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/4140/steps/7/logs/stdio
>
> I believe this needs the patch for poky that moves the template to the
> expected location, was it included? I just started a test with both
> patches:
> https://git.yoctoproject.org/poky-contrib/log/?h=akanavin/force-templateconf
>
> and it is able to proceed fine:
> https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/4144

...except the change does break eSDKs, so that needs to be fixed first.

Alex


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

end of thread, other threads:[~2022-08-27 19:13 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-24 12:42 [PATCH 1/2] meta/conf: move default configuration templates into meta/conf/templates/default Alexander Kanavin
2022-08-24 12:42 ` [PATCH 2/2] scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid Alexander Kanavin
2022-08-24 13:58   ` [OE-core] " Peter Kjellerstedt
2022-08-24 14:08     ` Alexander Kanavin
2022-08-24 14:43       ` Peter Kjellerstedt
2022-08-24 14:52         ` Alexander Kanavin
2022-08-25  7:19           ` Peter Kjellerstedt
2022-08-25  9:19             ` Alexander Kanavin
2022-08-25 19:41               ` Peter Kjellerstedt
2022-08-27  7:00   ` Luca Ceresoli
2022-08-27 17:00     ` Alexander Kanavin
     [not found]     ` <170F423CB671B42F.16609@lists.openembedded.org>
2022-08-27 19:13       ` Alexander Kanavin
2022-08-25 13:37 ` [OE-core] [PATCH 1/2] meta/conf: move default configuration templates into meta/conf/templates/default Luca Ceresoli
2022-08-25 13:45   ` Alexander Kanavin
2022-08-26  9:04     ` Luca Ceresoli
2022-08-26  9:08       ` Alexander Kanavin
2022-08-26 10:27         ` Luca Ceresoli
2022-08-26 10:46           ` Alexander Kanavin

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.