All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] poky.conf: allow changes to DISTRO_VERSION, SDK_VERSION and MAINTAINER
@ 2022-09-22 12:24 Mikko Rapeli
  2022-09-22 12:24 ` [PATCH 2/2] git-describe.bbclass: add new class for "git describe --tags --allways --dirty" Mikko Rapeli
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Mikko Rapeli @ 2022-09-22 12:24 UTC (permalink / raw)
  To: openembedded-core; +Cc: Mikko Rapeli

For users who build their own variants of poky, they want to stay close
to poky.conf and thus use it, but would still like to change the
version details and maintainers to their own. With this change
these variables can be changed in local.conf, for example.

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 meta-poky/conf/distro/poky.conf | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta-poky/conf/distro/poky.conf b/meta-poky/conf/distro/poky.conf
index 856c88554d..6df71ce18a 100644
--- a/meta-poky/conf/distro/poky.conf
+++ b/meta-poky/conf/distro/poky.conf
@@ -1,12 +1,12 @@
 DISTRO = "poky"
 DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
-DISTRO_VERSION = "4.1+snapshot-${METADATA_REVISION}"
+DISTRO_VERSION ?= "4.1+snapshot-${METADATA_REVISION}"
 DISTRO_CODENAME = "langdale"
 SDK_VENDOR = "-pokysdk"
-SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${METADATA_REVISION}', 'snapshot')}"
+SDK_VERSION ?= "${@d.getVar('DISTRO_VERSION').replace('snapshot-${METADATA_REVISION}', 'snapshot')}"
 SDK_VERSION[vardepvalue] = "${SDK_VERSION}"
 
-MAINTAINER = "Poky <poky@lists.yoctoproject.org>"
+MAINTAINER ?= "Poky <poky@lists.yoctoproject.org>"
 
 TARGET_VENDOR = "-poky"
 
-- 
2.17.1



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

* [PATCH 2/2] git-describe.bbclass: add new class for "git describe --tags --allways --dirty"
  2022-09-22 12:24 [PATCH 1/2] poky.conf: allow changes to DISTRO_VERSION, SDK_VERSION and MAINTAINER Mikko Rapeli
@ 2022-09-22 12:24 ` Mikko Rapeli
  2022-09-22 12:43   ` [OE-core] " Ross Burton
  2022-09-22 13:16   ` Martin Jansa
  2022-09-22 12:30 ` [OE-core] [PATCH 1/2] poky.conf: allow changes to DISTRO_VERSION, SDK_VERSION and MAINTAINER Alexander Kanavin
  2022-09-22 12:42 ` Ross Burton
  2 siblings, 2 replies; 9+ messages in thread
From: Mikko Rapeli @ 2022-09-22 12:24 UTC (permalink / raw)
  To: openembedded-core; +Cc: Mikko Rapeli

Output from git_describe() function can then be used in various places
and from various git trees to create a user friend(lier) name to builds.
Examples where this could be used is BUILD_ID, SDK_VERSION and
IMAGE_VERSION_SUFFIX.

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 meta/classes/git-describe.bbclass | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 meta/classes/git-describe.bbclass

diff --git a/meta/classes/git-describe.bbclass b/meta/classes/git-describe.bbclass
new file mode 100644
index 0000000000..3a2b06b3fd
--- /dev/null
+++ b/meta/classes/git-describe.bbclass
@@ -0,0 +1,24 @@
+# Defines a simple function which calls 'git describe --tags --always --dirty'
+# on specified directory and returns the string.
+#
+# Can be used for example to easily generate a BUILD_ID in local.conf if
+# TOPDIR build directory is under the main git tree for the project:
+# INHERIT += "git-describe"
+# BUILD_ID = "${@git_describe("${TOPDIR}/../meta-mylayer", d)}"
+# # BUILD_ID to /etc/os-release
+# OS_RELEASE_FIELDS:append:pn-os-release = " BUILD_ID"
+# # Add os-release to all images
+# IMAGE_INSTALL:append = " os-release"
+# # BUILD_ID to image file name
+# IMAGE_VERSION_SUFFIX = "-${BUILD_ID}"
+# # BUILD_ID to SDK file names and paths
+# SDK_VERSION = "${BUILD_ID}"
+
+def git_describe(p, d):
+    import bb.process
+    try:
+        describe, _ = bb.process.run('git describe --tags --always --dirty', cwd=p)
+    except bb.process.ExecutionError:
+        describe = ''
+    return describe.strip()
+
-- 
2.17.1



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

