From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6572151760657317888 X-Received: by 2002:aa7:d998:: with SMTP id u24-v6mr837618eds.5.1532094242882; Fri, 20 Jul 2018 06:44:02 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a50:bd84:: with SMTP id y4-v6ls1201829edh.5.gmail; Fri, 20 Jul 2018 06:44:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdnSA8BKSK9SA8dxJdO+s7E+CYZk0QglpfYAWIJ5YDczjMszMocQDe3pHiVetHIYL1DWqTq X-Received: by 2002:aa7:c413:: with SMTP id j19-v6mr840032edq.8.1532094242369; Fri, 20 Jul 2018 06:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532094242; cv=none; d=google.com; s=arc-20160816; b=CMPwhqllVUPNJwVLCFV3sfTRsOF43P4hTXySVqdjOO3JqxmqR29sm/PETZcWzTzNqr 5OA3GkQki933sZzhtmHMN9a+v7Wr8lEQ2V+aQIhpz9kjnBbpN8ElqtwAj6joebjBzFxY 8SvhGICprcElOl38+Xi7EhNiapitk4HxTa5pd5KTz60sYhEmNq592xZV7eMKVdkrS8s4 z4h5D0rq4FLmUCv86yasKJWhBWtGsgrqycaIUrnnJWwrwnEmEbdxpKrI5nYP558Pjp30 PjzgSCI8a2uwGD9qObdQNbGc6tuWb8HIW/3telwef8tgJ0l+KZIVawOC2qXVzycjL0nq ClDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=Y6xKwo6BntyBu4w+PITMWwWM+9eA9VBI8dvL7E+PJuQ=; b=RnqXYuBi1R2SkeQbm3NTmiWAR/9kC9ev0St/84z2+mlC5UW7GnmzTpZM88Oa6vq7Vp Mc+sY78pSD2qx/5Pd8gI/akUP8EYAlHoHaMz8lpFMujdrSSHaQbg+sOYRNWOSaRyHPAc Za3ntVvY5Mv8N1Inv+gpneq4j1+pGzEOZMVfJuJMpBgdej6sv5A5COR4rTdWXW6+8z3J JSALhPyuKpt4xVUELi79GRlPVdkXBZl8wX3JQ9u4ShHGsndYdi9DFCT8O6DJjkykaDZM 0/De+oBHbmmLqpTmC3u2/SVsGMG/Rg6nct/jvit92VeTiObptGNHyPRrKEKuKUUN4stk jzDw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id x4-v6si27338edi.5.2018.07.20.06.44.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jul 2018 06:44:02 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w6KDi1GM006989 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Jul 2018 15:44:01 +0200 Received: from md1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id w6KDi1i7031250; Fri, 20 Jul 2018 15:44:01 +0200 Date: Fri, 20 Jul 2018 15:44:00 +0200 From: Henning Schild To: "Maxim Yu. Osipov" Cc: , Jan Kiszka Subject: Re: [PATCH] meta/image: allow customization of command we use fo BUILD_ID Message-ID: <20180720154400.7463c3b5@md1pvb1c.ad001.siemens.net> In-Reply-To: References: <4cb847ca-f5ce-6765-602e-9d5263746a3f@ilbers.de> <20180703073928.25857-1-henning.schild@siemens.com> <20180720143812.4366ba27@md1pvb1c.ad001.siemens.net> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: rntwlV21o59B My bad, i forgot to version those patches ... twice. Henning Am Fri, 20 Jul 2018 16:17:01 +0300 schrieb "Maxim Yu. Osipov" : > On 07/20/2018 03:38 PM, Henning Schild wrote: > > Please have a look at this one. It fixes a commit that is currently > > already in next. > > Sorry, I was confused by your last email in this thread: > > <------- > -------- Forwarded Message -------- > Subject: Re: [PATCH] meta/image: allow customization of git command > we use fo BUILD_ID > Date: Tue, 3 Jul 2018 09:50:09 +0200 > From: Henning Schild > To: isar-users@googlegroups.com > CC: Maxim Yu . Osipov , Jan Kiszka > > > obsolete, do not even look at that one. Sorry that the new one is > missing the v2 in the subject. > > <--------- > > So, I'm testing your patch dated by Tue, 3 Jul 2018 09:39:28 +0200. > > Maxim. > > > Henning > > > > Am Tue, 3 Jul 2018 09:39:28 +0200 > > schrieb Henning Schild : > > > >> One of the previous patches introduced the feature to leave some > >> build system information in the rootfs. The git command to derive > >> that information was kept pretty repository agnostic. > >> > >> This patch makes the command Isar-specific and allows users to > >> customize the command to their needs if they use a different > >> tagging scheme in their repository, or if they do not use git at > >> all. > >> > >> Signed-off-by: Henning Schild > >> --- > >> meta-isar/recipes-core/images/isar-image-base.bb | 3 ++- > >> meta/classes/image.bbclass | 27 > >> ++++++++++++------------ 2 files changed, 16 insertions(+), 14 > >> deletions(-) > >> > >> diff --git a/meta-isar/recipes-core/images/isar-image-base.bb > >> b/meta-isar/recipes-core/images/isar-image-base.bb index > >> c72bfdb..a24aa3e 100644 --- > >> a/meta-isar/recipes-core/images/isar-image-base.bb +++ > >> b/meta-isar/recipes-core/images/isar-image-base.bb @@ -24,7 +24,8 > >> @@ IMAGE_TRANSIENT_PACKAGES += "isar-cfg-localepurge" > >> WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}" > >> > >> -ISAR_GIT_RELEASE_PATH ?= "${LAYERDIR_isar}" > >> +ISAR_RELEASE_CMD_DEFAULT = "git -C ${LAYERDIR_isar} describe > >> --tags --dirty --match 'v[0-9].[0-9]*'" +ISAR_RELEASE_CMD ?= > >> "${ISAR_RELEASE_CMD_DEFAULT}" > >> do_rootfs[root_cleandirs] = "${IMAGE_ROOTFS} \ > >> ${IMAGE_ROOTFS}/isar-apt" > >> diff --git a/meta/classes/image.bbclass > >> b/meta/classes/image.bbclass index 7935b69..077c550 100644 > >> --- a/meta/classes/image.bbclass > >> +++ b/meta/classes/image.bbclass > >> @@ -34,24 +34,25 @@ def get_rootfs_size(d): > >> > >> return base_size + rootfs_extra * 1024 > >> > >> -# we assume that one git commit can describe the whole image, so > >> you should be -# using submodules, kas, or something like that > >> -# set ISAR_GIT_RELEASE_PATH to that one "most significant" layer > >> -# when not using git, override do_mark_rootfs > >> +# here we call a command that should describe your whole build > >> system, +# this could be "git describe" or something similar. > >> +# set ISAR_RELEASE_CMD to customize, or override do_mark_rootfs to > >> do something +# completely different > >> def get_build_id(d): > >> import subprocess > >> if (len(d.getVar("BBLAYERS", True).strip().split(' ')) != 2 > >> and > >> - (d.getVar("ISAR_GIT_RELEASE_PATH", True) == > >> - d.getVar("LAYERDIR_isar", True))): > >> + (d.getVar("ISAR_RELEASE_CMD", True) == > >> + d.getVar("ISAR_RELEASE_CMD_DEFAULT", True))): > >> bb.warn('You are using external layers that will not be > >> considered' + > >> - ' in the build_id. Considder setting > >> ISAR_GIT_RELEASE_PATH.') > >> - base = ["git", "-C", d.getVar("ISAR_GIT_RELEASE_PATH", True)] > >> - if (0 == subprocess.call(base + ["rev-parse"])): > >> - v = subprocess.check_output(base + > >> - ["describe", "--long", > >> "--dirty", > >> - "--always"], > >> universal_newlines=True) > >> + ' in the build_id. Consider changing > >> ISAR_RELEASE_CMD.') > >> + cmd = d.getVar("ISAR_RELEASE_CMD", True) > >> + try: > >> + v = subprocess.check_output(cmd, shell=True, > >> universal_newlines=True) return v.rstrip() > >> - return "" > >> + except subprocess.CalledProcessError as e: > >> + bb.warn('\"%s\" returned %d, returning empty build_id' % > >> + (e.cmd, e.returncode)) > >> + return "" > >> > >> python set_image_size () { > >> rootfs_size = get_rootfs_size(d) > > > >