Skip to contentSkip to conversation

poky.conf: allow changes to DISTRO_VERSION, SDK_VERSION and MAINTAINER

PATCH In review Mikko Rapeli 6 participants 9 messages Sep 22, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 poky.conf: allow changes to DISTRO_VERSION, SDK_VERSION and MAINTAINER

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.

---
 meta-poky/conf/distro/poky.conf | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta-poky/conf/distro/poky.conf +3 -3
index 856c88554d..6df71ce18a 100644
@@ -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 <[email protected]>"
+MAINTAINER ?= "Poky <[email protected]>"
 
 TARGET_VENDOR = "-poky"
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 git-describe.bbclass: add new class for "git describe --tags --allways --dirty"

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.

---
 meta/classes/git-describe.bbclass | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 meta/classes/git-describe.bbclass
meta/classes/git-describe.bbclass new file +24 -0
new file mode 100644
index 0000000000..3a2b06b3fd
@@ -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()
+
Signature · 1 line
2.17.1
#2 lore raw

Re: [OE-core] [PATCH 2/2] git-describe.bbclass: add new class for "git describe --tags --allways --dirty"

Quoted 5 lines · Mikko Rapeli via lists.openembedded.org

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

#3 lore raw

Re: [OE-core] [PATCH 2/2] git-describe.bbclass: add new class for "git describe --tags --allways --dirty"

In reply to Mikko Rapeli

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.

Quoted 59 lines · 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.

---
 meta/classes/git-describe.bbclass | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 meta/classes/git-describe.bbclass
meta/classes/git-describe.bbclass new file +24 -3
new file mode 100644
index 0000000000..3a2b06b3fd
@@ -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: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw
In reply to Mikko Rapeli

This is for poky list, not core.

Alex

Quoted 50 lines · 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.

---
 meta-poky/conf/distro/poky.conf | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta-poky/conf/distro/poky.conf +1 -2
index 856c88554d..6df71ce18a 100644
@@ -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}"

meta-poky/conf/distro/poky.conf +1 -2
-MAINTAINER = "Poky <[email protected]>"
+MAINTAINER ?= "Poky <[email protected]>"
 
 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: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#5 lore raw
In reply to Mikko Rapeli
Quoted 5 lines · Mikko Rapeli via lists.openembedded.org

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

#6 lore raw
Quoted 8 lines · Ross Burton
Quoted 5 lines · Mikko Rapeli via lists.openembedded.org

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.

Quoted 5 lines

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

#7 lore raw

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

#8 lore raw
Quoted 26 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Mikko Rapeli
Sent: den 22 september 2022 15:44
To: Richard Purdie <[email protected]>
Cc: Ross Burton <[email protected]>; openembedded- [email protected]
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.

Quoted 5 lines

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