* Re: [OE-core] [PATCH 1/2] poky.conf: allow changes to DISTRO_VERSION, SDK_VERSION and MAINTAINER
  2022-09-22 12:24 [PATCH 1/2] poky.conf: allow changes to DISTRO_VERSION, SDK_VERSION and MAINTAINER Mikko Rapeli
  2022-09-22 12:24 ` [PATCH 2/2] git-describe.bbclass: add new class for "git describe --tags --allways --dirty" Mikko Rapeli
@ 2022-09-22 12:30 ` Alexander Kanavin
  2022-09-22 12:42 ` Ross Burton
  2 siblings, 0 replies; 9+ messages in thread
From: Alexander Kanavin @ 2022-09-22 12:30 UTC (permalink / raw)
  To: Mikko Rapeli; +Cc: openembedded-core

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

This is for poky list, not core.

Alex

On Thu 22. Sep 2022 at 13.24, Mikko Rapeli <mikko.rapeli@linaro.org> wrote:

> For users who build their own variants of poky, they want to stay close
> to poky.conf and thus use it, but would still like to change the
> version details and maintainers to their own. With this change
> these variables can be changed in local.conf, for example.
>
> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> ---
>  meta-poky/conf/distro/poky.conf | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/meta-poky/conf/distro/poky.conf
> b/meta-poky/conf/distro/poky.conf
> index 856c88554d..6df71ce18a 100644
> --- a/meta-poky/conf/distro/poky.conf
> +++ b/meta-poky/conf/distro/poky.conf
> @@ -1,12 +1,12 @@
>  DISTRO = "poky"
>  DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
> -DISTRO_VERSION = "4.1+snapshot-${METADATA_REVISION}"
> +DISTRO_VERSION ?= "4.1+snapshot-${METADATA_REVISION}"
>  DISTRO_CODENAME = "langdale"
>  SDK_VENDOR = "-pokysdk"
> -SDK_VERSION =
> "${@d.getVar('DISTRO_VERSION').replace('snapshot-${METADATA_REVISION}',
> 'snapshot')}"
> +SDK_VERSION ?=
> "${@d.getVar('DISTRO_VERSION').replace('snapshot-${METADATA_REVISION}',
> 'snapshot')}"
>  SDK_VERSION[vardepvalue] = "${SDK_VERSION}"
>
> -MAINTAINER = "Poky <poky@lists.yoctoproject.org>"
> +MAINTAINER ?= "Poky <poky@lists.yoctoproject.org>"
>
>  TARGET_VENDOR = "-poky"
>
> --
> 2.17.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#170969):
> https://lists.openembedded.org/g/openembedded-core/message/170969
> Mute This Topic: https://lists.openembedded.org/mt/93847066/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

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

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

* Re: [OE-core] [PATCH 1/2] poky.conf: allow changes to DISTRO_VERSION, SDK_VERSION and MAINTAINER
  2022-09-22 12:24 [PATCH 1/2] poky.conf: allow changes to DISTRO_VERSION, SDK_VERSION and MAINTAINER Mikko Rapeli
  2022-09-22 12:24 ` [PATCH 2/2] git-describe.bbclass: add new class for "git describe --tags --allways --dirty" Mikko Rapeli
  2022-09-22 12:30 ` [OE-core] [PATCH 1/2] poky.conf: allow changes to DISTRO_VERSION, SDK_VERSION and MAINTAINER Alexander Kanavin
@ 2022-09-22 12:42 ` Ross Burton
  2022-09-22 12:45   ` Richard Purdie
  2 siblings, 1 reply; 9+ messages in thread
From: Ross Burton @ 2022-09-22 12:42 UTC (permalink / raw)
  To: mikko.rapeli@linaro.org; +Cc: openembedded-core@lists.openembedded.org

On 22 Sep 2022, at 13:24, Mikko Rapeli via lists.openembedded.org <mikko.rapeli=linaro.org@lists.openembedded.org> wrote:
> 
> For users who build their own variants of poky, they want to stay close
> to poky.conf and thus use it, but would still like to change the
> version details and maintainers to their own. With this change
> these variables can be changed in local.conf, for example.

If you want to name your distro, make your own distro.conf.

You can trivially just include poky.conf as the first thing it does, but I do recommend that everyone using Yocto in production create their own distro and not piggyback on Poky.  Poky can, and does, change over time as it’s a test distro for QA purposes, and you may not want what we add.

Ross

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

* Re: [OE-core] [PATCH 2/2] git-describe.bbclass: add new class for "git describe --tags --allways --dirty"
  2022-09-22 12:24 ` [PATCH 2/2] git-describe.bbclass: add new class for "git describe --tags --allways --dirty" Mikko Rapeli
