* [PATCH] classes/image_postprocessing: Add variant version to os_release @ 2020-04-14 14:46 Q. Gylstorff 2020-04-14 14:55 ` Jan Kiszka 0 siblings, 1 reply; 9+ messages in thread From: Q. Gylstorff @ 2020-04-14 14:46 UTC (permalink / raw) To: isar-users; +Cc: Quirin Gylstorff From: Quirin Gylstorff <quirin.gylstorff@siemens.com> to identify the image version in a human readable way . Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com> --- meta/classes/image-postproc-extension.bbclass | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/meta/classes/image-postproc-extension.bbclass b/meta/classes/image-postproc-extension.bbclass index 7280202..1091fa4 100644 --- a/meta/classes/image-postproc-extension.bbclass +++ b/meta/classes/image-postproc-extension.bbclass @@ -4,10 +4,12 @@ update_etc_os_release() { OS_RELEASE_BUILD_ID="" OS_RELEASE_VARIANT="" + OS_RELEASE_VARIANT_VERSION="" while true; do case "$1" in --build-id) OS_RELEASE_BUILD_ID=$2; shift ;; --variant) OS_RELEASE_VARIANT=$2; shift ;; + --version) OS_RELEASE_VARIANT_VERSION=$2; shift ;; -*) bbfatal "$0: invalid option specified: $1" ;; *) break ;; esac @@ -24,6 +26,11 @@ update_etc_os_release() { echo "VARIANT=\"${OS_RELEASE_VARIANT}\"" | \ sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' fi + if [ -n "${OS_RELEASE_VARIANT_VERSION}" ]; then + sudo sed -i '/^ISAR_IMAGE_VERSION=.*/d' '${IMAGE_ROOTFS}/etc/os-release' + echo "VARIANT_VERSION=\"${PV}\"" | \ + sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' + fi } ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_configure" @@ -43,7 +50,7 @@ ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_mark" image_postprocess_mark() { BUILD_ID=$(get_build_id) update_etc_os_release \ - --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" + --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" --version "${PV}" } ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_machine_id" -- 2.20.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] classes/image_postprocessing: Add variant version to os_release 2020-04-14 14:46 [PATCH] classes/image_postprocessing: Add variant version to os_release Q. Gylstorff @ 2020-04-14 14:55 ` Jan Kiszka 2020-04-21 15:01 ` [PATCH v2] classes/image-postproc: Add image version Q. Gylstorff 0 siblings, 1 reply; 9+ messages in thread From: Jan Kiszka @ 2020-04-14 14:55 UTC (permalink / raw) To: [ext] Q. Gylstorff, isar-users On 14.04.20 16:46, [ext] Q. Gylstorff wrote: > From: Quirin Gylstorff <quirin.gylstorff@siemens.com> > > to identify the image version in a human readable way > . No need to hectically type the commit message - full sentences would have been good, also stating the the recipe version of the image is propagated into os-release here. > > Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com> > --- > meta/classes/image-postproc-extension.bbclass | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/meta/classes/image-postproc-extension.bbclass b/meta/classes/image-postproc-extension.bbclass > index 7280202..1091fa4 100644 > --- a/meta/classes/image-postproc-extension.bbclass > +++ b/meta/classes/image-postproc-extension.bbclass > @@ -4,10 +4,12 @@ > update_etc_os_release() { > OS_RELEASE_BUILD_ID="" > OS_RELEASE_VARIANT="" > + OS_RELEASE_VARIANT_VERSION="" > while true; do > case "$1" in > --build-id) OS_RELEASE_BUILD_ID=$2; shift ;; > --variant) OS_RELEASE_VARIANT=$2; shift ;; > + --version) OS_RELEASE_VARIANT_VERSION=$2; shift ;; > -*) bbfatal "$0: invalid option specified: $1" ;; > *) break ;; > esac > @@ -24,6 +26,11 @@ update_etc_os_release() { > echo "VARIANT=\"${OS_RELEASE_VARIANT}\"" | \ > sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' > fi > + if [ -n "${OS_RELEASE_VARIANT_VERSION}" ]; then > + sudo sed -i '/^ISAR_IMAGE_VERSION=.*/d' '${IMAGE_ROOTFS}/etc/os-release' > + echo "VARIANT_VERSION=\"${PV}\"" | \ > + sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' > + fi > } > > ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_configure" > @@ -43,7 +50,7 @@ ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_mark" > image_postprocess_mark() { > BUILD_ID=$(get_build_id) > update_etc_os_release \ > - --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" > + --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" --version "${PV}" Looking for a reason this should not be hard-coded to be PV, rather defaulting to it, but I didn't find one so far. > } > > ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_machine_id" > Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2] classes/image-postproc: Add image version 2020-04-14 14:55 ` Jan Kiszka @ 2020-04-21 15:01 ` Q. Gylstorff 2020-04-21 18:49 ` Henning Schild 2020-05-07 19:36 ` Baurzhan Ismagulov 0 siblings, 2 replies; 9+ messages in thread From: Q. Gylstorff @ 2020-04-21 15:01 UTC (permalink / raw) To: isar-users; +Cc: Quirin Gylstorff From: Quirin Gylstorff <quirin.gylstorff@siemens.com> Add the image version as additional identifier to /etc/os-release. This allows in a update scenario an easier identification of the the currently used image. Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com> --- meta/classes/image-postproc-extension.bbclass | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/meta/classes/image-postproc-extension.bbclass b/meta/classes/image-postproc-extension.bbclass index 7280202..1091fa4 100644 --- a/meta/classes/image-postproc-extension.bbclass +++ b/meta/classes/image-postproc-extension.bbclass @@ -4,10 +4,12 @@ update_etc_os_release() { OS_RELEASE_BUILD_ID="" OS_RELEASE_VARIANT="" + OS_RELEASE_VARIANT_VERSION="" while true; do case "$1" in --build-id) OS_RELEASE_BUILD_ID=$2; shift ;; --variant) OS_RELEASE_VARIANT=$2; shift ;; + --version) OS_RELEASE_VARIANT_VERSION=$2; shift ;; -*) bbfatal "$0: invalid option specified: $1" ;; *) break ;; esac @@ -24,6 +26,11 @@ update_etc_os_release() { echo "VARIANT=\"${OS_RELEASE_VARIANT}\"" | \ sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' fi + if [ -n "${OS_RELEASE_VARIANT_VERSION}" ]; then + sudo sed -i '/^ISAR_IMAGE_VERSION=.*/d' '${IMAGE_ROOTFS}/etc/os-release' + echo "VARIANT_VERSION=\"${PV}\"" | \ + sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' + fi } ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_configure" @@ -43,7 +50,7 @@ ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_mark" image_postprocess_mark() { BUILD_ID=$(get_build_id) update_etc_os_release \ - --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" + --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" --version "${PV}" } ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_machine_id" -- 2.20.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] classes/image-postproc: Add image version 2020-04-21 15:01 ` [PATCH v2] classes/image-postproc: Add image version Q. Gylstorff @ 2020-04-21 18:49 ` Henning Schild 2020-04-21 18:57 ` Henning Schild 2020-04-21 19:28 ` cedric_hombourger 2020-05-07 19:36 ` Baurzhan Ismagulov 1 sibling, 2 replies; 9+ messages in thread From: Henning Schild @ 2020-04-21 18:49 UTC (permalink / raw) To: [ext] Q. Gylstorff; +Cc: isar-users On Tue, 21 Apr 2020 17:01:34 +0200 "[ext] Q. Gylstorff" <Quirin.Gylstorff@siemens.com> wrote: > From: Quirin Gylstorff <quirin.gylstorff@siemens.com> > > Add the image version as additional identifier to /etc/os-release. > This allows in a update scenario an easier identification of the > the currently used image. > > Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com> > --- > meta/classes/image-postproc-extension.bbclass | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/meta/classes/image-postproc-extension.bbclass > b/meta/classes/image-postproc-extension.bbclass index > 7280202..1091fa4 100644 --- > a/meta/classes/image-postproc-extension.bbclass +++ > b/meta/classes/image-postproc-extension.bbclass @@ -4,10 +4,12 @@ > update_etc_os_release() { > OS_RELEASE_BUILD_ID="" > OS_RELEASE_VARIANT="" > + OS_RELEASE_VARIANT_VERSION="" > while true; do > case "$1" in > --build-id) OS_RELEASE_BUILD_ID=$2; shift ;; > --variant) OS_RELEASE_VARIANT=$2; shift ;; > + --version) OS_RELEASE_VARIANT_VERSION=$2; shift ;; > -*) bbfatal "$0: invalid option specified: $1" ;; > *) break ;; > esac > @@ -24,6 +26,11 @@ update_etc_os_release() { > echo "VARIANT=\"${OS_RELEASE_VARIANT}\"" | \ > sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' > fi > + if [ -n "${OS_RELEASE_VARIANT_VERSION}" ]; then > + sudo sed -i '/^ISAR_IMAGE_VERSION=.*/d' > '${IMAGE_ROOTFS}/etc/os-release' > + echo "VARIANT_VERSION=\"${PV}\"" | \ > + sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' Looking at https://www.freedesktop.org/software/systemd/man/os-release.html VARIANT_VERSION does not show up in the list of "The following OS identifications parameters may be set using os-release" So i would conclude we may not use it. I would suggest either finding a variable that we may use and debian does not use yet. Or the layer with the requirement looks at BUILD_ID and sets a custom ISAR_RELEASE_CMD to inject their clue. Here is an example where people decided to include the date of a build ISAR_RELEASE_CMD = "echo $(git -C ${LAYERDIR_isar-XXX} describe --long --dirty --always) $(date --utc --rfc-3339=seconds)" Henning > + fi > } > > ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_configure" > @@ -43,7 +50,7 @@ ROOTFS_POSTPROCESS_COMMAND =+ > "image_postprocess_mark" image_postprocess_mark() { > BUILD_ID=$(get_build_id) > update_etc_os_release \ > - --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" > + --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" > --version "${PV}" } > > ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_machine_id" ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] classes/image-postproc: Add image version 2020-04-21 18:49 ` Henning Schild @ 2020-04-21 18:57 ` Henning Schild 2020-04-21 19:28 ` cedric_hombourger 1 sibling, 0 replies; 9+ messages in thread From: Henning Schild @ 2020-04-21 18:57 UTC (permalink / raw) To: [ext] Q. Gylstorff; +Cc: isar-users On Tue, 21 Apr 2020 20:49:39 +0200 "[ext] Henning Schild" <henning.schild@siemens.com> wrote: > On Tue, 21 Apr 2020 17:01:34 +0200 > "[ext] Q. Gylstorff" <Quirin.Gylstorff@siemens.com> wrote: > > > From: Quirin Gylstorff <quirin.gylstorff@siemens.com> > > > > Add the image version as additional identifier to /etc/os-release. > > This allows in a update scenario an easier identification of the > > the currently used image. > > > > Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com> > > --- > > meta/classes/image-postproc-extension.bbclass | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/meta/classes/image-postproc-extension.bbclass > > b/meta/classes/image-postproc-extension.bbclass index > > 7280202..1091fa4 100644 --- > > a/meta/classes/image-postproc-extension.bbclass +++ > > b/meta/classes/image-postproc-extension.bbclass @@ -4,10 +4,12 @@ > > update_etc_os_release() { > > OS_RELEASE_BUILD_ID="" > > OS_RELEASE_VARIANT="" > > + OS_RELEASE_VARIANT_VERSION="" > > while true; do > > case "$1" in > > --build-id) OS_RELEASE_BUILD_ID=$2; shift ;; > > --variant) OS_RELEASE_VARIANT=$2; shift ;; > > + --version) OS_RELEASE_VARIANT_VERSION=$2; shift ;; > > -*) bbfatal "$0: invalid option specified: $1" ;; > > *) break ;; > > esac > > @@ -24,6 +26,11 @@ update_etc_os_release() { > > echo "VARIANT=\"${OS_RELEASE_VARIANT}\"" | \ > > sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' > > fi > > + if [ -n "${OS_RELEASE_VARIANT_VERSION}" ]; then > > + sudo sed -i '/^ISAR_IMAGE_VERSION=.*/d' > > '${IMAGE_ROOTFS}/etc/os-release' > > + echo "VARIANT_VERSION=\"${PV}\"" | \ > > + sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' > > Looking at > https://www.freedesktop.org/software/systemd/man/os-release.html > > VARIANT_VERSION does not show up in the list of > "The following OS identifications parameters may be set using > os-release" > > So i would conclude we may not use it. I would suggest either finding > a variable that we may use and debian does not use yet. > > Or the layer with the requirement looks at BUILD_ID and sets a custom > ISAR_RELEASE_CMD to inject their clue. > Here is an example where people decided to include the date of a build > > ISAR_RELEASE_CMD = "echo $(git -C ${LAYERDIR_isar-XXX} describe --long > --dirty --always) $(date --utc --rfc-3339=seconds)" In fact the string one would want to match is probably the full BUILD_ID, if you append your own stuff and do substring matching you might be looking at multiple BUILD_IDs that all claim to be the same "version" because you are not bumping the version with every commit. Henning > Henning > > > + fi > > } > > > > ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_configure" > > @@ -43,7 +50,7 @@ ROOTFS_POSTPROCESS_COMMAND =+ > > "image_postprocess_mark" image_postprocess_mark() { > > BUILD_ID=$(get_build_id) > > update_etc_os_release \ > > - --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" > > + --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" > > --version "${PV}" } > > > > ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_machine_id" > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] classes/image-postproc: Add image version 2020-04-21 18:49 ` Henning Schild 2020-04-21 18:57 ` Henning Schild @ 2020-04-21 19:28 ` cedric_hombourger 2020-04-22 8:36 ` Gylstorff Quirin 1 sibling, 1 reply; 9+ messages in thread From: cedric_hombourger @ 2020-04-21 19:28 UTC (permalink / raw) To: isar-users [-- Attachment #1.1: Type: text/plain, Size: 4057 bytes --] On Tuesday, April 21, 2020 at 8:49:43 PM UTC+2, Henning Schild wrote: > > On Tue, 21 Apr 2020 17:01:34 +0200 > "[ext] Q. Gylstorff" <Quirin....@siemens.com <javascript:>> wrote: > > > From: Quirin Gylstorff <quirin....@siemens.com <javascript:>> > > > > Add the image version as additional identifier to /etc/os-release. > > This allows in a update scenario an easier identification of the > > the currently used image. > > > > Signed-off-by: Quirin Gylstorff <quirin....@siemens.com <javascript:>> > > --- > > meta/classes/image-postproc-extension.bbclass | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/meta/classes/image-postproc-extension.bbclass > > b/meta/classes/image-postproc-extension.bbclass index > > 7280202..1091fa4 100644 --- > > a/meta/classes/image-postproc-extension.bbclass +++ > > b/meta/classes/image-postproc-extension.bbclass @@ -4,10 +4,12 @@ > > update_etc_os_release() { > > OS_RELEASE_BUILD_ID="" > > OS_RELEASE_VARIANT="" > > + OS_RELEASE_VARIANT_VERSION="" > > while true; do > > case "$1" in > > --build-id) OS_RELEASE_BUILD_ID=$2; shift ;; > > --variant) OS_RELEASE_VARIANT=$2; shift ;; > > + --version) OS_RELEASE_VARIANT_VERSION=$2; shift ;; > > -*) bbfatal "$0: invalid option specified: $1" ;; > > *) break ;; > > esac > > @@ -24,6 +26,11 @@ update_etc_os_release() { > > echo "VARIANT=\"${OS_RELEASE_VARIANT}\"" | \ > > sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' > > fi > > + if [ -n "${OS_RELEASE_VARIANT_VERSION}" ]; then > > + sudo sed -i '/^ISAR_IMAGE_VERSION=.*/d' > > '${IMAGE_ROOTFS}/etc/os-release' > > + echo "VARIANT_VERSION=\"${PV}\"" | \ > > + sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' > > Looking at > https://www.freedesktop.org/software/systemd/man/os-release.html > > VARIANT_VERSION does not show up in the list of > "The following OS identifications parameters may be set using > os-release" > > So i would conclude we may not use it. I would suggest either finding a > variable that we may use and debian does not use yet. > for everyone's benefits, Henning and I were discussing this offline. from my perspective, the freedesktop folks aren't that rigid. 2 quotes from them: (1) The file is extensible? Awesome! I want a new field XYZ= in it! Sure, it's extensible, and we are happy if distributions extend it. Please prefix your keys with your distribution's name however. (2) If you are working on a small/embedded distribution, or a legacy-free distribution we encourage you to adopt only this file and not establish any other per-distro release file. I am guilty of adding custom fields in the Debian-based distro we are producing over here. I had missed the recommendation to prefix new keys with the name of the distro. That's a good thing to do for sure. With that said, I am not saying that Isar should or should not add custom entries there. Just wanted to say that it is not forbidden Ref: http://0pointer.de/blog/projects/os-release (link found from: http://0pointer.de/blog/projects/os-release) Cedric > Or the layer with the requirement looks at BUILD_ID and sets a custom > ISAR_RELEASE_CMD to inject their clue. > Here is an example where people decided to include the date of a build > > ISAR_RELEASE_CMD = "echo $(git -C ${LAYERDIR_isar-XXX} describe --long > --dirty --always) $(date --utc --rfc-3339=seconds)" > > Henning > > > + fi > > } > > > > ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_configure" > > @@ -43,7 +50,7 @@ ROOTFS_POSTPROCESS_COMMAND =+ > > "image_postprocess_mark" image_postprocess_mark() { > > BUILD_ID=$(get_build_id) > > update_etc_os_release \ > > - --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" > > + --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" > > --version "${PV}" } > > > > ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_machine_id" > > [-- Attachment #1.2: Type: text/html, Size: 6406 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] classes/image-postproc: Add image version 2020-04-21 19:28 ` cedric_hombourger @ 2020-04-22 8:36 ` Gylstorff Quirin 2020-04-22 10:51 ` Henning Schild 0 siblings, 1 reply; 9+ messages in thread From: Gylstorff Quirin @ 2020-04-22 8:36 UTC (permalink / raw) To: isar-users, SCHILD HENNING Z003BPMR, Cedric Hombourger On 4/21/20 9:28 PM, cedric_hombourger@mentor.com wrote: > > > On Tuesday, April 21, 2020 at 8:49:43 PM UTC+2, Henning Schild wrote: > > On Tue, 21 Apr 2020 17:01:34 +0200 > "[ext] Q. Gylstorff" <Quirin....@siemens.com <javascript:>> wrote: > > > From: Quirin Gylstorff <quirin....@siemens.com <javascript:>> > > > > Add the image version as additional identifier to /etc/os-release. > > This allows in a update scenario an easier identification of the > > the currently used image. > > > > Signed-off-by: Quirin Gylstorff <quirin....@siemens.com > <javascript:>> > > --- > > meta/classes/image-postproc-extension.bbclass | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/meta/classes/image-postproc-extension.bbclass > > b/meta/classes/image-postproc-extension.bbclass index > > 7280202..1091fa4 100644 --- > > a/meta/classes/image-postproc-extension.bbclass +++ > > b/meta/classes/image-postproc-extension.bbclass @@ -4,10 +4,12 @@ > > update_etc_os_release() { > > OS_RELEASE_BUILD_ID="" > > OS_RELEASE_VARIANT="" > > + OS_RELEASE_VARIANT_VERSION="" > > while true; do > > case "$1" in > > --build-id) OS_RELEASE_BUILD_ID=$2; shift ;; > > --variant) OS_RELEASE_VARIANT=$2; shift ;; > > + --version) OS_RELEASE_VARIANT_VERSION=$2; shift ;; > > -*) bbfatal "$0: invalid option specified: $1" ;; > > *) break ;; > > esac > > @@ -24,6 +26,11 @@ update_etc_os_release() { > > echo "VARIANT=\"${OS_RELEASE_VARIANT}\"" | \ > > sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' > > fi > > + if [ -n "${OS_RELEASE_VARIANT_VERSION}" ]; then > > + sudo sed -i '/^ISAR_IMAGE_VERSION=.*/d' > > '${IMAGE_ROOTFS}/etc/os-release' > > + echo "VARIANT_VERSION=\"${PV}\"" | \ > > + sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' > > Looking at > https://www.freedesktop.org/software/systemd/man/os-release.html > <https://www.freedesktop.org/software/systemd/man/os-release.html> > > VARIANT_VERSION does not show up in the list of > "The following OS identifications parameters may be set using > os-release" > > So i would conclude we may not use it. I would suggest either finding a > variable that we may use and debian does not use yet. > > > for everyone's benefits, Henning and I were discussing this offline. > from my perspective, the freedesktop folks aren't that rigid. 2 quotes > from them: > > (1) The file is extensible? Awesome! I want a new field XYZ= in it! > Sure, it's extensible, and we are happy if distributions extend it. > Please prefix your keys with your distribution's name however. > > (2) If you are working on a small/embedded distribution, or a > legacy-free distribution we encourage you to adopt only this file and > not establish any other per-distro release file. > > I am guilty of adding custom fields in the Debian-based distro we are > producing over here. I had missed the recommendation to prefix new keys > with the name of the distro. That's a good thing to do for sure. > > With that said, I am not saying that Isar should or should not add > custom entries there. Just wanted to say that it is not forbidden > Ref: http://0pointer.de/blog/projects/os-release (link found from: > http://0pointer.de/blog/projects/os-release) > > Cedric I see that as a human readable version identifier for an image. Not every one has git at hand ;-). We can add our own ids with ISAR_ in front of it, if it is better that way as written in [1]: `Operating system vendors may extend the file format and introduce new fields. It is highly recommended to prefix new fields with an OS specific name in order to avoid name clashes. Applications reading this file must ignore unknown fields. Example: "DEBIAN_BTS="debbugs://bugs.debian.org/""` As the only hard requirement regarding this file is that application ignore unknown items. [1]: https://www.freedesktop.org/software/systemd/man/os-release.html Quirin > > > Or the layer with the requirement looks at BUILD_ID and sets a custom > ISAR_RELEASE_CMD to inject their clue. > Here is an example where people decided to include the date of a build > > ISAR_RELEASE_CMD = "echo $(git -C ${LAYERDIR_isar-XXX} describe --long > --dirty --always) $(date --utc --rfc-3339=seconds)" > > Henning > > > + fi > > } > > > > ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_configure" > > @@ -43,7 +50,7 @@ ROOTFS_POSTPROCESS_COMMAND =+ > > "image_postprocess_mark" image_postprocess_mark() { > > BUILD_ID=$(get_build_id) > > update_etc_os_release \ > > - --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" > > + --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" > > --version "${PV}" } > > > > ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_machine_id" > > -- > You received this message because you are subscribed to the Google > Groups "isar-users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to isar-users+unsubscribe@googlegroups.com > <mailto:isar-users+unsubscribe@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/isar-users/f8bdcad7-3efe-485a-85ee-fda69c2d616f%40googlegroups.com > <https://groups.google.com/d/msgid/isar-users/f8bdcad7-3efe-485a-85ee-fda69c2d616f%40googlegroups.com?utm_medium=email&utm_source=footer>. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] classes/image-postproc: Add image version 2020-04-22 8:36 ` Gylstorff Quirin @ 2020-04-22 10:51 ` Henning Schild 0 siblings, 0 replies; 9+ messages in thread From: Henning Schild @ 2020-04-22 10:51 UTC (permalink / raw) To: Gylstorff Quirin; +Cc: isar-users, Cedric Hombourger On Wed, 22 Apr 2020 10:36:32 +0200 Gylstorff Quirin <quirin.gylstorff@siemens.com> wrote: > On 4/21/20 9:28 PM, cedric_hombourger@mentor.com wrote: > > > > > > On Tuesday, April 21, 2020 at 8:49:43 PM UTC+2, Henning Schild > > wrote: > > > > On Tue, 21 Apr 2020 17:01:34 +0200 > > "[ext] Q. Gylstorff" <Quirin....@siemens.com <javascript:>> > > wrote: > > > From: Quirin Gylstorff <quirin....@siemens.com <javascript:>> > > > > > > Add the image version as additional identifier to > > > /etc/os-release. This allows in a update scenario an easier > > > identification of the the currently used image. > > > > > > Signed-off-by: Quirin Gylstorff <quirin....@siemens.com > > <javascript:>> > > > --- > > > meta/classes/image-postproc-extension.bbclass | 9 ++++++++- > > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > > > diff --git a/meta/classes/image-postproc-extension.bbclass > > > b/meta/classes/image-postproc-extension.bbclass index > > > 7280202..1091fa4 100644 --- > > > a/meta/classes/image-postproc-extension.bbclass +++ > > > b/meta/classes/image-postproc-extension.bbclass @@ -4,10 > > > +4,12 @@ update_etc_os_release() { > > > OS_RELEASE_BUILD_ID="" > > > OS_RELEASE_VARIANT="" > > > + OS_RELEASE_VARIANT_VERSION="" > > > while true; do > > > case "$1" in > > > --build-id) OS_RELEASE_BUILD_ID=$2; shift ;; > > > --variant) OS_RELEASE_VARIANT=$2; shift ;; > > > + --version) OS_RELEASE_VARIANT_VERSION=$2; shift ;; > > > -*) bbfatal "$0: invalid option specified: $1" ;; > > > *) break ;; > > > esac > > > @@ -24,6 +26,11 @@ update_etc_os_release() { > > > echo "VARIANT=\"${OS_RELEASE_VARIANT}\"" | \ > > > sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' > > > fi > > > + if [ -n "${OS_RELEASE_VARIANT_VERSION}" ]; then > > > + sudo sed -i '/^ISAR_IMAGE_VERSION=.*/d' > > > '${IMAGE_ROOTFS}/etc/os-release' > > > + echo "VARIANT_VERSION=\"${PV}\"" | \ > > > + sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' > > > > Looking at > > https://www.freedesktop.org/software/systemd/man/os-release.html > > <https://www.freedesktop.org/software/systemd/man/os-release.html> > > > > VARIANT_VERSION does not show up in the list of > > "The following OS identifications parameters may be set using > > os-release" > > > > So i would conclude we may not use it. I would suggest either > > finding a variable that we may use and debian does not use yet. > > > > > > for everyone's benefits, Henning and I were discussing this > > offline. from my perspective, the freedesktop folks aren't that > > rigid. 2 quotes from them: > > > > (1) The file is extensible? Awesome! I want a new field XYZ= in it! > > Sure, it's extensible, and we are happy if distributions extend it. > > Please prefix your keys with your distribution's name however. > > > > (2) If you are working on a small/embedded distribution, or a > > legacy-free distribution we encourage you to adopt only this file > > and not establish any other per-distro release file. > > > > I am guilty of adding custom fields in the Debian-based distro we > > are producing over here. I had missed the recommendation to prefix > > new keys with the name of the distro. That's a good thing to do for > > sure. > > > > With that said, I am not saying that Isar should or should not add > > custom entries there. Just wanted to say that it is not forbidden > > Ref: http://0pointer.de/blog/projects/os-release (link found from: > > http://0pointer.de/blog/projects/os-release) > > > > Cedric > > I see that as a human readable version identifier for an > image. Not every one has git at hand ;-). The CMD can be anything, use "hg" or "echo 42". > We can add our own ids with > ISAR_ in front of it, if it is better > that way as written in [1]: > > `Operating system vendors may extend the file format and introduce > new fields. It is highly recommended to prefix new fields with an OS > specific name in order to avoid name clashes. Applications reading > this file must ignore unknown fields. Example: > "DEBIAN_BTS="debbugs://bugs.debian.org/""` > > As the only hard requirement regarding this file is that application > ignore unknown items. > > [1]: https://www.freedesktop.org/software/systemd/man/os-release.html True, my interpretation of the "opposite" of "may" might be too harsh when i suggest that opposite to be "must not". I just wanted to raise awareness that this is a "standardized" file and care needs to be taken. There probably are a lot of scripts out there, that "source" the file and could get very confused when they loose their own variables or env that way, because the file is full of unexpected stuff. And yes, they technically "must ignore" ... still another reason to be careful. Henning > Quirin > > > > > > > Or the layer with the requirement looks at BUILD_ID and sets a > > custom ISAR_RELEASE_CMD to inject their clue. > > Here is an example where people decided to include the date of > > a build > > > > ISAR_RELEASE_CMD = "echo $(git -C ${LAYERDIR_isar-XXX} describe > > --long --dirty --always) $(date --utc --rfc-3339=seconds)" > > > > Henning > > > > > + fi > > > } > > > > > > ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_configure" > > > @@ -43,7 +50,7 @@ ROOTFS_POSTPROCESS_COMMAND =+ > > > "image_postprocess_mark" image_postprocess_mark() { > > > BUILD_ID=$(get_build_id) > > > update_etc_os_release \ > > > - --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" > > > + --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" > > > --version "${PV}" } > > > > > > ROOTFS_POSTPROCESS_COMMAND =+ > > > "image_postprocess_machine_id" > > > > -- > > You received this message because you are subscribed to the Google > > Groups "isar-users" group. > > To unsubscribe from this group and stop receiving emails from it, > > send an email to isar-users+unsubscribe@googlegroups.com > > <mailto:isar-users+unsubscribe@googlegroups.com>. > > To view this discussion on the web visit > > https://groups.google.com/d/msgid/isar-users/f8bdcad7-3efe-485a-85ee-fda69c2d616f%40googlegroups.com > > <https://groups.google.com/d/msgid/isar-users/f8bdcad7-3efe-485a-85ee-fda69c2d616f%40googlegroups.com?utm_medium=email&utm_source=footer>. > > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] classes/image-postproc: Add image version 2020-04-21 15:01 ` [PATCH v2] classes/image-postproc: Add image version Q. Gylstorff 2020-04-21 18:49 ` Henning Schild @ 2020-05-07 19:36 ` Baurzhan Ismagulov 1 sibling, 0 replies; 9+ messages in thread From: Baurzhan Ismagulov @ 2020-05-07 19:36 UTC (permalink / raw) To: isar-users On Tue, Apr 21, 2020 at 05:01:34PM +0200, Q. Gylstorff wrote: > Add the image version as additional identifier to /etc/os-release. > This allows in a update scenario an easier identification of the > the currently used image. Applied to next, thanks. With kind regards, Baurzhan. ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2020-05-07 19:37 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-04-14 14:46 [PATCH] classes/image_postprocessing: Add variant version to os_release Q. Gylstorff 2020-04-14 14:55 ` Jan Kiszka 2020-04-21 15:01 ` [PATCH v2] classes/image-postproc: Add image version Q. Gylstorff 2020-04-21 18:49 ` Henning Schild 2020-04-21 18:57 ` Henning Schild 2020-04-21 19:28 ` cedric_hombourger 2020-04-22 8:36 ` Gylstorff Quirin 2020-04-22 10:51 ` Henning Schild 2020-05-07 19:36 ` Baurzhan Ismagulov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox