From patchwork Tue Feb 16 09:52:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 1440860 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::13c; helo=mail-lf1-x13c.google.com; envelope-from=swupdate+bncbda3zhwu2icrb7vlv2aqmgqeuu43wjq@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=Gnka1Csu; dkim-atps=neutral Received: from mail-lf1-x13c.google.com (mail-lf1-x13c.google.com [IPv6:2a00:1450:4864:20::13c]) (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 4Dfx9g0Dgzz9sVR for ; Tue, 16 Feb 2021 20:53:08 +1100 (AEDT) Received: by mail-lf1-x13c.google.com with SMTP id z18sf4209531lfh.21 for ; Tue, 16 Feb 2021 01:53:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613469182; cv=pass; d=google.com; s=arc-20160816; b=EqtHdPaC3LMAPhN6UhG0dAyDSqWaeA5qXSCcJpd6G7eRQXUrHP9ljc2y6pk0RHG5no K1K4SUmv3UsujwtGKYWdClpw1wwAg55pzx58/SIKaskjgpzHYtUvK4BNdn5B8SKHpFiT T5lTuv6lOuGx6gnbQIYfj6nPJOxzSVOAImPq9BfYAv3MzD5019zE3ohf2CPuiyGx8rzE EKMUiI8e6dJLRP+8LUnGgs/JUj4nfDLOQGGmTg+yKoxeSZkDcFn4d1QgumcMobyBwIUq P1PbOpR9vgi4UFXnGVdJdpQ9O0+tyGGny9mvst1qO82tHeRyhDes5QseRUYpDTRO5DEl tF/w== 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:references:in-reply-to:message-id :date:subject:to:from:mime-version:sender:dkim-signature; bh=GSSskQwQuRCdAs7qapm27IIJPBnTWaXBY+ge3Rx8CpU=; b=p2nDEk1rUeS+OqkZhavAo/0UZFn/Lkt2+noCZrSSzefwUUgmjS/ZvfR5XPniFeijsD q5hWc/ZBgFABlAknpzGHT7jAmxQGSCmkUPxek83XFM0z0GChZ+gkBlI6qhy6k+JFCqM+ yEKLYYk48NxsU9O//9DoTinBJDdDiqFx/FfIygaTXhG+247IEaQ0bhqCvRVv3SbcCT4w uvwtHwVdiKk5hxRbuwPupN6jorEqTvGO5wZX1JtTxt3fQXo7obIxJFytF2F/Tj6Rtn6O fW+4AkjC9oPsncUoqxnCgqlOn/PRpy3CHdjYTdZ4iVQkUD9TpkLy3pBh0vXIreYjCoPl k2Bg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of agust@denx.de) smtp.mailfrom=agust@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=GSSskQwQuRCdAs7qapm27IIJPBnTWaXBY+ge3Rx8CpU=; b=Gnka1Csu1wwzERFmajxKx+EkaAw06xUOxSqJD/tU4v3UOmsFPqUMsme8gtsCPt/6O9 oZM8QX4jjMmvmv1lxlQfjMWZUhk9Rp7F+oZBJvSqVV4i9IWVruzaFwj2gxyhgkoBR+OL Nt36pm/CRkFv4kkPjfa2TFiIc4Y0bD5lnAV+1CLojp9KRR0CAyv3N8EkUNSa39a2W5Gy SY/b1srnJjP6XsLIcehiM/qsPaeZNZ0kyQkbJ5/C1cSSQGplnMQf82sYf6CySIZI/B7s vj5khRwDtN0aXxLgTRKcI0iDX+2WYvfYay3ceW3vpCLcWkk7V1mTm5RPKmctUE6ySz0X 4GDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:subject:date :message-id:in-reply-to:references: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=GSSskQwQuRCdAs7qapm27IIJPBnTWaXBY+ge3Rx8CpU=; b=gWtNsT7qZBoguRXoAeE1z7H1Pd1AAvV6KP6ADb6+qjCThWXrMSSjAt26ITIHCOlWGU OkWBQe+v3686SxLD88z8kGZIZRvoYiKvVl9fOjDdlqCAp2ihWEzWW5CdeOKZ4T+LB6+v fx/lrFdP4C3rjI3F18M+O8gjc7KW44afReQD0qJX1AeGJfKJ/ls3URKj0bFzExNHPoMN AxWs2PjNSUgJskuxMipKbFNmk8hg29aABajKjdaqoW3949IgaC2l9oEpc9MXrh/YxIA8 uSS1Pp0ub6gImhZTa5F6ITZzIfEeyXyUMz6S2mL0baMlrsawdmcCCPpPd2QNjjS5/jpK g2ig== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM531dJ5H/0eFjgnJk3fIlJncViBrXNUV+ehLyeU3F4kfCWeBBWZqG I1FFhAlGHldEgT88/28FTzM= X-Google-Smtp-Source: ABdhPJz+FZwt0FHp0+RHAg+ZwmX1/6Rzxx8y4MU8KT9jSc7hc6JBAz4U/fIls5IekUQTVLi+mv406g== X-Received: by 2002:a05:6512:304:: with SMTP id t4mr2042125lfp.262.1613469182665; Tue, 16 Feb 2021 01:53:02 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 2002:a2e:90d2:: with SMTP id o18ls3383735ljg.1.gmail; Tue, 16 Feb 2021 01:53:01 -0800 (PST) X-Received: by 2002:a2e:596:: with SMTP id 144mr11800100ljf.258.1613469181671; Tue, 16 Feb 2021 01:53:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613469181; cv=none; d=google.com; s=arc-20160816; b=tz5TIUF6EPnoKsOTDJQzgAQp3mJ9m3p9XtHaE/HYSBtXhLUHizy1rHyIEPfaNoSHve Fgik2UXJWoIsc0kK6Irk/+rPW35GJ3xhYEEeQY+hdq4BaeheU5p9+aLsPBFE2HDmKRLB XaXtVb79u4oAjVZjKGjPSrAHXPUWw8dnhLBMOD3SwZ1+fwgNxCRlxAMdMkhJ/XrzsjK6 N25MyzIcoykDp4QGCHQwVxVPOiWmGq4Mn9QNWu/b8Ulu3wXOAGCEgKFPE2F+IThz1f9T 9zGQwheF/aLmd/ie/5x/7VtLjFx1ClbbfiWBw/9XaFApiWsVjohM2X6JJSZjRRRz6Aoq DUcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from; bh=Ci3Pbfg0YaPFXGEBKxsdBA1PmxbxSYCeg5nxb04fJC8=; b=qgEGEbfqfuGMyj6QJPU5HHL0vY+6pKQAC21lwQ/c0dxj69vJIQB2FyhN7jSdSBbeo/ SuI78iuVfxVzmWc2tbUiKETtvPGMXyjHJFIC8kiKj1I5IxJsFSMwwG5Ly0+S8EFWLlm8 aVc8ete8r3GOnfndXB5S15pUe/cl1RKWd79JAk6GPQaDl3okNoIzjIS+r5KbuxMbLZg0 6aVo3j3KWXiSX/1Ou0JxaMPESrm73apkiQj8OhoD84IXJQoGBW1UR1Jovk3ToKkPDcoH jstuvoEpD18Wp+rhU+UqMxtbRM7bzFLcQqkP8MqQcUIomAbEup2te6zHY8f3bXb2+JL/ 4i3g== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of agust@denx.de) smtp.mailfrom=agust@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [2001:a60:0:28:0:1:25:1]) by gmr-mx.google.com with ESMTPS id w18si1016933ljw.1.2021.02.16.01.53.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Feb 2021 01:53:01 -0800 (PST) Received-SPF: neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of agust@denx.de) client-ip=2001:a60:0:28:0:1:25:1; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4Dfx9S66sLz1s0fW for ; Tue, 16 Feb 2021 10:53:00 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4Dfx9S5wFKz1r13k for ; Tue, 16 Feb 2021 10:53:00 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 95OUdqtr_gIu for ; Tue, 16 Feb 2021 10:53:00 +0100 (CET) X-Auth-Info: itclf+6YDQaC70FiB7wJ6/c0gBjy+hPuweDodZcSlVI= Received: from crub.agik.hopto.org (p508b6a6d.dip0.t-ipconnect.de [80.139.106.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA for ; Tue, 16 Feb 2021 10:53:00 +0100 (CET) From: Anatolij Gustschin To: swupdate@googlegroups.com Subject: [swupdate] [meta-swupdate][PATCH v2 1/3] swupdate_class: prepare to use SRC_URI in image recipes Date: Tue, 16 Feb 2021 10:52:56 +0100 Message-Id: <20210216095258.514-2-agust@denx.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210216095258.514-1-agust@denx.de> References: <20210216095258.514-1-agust@denx.de> X-Original-Sender: agust@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of agust@denx.de) smtp.mailfrom=agust@denx.de 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: , Enable swuimage task if building 'update-image' recipe of the meta-swupdate-boards layer or if building usual image recipes with appended SRC_URI and enabled 'swu' image fstype. Fetch SRC_URI files if 'swu' image fstype was selected. This is in preparation of support for 'swu' image type class (for building .swu images without meta-swupdate-boards layer). Signed-off-by: Anatolij Gustschin --- classes/swupdate.bbclass | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass index 2c2430b..c2899be 100644 --- a/classes/swupdate.bbclass +++ b/classes/swupdate.bbclass @@ -51,7 +51,10 @@ def swupdate_getdepends(d): depstr = "" for dep in deps: - depstr += " " + dep + ":do_build" + if dep == d.getVar('PN'): + depstr += " " + dep + ":do_image_complete" + else: + depstr += " " + dep + ":do_build" return depstr IMGDEPLOYDIR = "${WORKDIR}/deploy-${PN}-swuimage" @@ -76,14 +79,38 @@ do_package_write_ipk[noexec] = "1" do_package_write_deb[noexec] = "1" do_package_write_rpm[noexec] = "1" +USING_SWU = "${@bb.utils.contains('IMAGE_FSTYPES', 'swu', '1', '', d)}" + python () { deps = " " + swupdate_getdepends(d) d.appendVarFlag('do_swuimage', 'depends', deps) + + # add swuimage task if building with swu image type or if + # building via 'update-image' recipe in meta-swupdate-boards + if d.getVar('PN') == 'update-image': + bb.build.addtask('do_swuimage', 'do_build', 'do_unpack do_prepare_recipe_sysroot', d) + elif d.getVar('USING_SWU'): + bb.build.addtask('do_swuimage', 'do_build', 'do_image_complete', d) } python do_swuimage () { import shutil + if d.getVar('USING_SWU'): + src_uri = (d.getVar('SRC_URI') or "").split() + if len(src_uri) == 0: + bb.fatal("SRC_URI (sw-description) required with 'swu' in IMAGE_FSTYPES") + + try: + fetcher = bb.fetch2.Fetch(src_uri, d) + fetcher.download() + except bb.fetch2.BBFetchException as e: + bb.fatal(str(e)) + try: + fetcher.unpack(d.getVar('WORKDIR')) + except bb.fetch2.BBFetchException as e: + bb.fatal(str(e)) + workdir = d.getVar('WORKDIR', True) images = (d.getVar('SWUPDATE_IMAGES', True) or "").split() s = d.getVar('S', True) @@ -168,5 +195,3 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" INHIBIT_DEFAULT_DEPS = "1" EXCLUDE_FROM_WORLD = "1" - -addtask do_swuimage after do_unpack do_prepare_recipe_sysroot before do_build