@ 2022-09-22 12:43   ` Ross Burton
  2022-09-22 13:16   ` Martin Jansa
  1 sibling, 0 replies; 9+ messages in thread
From: Ross Burton @ 2022-09-22 12:43 UTC (permalink / raw)
  To: mikko.rapeli@linaro.org; +Cc: openembedded-core@lists.openembedded.org

On 22 Sep 2022, at 13:24, Mikko Rapeli via lists.openembedded.org <mikko.rapeli=linaro.org@lists.openembedded.org> wrote:
> 
> Output from git_describe() function can then be used in various places
> and from various git trees to create a user friend(lier) name to builds.
> Examples where this could be used is BUILD_ID, SDK_VERSION and
> IMAGE_VERSION_SUFFIX.

I do think this should be part of lib/oe/buildcfg.py.

Ross

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

* Re: [OE-core] [PATCH 1/2] poky.conf: allow changes to DISTRO_VERSION, SDK_VERSION and MAINTAINER
  2022-09-22 12:42 ` Ross Burton
@ 2022-09-22 12:45   ` Richard Purdie
  2022-09-22 13:43     ` Mikko Rapeli
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Purdie @ 2022-09-22 12:45 UTC (permalink / raw)
  To: Ross Burton, mikko.rapeli@linaro.org
  Cc: openembedded-core@lists.openembedded.org

On Thu, 2022-09-22 at 12:42 +0000, Ross Burton wrote:
> On 22 Sep 2022, at 13:24, Mikko Rapeli via lists.openembedded.org <mikko.rapeli=linaro.org@lists.openembedded.org> wrote:
> > 
> > For users who build their own variants of poky, they want to stay close
> > to poky.conf and thus use it, but would still like to change the
> > version details and maintainers to their own. With this change
> > these variables can be changed in local.conf, for example.
> 
> If you want to name your distro, make your own distro.conf.

poky-tiny and poky-altcfg do this.

> You can trivially just include poky.conf as the first thing it does,
> but I do recommend that everyone using Yocto in production create
> their own distro and not piggyback on Poky.  Poky can, and does,
> change over time as it’s a test distro for QA purposes, and you may
> not want what we add.

Just to be clear, you can create a distro.conf file even in a local
build directory where local.conf is.

We've kind of left the = assignments in poky.conf to nudge people in
this direction as creating a custom distro in local.conf isn't really
what we want to encourage.

Cheers,

Richard



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

* Re: [OE-core] [PATCH 2/2] git-describe.bbclass: add new class for "git describe --tags --allways --dirty"
  2022-09-22 12:24 ` [PATCH 2/2] git-describe.bbclass: add new class for "git describe --tags --allways --dirty" Mikko Rapeli
  2022-09-22 12:43   ` [OE-core] " Ross Burton
@ 2022-09-22 13:16   ` Martin Jansa
  1 sibling, 0 replies; 9+ messages in thread
From: Martin Jansa @ 2022-09-22 13:16 UTC (permalink / raw)
  To: Mikko Rapeli; +Cc: openembedded-core

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

It would be nice to somehow consolidate this new bbclass with
https://git.openembedded.org/meta-openembedded/tree/meta-oe/classes/gitpkgv.bbclass
https://git.openembedded.org/meta-openembedded/tree/meta-oe/classes/gitver.bbclass

and at least move the various git "wrapper" functions to lib/oe for better
reuse.

On Thu, Sep 22, 2022 at 2:24 PM Mikko Rapeli <mikko.rapeli@linaro.org>
wrote:

