From patchwork Tue Sep 7 13:22:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 1525365 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20210112 header.b=IRj5B74r; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=KPZvt9tV; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::13d; helo=mail-lf1-x13d.google.com; envelope-from=swupdate+bncbcx6venntaprblgp3weqmgqeukcj5ii@googlegroups.com; receiver=) Received: from mail-lf1-x13d.google.com (mail-lf1-x13d.google.com [IPv6:2a00:1450:4864:20::13d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H3mD10l5hz9sjJ for ; Tue, 7 Sep 2021 23:22:56 +1000 (AEST) Received: by mail-lf1-x13d.google.com with SMTP id y4-20020ac255a4000000b003e3d5adca9csf2661231lfg.6 for ; Tue, 07 Sep 2021 06:22:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1631020973; cv=pass; d=google.com; s=arc-20160816; b=eH8qX5aFkj/bspxHA0qbEmzryh+jon35vplimqBxaTEdeXGExKZda2DHH79DSuq0PE bDn90lAdMTXf3jFCG6RmOCF22BoCRIQaLW272yRznHh9zkN2jGy4HpekknBN6WgMfJ6J Su5JVwOsc2sq+cBp4txVVhjnFRc+xQrHlM0F2tKxPRDpSC0auDFTNU/TI2VW8wgZ9uAP m4ubpspssDIqKqtCw046T1Qr70gmyEnd9+KCOxU5hTlKlnthQ/0UT7Q4YLtx/fnvpCvV IyZlLDq9X3EJwqfgVWaiU+xMuE99zOWbGu0hu0vQDvisizJuQs02z5ydTukShLZSPvDB EjmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature :dkim-signature; bh=P5znwnqZ21r0L/9UhVpqYXF7Z3zjdU63d1nD5T7DulU=; b=vTJJ1TM53kkZcE58fnDeaRPEGyjQJfpyQePHZ5FlcY1E3Bo8UwadJLgkShJI7utD4Y S5E97XWB7dPAQFUsjh7E/dBcU0Idb3ptJgXUOol+Lt++PPUWrPR99ss3aTIgRXPTaSRT gkWq8r6DUDZpfcKeyQda5qzxqVJYjvX59mDhhgMxj34fKFweGNwP471Ad5qTcFVoeLQ3 etZpbJMssVfZpf4GgiweNdIPPSnAGdAg7Co4kUnmf3dl0dBLrlJPDwoQTcR3lhf9e/Ep AYoQxjwqGdFgBvvo8/2ZjRmdDgFo5s2czOIbumVzjrxb2A3GS8FwPELHkYq4t98PPpCD kdgA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FWDWiqM8; spf=pass (google.com: domain of adrian.freihofer@gmail.com designates 2a00:1450:4864:20::635 as permitted sender) smtp.mailfrom=adrian.freihofer@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=P5znwnqZ21r0L/9UhVpqYXF7Z3zjdU63d1nD5T7DulU=; b=IRj5B74r6wVcOMZ8EmXvF9rvS0Qaipy0p0QxxTfXnqbLodA7xxsuaVN1RRAqt5xQDE +KTc/lPtr8p+DxBBpc8lRoAtJRdmeGUWW6ciX2Lam+ZAq2Hxra7E+n7V25Z7WG8burgI 3ZtxxFR8B3heBf5M3BKBrjogidRh94ROp6f29+R16ZIzXsc0SkznB5mGvms6XHW3hpyQ y/zdWObsQvuZGF6eW28c2luCBiJcCpMLJh1B7sq2O4Eo39WXgtqnm6OgndWbEIqf1VSs D/FvNkyUpMGhjrnnTAt395lQ0RDUeW0VZGvg3g5/jq83Qt/9TtqWCD0NVCR4cI2yAmxi Sc/A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=P5znwnqZ21r0L/9UhVpqYXF7Z3zjdU63d1nD5T7DulU=; b=KPZvt9tVS+13VjqU2Usbx34p9B9rw7gxA5BxTvNlwNKomxZAvLZu/BCfaacp8+Lqzt jx6HTA+NnRPSz0xcx9glSBiTP+cbLdNQ1ijcevmzX70Df8bVQrxOgiRzMA8I+4HyGEn3 IYX2FH7OHPbuPSFeV6pMWF8bwR83QAOCJQac39MGmiiEdjxaGkwG6ZD197XU+VYJ4R8p Lkv5lWGg9wJlmTtHo5+7FgKBf0NgojiaevP6zNYRA1oPbINq5+23IWO4paLBsn808TjV zhjrkCZh/xlhVbeOdX98rcIVEw5agi3U7IIDVewbphRII270MwhBdtgAXSt20k6I/iKL 6prw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=P5znwnqZ21r0L/9UhVpqYXF7Z3zjdU63d1nD5T7DulU=; b=VEIXfDVqDYKpRKxGmZpXOzczX7pU8+ohCW4ktwrmAataFtXRmdHjnKlwEzFHUnZa9P +W5New2AzT7UP2auPuiHDO/9NzwxsGcyWBPb3DyuaxNbNp+piXTONt41ZWIFuBoW1NuV k6Wf6RmBxmF+/68Buj4i5ksRrKSqlNolJbP+AT1D+U5Luj0Mhww3KHK8ZEcykuaC2/x5 oGmklZX9btvSTVaQGUs/+hQmCVd3PgX2tZXme59C5bCmQd/Asy7j30hyKvO99en0oBtq 32Z+qqS9YNfSNEbUv9Rn5iZZRsLWIueIA+d9CSiwc6WoyM92vCrzVlWqbf3jzGQArA/R mZ0A== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM532XStJvcVjPw9a5QtJCX6rd2TVmXdwib8cCdR2ZypdeTyuB2y0g 5GqzlGuLc9kloiv07/UBJQQ= X-Google-Smtp-Source: ABdhPJy1J2SSgktwMtdGSV+beM5x5hK3Qp3kwcW5MypHWsVq0P1uz5rIEmg4zYe8a2UA6XFftNLxQA== X-Received: by 2002:a05:6512:30b:: with SMTP id t11mr13114725lfp.166.1631020972828; Tue, 07 Sep 2021 06:22:52 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:651c:503:: with SMTP id o3ls1713574ljp.0.gmail; Tue, 07 Sep 2021 06:22:51 -0700 (PDT) X-Received: by 2002:a2e:8816:: with SMTP id x22mr14850215ljh.264.1631020971687; Tue, 07 Sep 2021 06:22:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631020971; cv=none; d=google.com; s=arc-20160816; b=LpocVGdPNceTV1m1ekMXzUSvW5pBI49MwnYBI4zxhvALARbtJiQOxtLItifUKdqasD DYGG5p/tzNIAGzvcdk8pLIt7f2VrcGtQ7XagarBvWAl80HMBg/zCoARQgvTVXYsxjo5c +oPZp//InGxerMKWLluzYrYV0MKTng9josv2ocGKfiQkosXOyScUIeS3bIttZCJhrEv1 lHU/j+2Ien1BMftVWkMGFQCCY7jbnvgUvooVpF44YIu1SfPoSmYHcpXPKDJyDc/wdcEc 3f/Yp2OGmhxp+GQSvKkYPavsFUZIOjsrSnCrLdK4FnoSDwnvzoAtlogR7Ndid+WPtq7H es6Q== 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:date:subject:cc:to:from:dkim-signature; bh=GhFuM+Cr8k7EEQnGgU3MYLQxgOS+vOJKy7jJSqNXWoc=; b=Qsn1xRHo49c1U1S2Q63m0h632fwSkxVeAioT2u+W9VW0MeYEUSL3hACk3Hf1thuTHd 51tQRe5feBjhP8iNw8/cddRoEQCZ28bIbG20+eFoa3pD53MiodWyn/RNwldpT0LMud5b 3rIoD+w4/PfLJA4CPp7KOsMBVJe+db8dDKcKO1RLUZLDd/gQZmZM8XbcCNDrwgmpJfE9 4cZ7kVf6kIosujCzof42ZaXb4BKF851pm0NLf/5AaIKMITt06YddL1z9DlVTTyvFIqab XjdJ79HXAarrjfbVcQFHUCRCHFz1BuvGpQcU92lcbRz2KwSHvE7+w3aqg3PNiyys/8Be ADcQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FWDWiqM8; spf=pass (google.com: domain of adrian.freihofer@gmail.com designates 2a00:1450:4864:20::635 as permitted sender) smtp.mailfrom=adrian.freihofer@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com. [2a00:1450:4864:20::635]) by gmr-mx.google.com with ESMTPS id i12si591355lfc.10.2021.09.07.06.22.51 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Sep 2021 06:22:51 -0700 (PDT) Received-SPF: pass (google.com: domain of adrian.freihofer@gmail.com designates 2a00:1450:4864:20::635 as permitted sender) client-ip=2a00:1450:4864:20::635; Received: by mail-ej1-x635.google.com with SMTP id x11so19732155ejv.0 for ; Tue, 07 Sep 2021 06:22:51 -0700 (PDT) X-Received: by 2002:a17:906:c52:: with SMTP id t18mr18437021ejf.148.1631020971044; Tue, 07 Sep 2021 06:22:51 -0700 (PDT) Received: from md2ramxc.ad001.siemens.net ([62.32.0.69]) by smtp.gmail.com with ESMTPSA id g9sm560184edk.54.2021.09.07.06.22.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 06:22:50 -0700 (PDT) From: Adrian Freihofer To: swupdate@googlegroups.com Cc: Adrian Freihofer Subject: [swupdate] [meta-swupdate][PATCH dunfell+ v2 1/6] swupdate-image: get do_swuimage vardeps Date: Tue, 7 Sep 2021 15:22:35 +0200 Message-Id: <20210907132240.2987302-2-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210907132240.2987302-1-adrian.freihofer@siemens.com> References: <20210907132240.2987302-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Original-Sender: adrian.freihofer@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FWDWiqM8; spf=pass (google.com: domain of adrian.freihofer@gmail.com designates 2a00:1450:4864:20::635 as permitted sender) smtp.mailfrom=adrian.freihofer@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Read all variables from sw-description file and add them to the vardeps of the do_swuimage task. Bitbake cannot know that the do_swuimage task which evaluates the templated sw-description file needs to be executed if a variable which is refered by the sw-description file but not by the recipe itself. --- classes/swupdate-image.bbclass | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/classes/swupdate-image.bbclass b/classes/swupdate-image.bbclass index 618b438..f25f1f0 100644 --- a/classes/swupdate-image.bbclass +++ b/classes/swupdate-image.bbclass @@ -32,3 +32,26 @@ python do_swupdate_copy_swdescription() { do_swupdate_copy_swdescription[nostamp] = "1" addtask swupdate_copy_swdescription before do_image_complete after do_unpack addtask swuimage after do_swupdate_copy_swdescription do_image_complete before do_build + +# Read all variables from sw-description file and add them to the vardeps of the do_swuimage task. Bitbake +# cannot know that the do_swuimage task which evaluates the templated sw-description file needs to be executed +# if a variable which is refered by the sw-description file but not by the recipe itself. +def swupdate_find_bitbake_variables(d): + import re + + vardeps = '' + filespath = d.getVar('FILESPATH') + sw_desc_path = bb.utils.which(filespath, "sw-description") + try: + with open(sw_desc_path, "r") as f: + content_in = f.read() + var_re = r"@@([^@].+)@@" + m = re.findall(var_re, content_in) + if m: + vardeps = ' '.join(m) + except IOError: + # Since this runs at parse time where we don't know if this will be used later on we cannot threat this as an error + bb.debug(1, "Cannot find sw-description. Please extend FILESPATH (%s)" % filespath) + return vardeps + +do_swuimage[vardeps] ?= "${@swupdate_find_bitbake_variables(d)}"