From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6815578895823142912 X-Received: by 2002:a17:906:c4f:: with SMTP id t15mr25793226ejf.193.1587544594733; Wed, 22 Apr 2020 01:36:34 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:906:8384:: with SMTP id p4ls631292ejx.3.gmail; Wed, 22 Apr 2020 01:36:34 -0700 (PDT) X-Google-Smtp-Source: APiQypKlv682bPtlR9nEb1zoxx+i4wFe70IfSXmLq0fQCWNHAlWTSno6uRtFXO8kMOr4jLoSYSZx X-Received: by 2002:a17:907:210d:: with SMTP id qn13mr25465583ejb.376.1587544594117; Wed, 22 Apr 2020 01:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587544594; cv=none; d=google.com; s=arc-20160816; b=FsOs+RWLKMpR1lzPwVlY6tkOyDi2TYN0lgN+ekh1YdHUIXTwzo7GE3/6WeyTFnEXDN 1Da8+FQUFE+BShDTN9w9Mvfeuzwhdu3TgTh5zfbuk4SH0hC2UNJrZTXLst6sMe3UqpQ7 +HtZCv/6FDoA+W8gdotyknpuK9aiYjh6v+XbIwpZU/l5RgcBTQAXplb3OJ+wwIUvcMMm HA3zArD77E5SDv1UjXSHbQoWxVR1g+iEH/uAfIszXWdHAazg2xCGWeIQ1iqJszr6Mp7p LMWiFCtPKjbrppA74rF87GGTYAVJxA3CmMndQgGNm4eYPylvSUDLi2bMPiH1AlQgdMMS GNZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject; bh=IFChAv8eMjNcH8J3V3gS55dfebALcb7swiP5mMNqFWQ=; b=IRK6kgIMl0Y5MOLikpRBl+NIlhK0HT4oo8MrWmw4yJLH9augduC5lGal6WZehp0J16 PvA7B8I6B6re9lFWEEIyiZbocaqzlmEJ3IiBxgGfjyzXJ/okH4S/HCmV2jrmCo24ewEC 7RcNKgDJBsmaUp6xrOtGYX6t5JyK+DcxG3Km5gcL/YHfctCmEETc3IxB/yKUjUPxWlIZ 4lNy7ae+u9Z55h2oh1cnvCwa3N4wtmNRG3Q/N8IQCdcogu0FQf1j7YIjWhRd4cfqVddn vE1ZUiZ2p743MOY/o6pd3YMEmbCxfpMy2RUZoj+w2MDl/YgZZpWtmt4R9Cdl5SH4CJH0 FbFA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=quirin.gylstorff@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id v18si311833eju.1.2020.04.22.01.36.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Apr 2020 01:36:34 -0700 (PDT) Received-SPF: pass (google.com: domain of quirin.gylstorff@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=quirin.gylstorff@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id 03M8aXKA012615 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Apr 2020 10:36:33 +0200 Received: from [139.22.46.195] ([139.22.46.195]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 03M8aWdM025999; Wed, 22 Apr 2020 10:36:32 +0200 Subject: Re: [PATCH v2] classes/image-postproc: Add image version To: isar-users@googlegroups.com, SCHILD HENNING Z003BPMR , Cedric Hombourger References: <20200421150134.30325-1-Quirin.Gylstorff@siemens.com> <20200421204939.0ddaa020@md1za8fc.ad001.siemens.net> From: Gylstorff Quirin Message-ID: <04aa3786-daa7-dbe0-026c-7b69be75e225@siemens.com> Date: Wed, 22 Apr 2020 10:36:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TUID: T7NMN6llI1/C 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" > wrote: > > > From: Quirin Gylstorff > > > > > 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 > > > --- > >  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 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 > . > To view this discussion on the web visit > https://groups.google.com/d/msgid/isar-users/f8bdcad7-3efe-485a-85ee-fda69c2d616f%40googlegroups.com > .