> Output from git_describe() function can then be used in various places
> and from various git trees to create a user friend(lier) name to builds.
> Examples where this could be used is BUILD_ID, SDK_VERSION and
> IMAGE_VERSION_SUFFIX.
>
> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> ---
>  meta/classes/git-describe.bbclass | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>  create mode 100644 meta/classes/git-describe.bbclass
>
> diff --git a/meta/classes/git-describe.bbclass
> b/meta/classes/git-describe.bbclass
> new file mode 100644
> index 0000000000..3a2b06b3fd
> --- /dev/null
> +++ b/meta/classes/git-describe.bbclass
> @@ -0,0 +1,24 @@
> +# Defines a simple function which calls 'git describe --tags --always
> --dirty'
> +# on specified directory and returns the string.
> +#
> +# Can be used for example to easily generate a BUILD_ID in local.conf if
> +# TOPDIR build directory is under the main git tree for the project:
> +# INHERIT += "git-describe"
> +# BUILD_ID = "${@git_describe("${TOPDIR}/../meta-mylayer", d)}"
> +# # BUILD_ID to /etc/os-release
> +# OS_RELEASE_FIELDS:append:pn-os-release = " BUILD_ID"
> +# # Add os-release to all images
> +# IMAGE_INSTALL:append = " os-release"
> +# # BUILD_ID to image file name
> +# IMAGE_VERSION_SUFFIX = "-${BUILD_ID}"
> +# # BUILD_ID to SDK file names and paths
> +# SDK_VERSION = "${BUILD_ID}"
> +
> +def git_describe(p, d):
> +    import bb.process
> +    try:
> +        describe, _ = bb.process.run('git describe --tags --always
> --dirty', cwd=p)
> +    except bb.process.ExecutionError:
> +        describe = ''
> +    return describe.strip()
> +
> --
> 2.17.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#170970):
> https://lists.openembedded.org/g/openembedded-core/message/170970
> Mute This Topic: https://lists.openembedded.org/mt/93847068/3617156
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> Martin.Jansa@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

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

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

* Re: [OE-core] [PATCH 1/2] poky.conf: allow changes to DISTRO_VERSION, SDK_VERSION and MAINTAINER
  2022-09-22 12:45   ` Richard Purdie
@ 2022-09-22 13:43     ` Mikko Rapeli
  2022-09-22 13:55       ` Peter Kjellerstedt
  0 siblings, 1 reply; 9+ messages in thread
From: Mikko Rapeli @ 2022-09-22 13:43 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Ross Burton, openembedded-core@lists.openembedded.org

Hi,

Thanks for the feedback. My product isn't a real one, it's actually
some meta layers to be used
by others to create real products.

The reason for using poky.conf distro is to stay as close to it as
possible. But I still need to know
what is the output of my builds vs. something else from poky.

If chaning these veriables from local.conf is bad practice, then I
need to find other possibilities, like
the custom distro config (maybe move away from kas). But the aim is to
do as few changes to
poky as possible.

Cheers,

-Mikko
Cheers,
-Mikko


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

* RE: [OE-core] [PATCH 1/2] poky.conf: allow changes to DISTRO_VERSION, SDK_VERSION and MAINTAINER
  2022-09-22 13:43     ` Mikko Rapeli
@ 2022-09-22 13:55       ` Peter Kjellerstedt
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Kjellerstedt @ 2022-09-22 13:55 UTC (permalink / raw)
  To: Mikko Rapeli, Richard Purdie
  Cc: Ross Burton, openembedded-core@lists.openembedded.org

> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-
> core@lists.openembedded.org> On Behalf Of Mikko Rapeli
> Sent: den 22 september 2022 15:44
> To: Richard Purdie <rpurdie@rpsys.net>
> Cc: Ross Burton <ross.burton@arm.com>; openembedded-
> core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH 1/2] poky.conf: allow changes to
> DISTRO_VERSION, SDK_VERSION and MAINTAINER
> 
> Hi,
> 
> Thanks for the feedback. My product isn't a real one, it's actually
> some meta layers to be used
> by others to create real products.
> 
> The reason for using poky.conf distro is to stay as close to it as
> possible. But I still need to know
> what is the output of my builds vs. something else from poky.
> 
> If chaning these veriables from local.conf is bad practice, then I
> need to find other possibilities, like
> the custom distro config (maybe move away from kas). But the aim is to
> do as few changes to
> poky as possible.
> 
> Cheers,
> 
> -Mikko
> Cheers,
> -Mikko

If all you want is for your values from your local.conf to be used, 
then you can use an override when setting the variables. In this 
case, since you want to override the values from the poky distro, 
why not use it as the override, e.g.:

DISTRO_VERSION:poky = "my-version"

//Peter


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

end of thread, other threads:[~2022-09-22 13:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-22 12:24 [PATCH 1/2] poky.conf: allow changes to DISTRO_VERSION, SDK_VERSION and MAINTAINER Mikko Rapeli
2022-09-22 12:24 ` [PATCH 2/2] git-describe.bbclass: add new class for "git describe --tags --allways --dirty" Mikko Rapeli
2022-09-22 12:43   ` [OE-core] " Ross Burton
2022-09-22 13:16   ` Martin Jansa
2022-09-22 12:30 ` [OE-core] [PATCH 1/2] poky.conf: allow changes to DISTRO_VERSION, SDK_VERSION and MAINTAINER Alexander Kanavin
2022-09-22 12:42 ` Ross Burton
2022-09-22 12:45   ` Richard Purdie
2022-09-22 13:43     ` Mikko Rapeli
2022-09-22 13:55       ` Peter Kjellerstedt

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.