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 From patchwork Tue Feb 16 09:52:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 1440858 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::239; helo=mail-lj1-x239.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=FxfAlV6Q; dkim-atps=neutral Received: from mail-lj1-x239.google.com (mail-lj1-x239.google.com [IPv6:2a00:1450:4864:20::239]) (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 4Dfx9g0nKjz9sVV for ; Tue, 16 Feb 2021 20:53:08 +1100 (AEDT) Received: by mail-lj1-x239.google.com with SMTP id d25sf5170421ljc.5 for ; Tue, 16 Feb 2021 01:53:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613469183; cv=pass; d=google.com; s=arc-20160816; b=ifJvjzoCYBe5cDh7NrVBezLASQKIS4FdW8FG4O3t4HonWSALt7wRLBuymc2gTk3A04 7B9MK1pXR84dlqSx81NarUI5CR++ejw5kotXTrCJsWfZOQw0c4l2AQJ97kDReJ1D7QlT EwZKMgfMv4wu4+hFVWS058VuKGY2HIZ88UgPJ06XjvrIj7KkdtyV9cTW4/+E0nzYzixv LC3dTuIvyZCswgmIPWUz7f4EtBzV6dC9SvM3N8vK5Cb/1YZDHdGZmnmuwRWz/Ov/KUNv k9lGzfUyima1lOqWtBjbCgYyB2CZm7bLApaKyYaAG30dkCzIPnQvLZTpO483uR1zZ++/ ojSQ== 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=PJ6rck+gbl+OH8011XeKzWNJyE1LwO5rnOply1o87ow=; b=DVkoGmVriu+3TqDsCAba8b5eHh0HC+xl7xPlZF7KO2rJNr+5JJckyBbTnDrzeFxWIn 9vhRYAV556omVMIuhEgksf7aZsxhzkDyFoFNUS9G7MSDzoT24L04/XXzCB08SFuu1n8k JW5xwqij+ua8x1uKnFff4aAR7HfVxSVyYn/Z96U95wvjmGf1eFTuOs8/IFasXQWnoBdX wfA8ib+1SdPy+SGPT1PII6byfRCKlPMITUximVwJkDFAtqi4iDCPJ085RNBExYH9CxK/ TuqI7hMIbhMlsn6mkE3se3Jy/6ByasGNaIsyxJtKk73CTY3zFEVHBi7H1X60LMKqgW/S ENpQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 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=PJ6rck+gbl+OH8011XeKzWNJyE1LwO5rnOply1o87ow=; b=FxfAlV6QYccXfHvxgMji/EDeryUdnADFqPpaCVfAdCHZAtUsagTbJIGLfg2fX4Bkp4 5nlB8y84n1IzkGnDAtB0gKPbr9kibzExL5dm1NU8pjZXkigNBOu1p51Ln+emSwRA4L1O dnMOHUtt5ZWUi/hoKGtcR54J8jHM47YlATK/8ibJewO5/l6P5ytZ6c3QIKLpyeBu6oiT DJMGkbII8GHHDQMuRbbZopyTQOtC8HeVy4VsGK4eKrmsgEuXneu0vAOMg87sQcjJywO1 LuGnmOLMsgkclanY9cDOOHZwHIcVGnIBLOpQ+7sEyWxGa6ZY+raMj3BxnJfohOoQjEKl z6iA== 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=PJ6rck+gbl+OH8011XeKzWNJyE1LwO5rnOply1o87ow=; b=S+4avmQKVl0HXxW8kSQ3JiLNZopDgAsR/gLXHLcV853C2S7HMY06qOGuh7bRK5t3Kv snPu5nzQJH9be6Y0w4e/b26/c/X1/61nFszgYMcnDPbGq2AIkwuvA0xCW+/+HxGp9VV5 H7AIdgeRyN0eLcArZOPiI1bOvOg3WlapsPE7R6E5dS8DGi+pydEUaN9IJedQqgkXtj42 8Fiuw7w1JVz4MKarF5+JYGgFbpqYzspRGgPKfDuzdPcRLHYmTlG5OFKqbu+/ofM4jhv7 79hf1MQF/BGM0HkomOIzM81y0qX0CnSUJjQR1bJfR085IHClgv/1KNmGMoPAtzK2JoNz 797g== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM530NcHFx3mTQYzINTjtxL2D4x6dHwbZoj+Kb26fstfpmbf0WuLww iRN+kZWDT1Eh2VQjgmP8roE= X-Google-Smtp-Source: ABdhPJyOqT6sKT35j6d5m2iAe80kuIZLf/QE6HueLp+SgRaEqDa8onViJ6ew40/omThFpvZ3uHdVVg== X-Received: by 2002:a05:651c:1257:: with SMTP id h23mr11149407ljh.125.1613469183154; Tue, 16 Feb 2021 01:53:03 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6512:6d4:: with SMTP id u20ls1750092lff.1.gmail; Tue, 16 Feb 2021 01:53:02 -0800 (PST) X-Received: by 2002:ac2:51a1:: with SMTP id f1mr11704695lfk.659.1613469182177; Tue, 16 Feb 2021 01:53:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613469182; cv=none; d=google.com; s=arc-20160816; b=gXoW8qzp5135zOtFt1MdcCxULrB5Ho8heMXdbV/MWRYvNq76DQTyikpU/irOyysdjR bh3an5keiZ4p+RzeMiTT9w3YbQWYcmt/n7BdKdclaToSkP/c41tw4dvLfxLkgghbiX1o 5Bq/5DASsV68Yooki10yzUhwFOmu6yyqmJIQvl8fC3OHjmsLQyPx/FWrm+KWYv25AlP1 5Cbxsv+Vb/BUfTmxBNdNuIDJh1rcRaRukN0lBUAixpOMCe49qUQ+8AjTaySgt5Hum5/D R7Cw2fHSKY9AqfUQ1h/VumrTY4XkjMyXOelDmBBYlNZJvrqo7BL4nHUuxBHR3NGsqMJj pfxg== 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=p4HQU7oEBeVvJdVkUfy8L3HePCSms7/Ua9XTgI9VRnc=; b=mErjeLARNfUaDSng/cEqIh/DLjxHDN8rhIH6pfvhosb423FDn6VhmPBmEnrZsnQ9y1 Dyky6MLwNvlHz2a7rkxs7V78d9VFljT66gNRWbJpGr2RZFQS1lG15Ws5W5GBrFvb/ETQ zPen9gQmabucVQ12EPFYYTw69C2jDArwnRSEXjGEcdLAMtHD1vN4wZFRYK0I62EMHEjX PFva6BVKfoGqAT59vUnDOQfX7lO+1PxWXWAU1c+23JSDxRwM7uTOjYCx6Bn8BkJVlxo7 cprGt5lzhurvaDuVyr7UjNY8zAvmAG8NzmxGIC4JeVgB3t9D/4WylLW10LC+93tcxZmO VBTA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 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. [212.18.0.10]) by gmr-mx.google.com with ESMTPS id j2si702235lfe.5.2021.02.16.01.53.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Feb 2021 01:53:02 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of agust@denx.de) client-ip=212.18.0.10; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4Dfx9T4k2pz1s0fh for ; Tue, 16 Feb 2021 10:53:01 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4Dfx9T4Zhpz1r13k for ; Tue, 16 Feb 2021 10:53:01 +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 tuMN9ip-jnwa 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 2/3] Enable building .swu images via swu image fstype Date: Tue, 16 Feb 2021 10:52:57 +0100 Message-Id: <20210216095258.514-3-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: 212.18.0.10 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: , Add image_types_swu class to support swu image type. To use this in an image recipe following changes should be added in it: - inherit image_types_swu class - add SRC_URI with sw-description (and more required files) - add IMAGE_FSTYPES, i.e. "ext4.gz swu" or "ext4.gz.enc swu" - SWUPDATE_IMAGES_FSTYPES[core-image-full-cmdline] = ".ext4.gz" - IMAGE_DEPENDS = "core-image-full-cmdline" - SWUPDATE_IMAGES = "core-image-full-cmdline" Signed-off-by: Anatolij Gustschin --- classes/image_types_swu.bbclass | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 classes/image_types_swu.bbclass diff --git a/classes/image_types_swu.bbclass b/classes/image_types_swu.bbclass new file mode 100644 index 0000000..6b5c6b5 --- /dev/null +++ b/classes/image_types_swu.bbclass @@ -0,0 +1,21 @@ +inherit swupdate +inherit swupdate-enc +inherit image_types + +IMAGE_CMD_swu () { + # We cannot use existing python swupdate class code here, + # so this is a dummy command to make image_types class work. + # The .swu image generation is in separate do_swuimage task. +} + +clean_swuimages () { + cd ${DEPLOY_DIR_IMAGE} + rm -rf ${IMAGE_LINK_NAME}*.swu +} + +do_clean_swuimage[doc] = "Removes .swu output files from image deploy dir" +do_clean_swuimage[nostamp] = "1" +python do_clean_swuimage () { + bb.build.exec_func('clean_swuimages', d) +} +addtask clean_swuimage after do_rootfs before do_image From patchwork Tue Feb 16 09:52:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 1440859 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::23a; helo=mail-lj1-x23a.google.com; envelope-from=swupdate+bncbda3zhwu2icrb75lv2aqmgqeah7yazy@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=dgXWiK6u; dkim-atps=neutral Received: from mail-lj1-x23a.google.com (mail-lj1-x23a.google.com [IPv6:2a00:1450:4864:20::23a]) (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 4Dfx9g0BPcz9sVF for ; Tue, 16 Feb 2021 20:53:08 +1100 (AEDT) Received: by mail-lj1-x23a.google.com with SMTP id d25sf5170427ljc.5 for ; Tue, 16 Feb 2021 01:53:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613469184; cv=pass; d=google.com; s=arc-20160816; b=Hq9W49hvmLdC5sUkJP6hct5BtAcN0KoiWofO50bVZkRe1xKXoga7/E8nS7CGV8yiFJ Up6hZTABw9PHD5OQ45h5KPPBUdufySuX8bZcvpajMpEgKQAF5ez9+rMPZfRUA2eF/FEh j6ArTS3Kq0RZm9UEBYwfBBulNjaf7EfxmPeO7HfsoB8eJ9D3yWYgMtpGzjDGzIevXvsG GckGgc6ruQE5sQJg2gX9170enKh3I/LTIlIbC34oiFt0t0vwRw4IymvUjrn5mJkpQPUI tVEFblFv+0eJrevLEkh0G+zwSg5psNXDEVt11Ex/xkCG1EGYcWcOXH4fMZTZ2o0/80az MNYA== 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=Ko/oz3uVGbWxzOO+PKLeYQxW7z7fXh84ysRNonkJ/q8=; b=RNPq9H2CAiJHCW4q1O57drhsF/mdbvES72Vkt9scrhaSI80y99KdEROa4B0dPO2srP vM5qcJTv1/bfw6nSPgDvKNaMSwbbcvPf3XV19UyvvlSgrWXP9DDWo8cHAa5fWksDsc5e gi935aBRgtwP0bsY3ZocUkYtq8bXkfAXwyNiLziWURVbFese9aqUFEG9OvjHEMM96uNg X0vmj+y8xXNydPaDruZD6MXEpXHO4gXdA9PXgvOMZrKLH6RpKIRYo+Q1udiXK3iLI+Ot 8bNMzDJxUhwE2pk+quxSfk3D7NDaRsz5wlhKbYB2gvzpkGPYQYE6O2z2vnN1bZ80WWYX vmqQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 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=Ko/oz3uVGbWxzOO+PKLeYQxW7z7fXh84ysRNonkJ/q8=; b=dgXWiK6u6Xct1Gb9lRxGya12LDfazGS9qOLg8plGC/f5pocqayfErMU7nFn2tllg7h CFyMH72tyup8lUXyc4qwtGx11+J1MMphWInrGDQnLrXMJvKtDdyoDu13312q5quf3Vh+ eDQVVOEGEt5ItjXQSXdpLzGxDpFqF7PKutu5/O79PJNvkRRvvIebdxZRBIfeV6Qj2ze7 bKoCLx/UV6zj8AltEq3Sv+eE3oy5rn3/1wY7tlDprJRC4NvY9F3fPHAUBiECu+EYQ4j5 PLVkR+RsR0bDICjEpcDLSQHJ9kM2QKS6q93dlrVYOBJA9igAWr4NBVzyRRXmeXPgf2RM pDyQ== 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=Ko/oz3uVGbWxzOO+PKLeYQxW7z7fXh84ysRNonkJ/q8=; b=uKlZOJW5vvehrR0uJCCrdP3OM8UoBVDpLt4FLeH4Qs982euGhvzNggs9Ast95MgH0e d6oyZXEq9WBa8DI2sndMyVb/xkSsaVtb2fwlWyFdXC8Sv5z8t+UiVIx4w42sqfwzsloW AGj/VFMTdLCRd+X1hHO7Cd7JwNpNbHl4CzUAjJKN7N8cbtpeSNt9diJ/HpYRTXKcX01c Edkov0fgCCNkGQXCTveK7jGSAP4UXf7tAklTNDxETYab0aOCDticQTnmcuEJM91cp+Hi mITX8nq5kplr1SDcoz6QSmUohJW174f+oU9WWrHclxkc4y2hFMY9aQken51lOzqw7Fcf nslQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM5338S1bMvSBdBLr4bJR5DYBFqyzn2t6yuMtxmSTgk5D0J34rU8mH tylX/C4CQLXDyaeOisKyRQU= X-Google-Smtp-Source: ABdhPJz1tJY2XVI000obN+4iXm3aCFchDaEivx5kA1AZP+3nDxLkjknZ0Ncrau8gANOY5g899Rmahw== X-Received: by 2002:a05:6512:33ce:: with SMTP id d14mr6038844lfg.306.1613469184013; Tue, 16 Feb 2021 01:53:04 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6512:6d4:: with SMTP id u20ls1750140lff.1.gmail; Tue, 16 Feb 2021 01:53:03 -0800 (PST) X-Received: by 2002:a19:8503:: with SMTP id h3mr10921334lfd.488.1613469183176; Tue, 16 Feb 2021 01:53:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613469183; cv=none; d=google.com; s=arc-20160816; b=L/0vztQke4wWE0g6dJyZWeIgmIE9e4SSEAM9a4QRHl+cB0lDZEa5AHAjE8zwoYFmPE 6ucbQFFnKERsQyf3Pm98xSBaxYmKyP+6dwL8uHCWYI7xL3kz7TIQVjEHeqWiGHF0Sv7x c2ZffeoDMgBUVRP2H91G5z4wQ4RYVkc1wWAz2J0eQMLao7JM3XaxEq8sM+nDakPMfxE4 z92ty6+/2SAFqfA4V7pLsew3wDryI4Gr5B7i1tIKw0lThgjfgGzaQqTWrYSgDF+xySk8 ly9tsg7MUJ2VQR8DZCxfnmgk0jfvPC1Ux9Qbj9FE5flzRHsA5PF2STspRPanG9kVRE5P uD9g== 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=ymKjszVQtBF1XUIJhbwZ2DVYuLdAKHlKq8EHn8MxhuM=; b=GKh9kzw3UHrUanPOiA/VyxzP8IQHhkrvx3Gi1bc2ZRABI5xIBMCIs+ekR30gMMF8Q3 38pOtYIJyBlq/pORVg7OkibWrGN8DeesEODm0yXNqCKb76TmxUzTytSjCUcKz0s+Upu6 MDS2iFYhcLn/LIWwTgx+8Y7xuUEQ4AnGjizmZVcbzTz4Rap4fS/8Ypyw+fcMV/fO1Uj9 shuB50iGs1mAbTIWJ5JxGjfsGDarOjkyH+vKbBbvOruERlP+UD+Z3p5f5JPPS8aMAERV 3MT4K1MFRRZFUrIIJjnIAIgGGGgw/SeSSR/uOwMveiI6bqC0/1T0tqzjqfTOuSVWAOJD mQvA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 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. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id j2si702236lfe.5.2021.02.16.01.53.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Feb 2021 01:53:03 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of agust@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4Dfx9V544mz1qsjm for ; Tue, 16 Feb 2021 10:53:02 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4Dfx9V4zSRz1r13k for ; Tue, 16 Feb 2021 10:53:02 +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 Sr_6itMSHR3O for ; Tue, 16 Feb 2021 10:53:01 +0100 (CET) X-Auth-Info: Ke1RbTYw9+I6GKawPbYutq0wd+BAP0cKTLFPzu44zYs= 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:01 +0100 (CET) From: Anatolij Gustschin To: swupdate@googlegroups.com Subject: [swupdate] [meta-swupdate-boards][PATCH v2 3/3] core-image: add example for .swu image generation Date: Tue, 16 Feb 2021 10:52:58 +0100 Message-Id: <20210216095258.514-4-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: 212.18.0.9 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: , Extend core-image-full-cmdline with options for building .swu images. Signed-off-by: Anatolij Gustschin --- .../images/core-image-full-cmdline.bbappend | 28 ++++++++ .../wandboard/emmcsetup.lua | 12 ++++ .../wandboard/sw-description | 71 +++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 recipes-extended/images/core-image-full-cmdline.bbappend create mode 100644 recipes-extended/images/core-image-full-cmdline/wandboard/emmcsetup.lua create mode 100644 recipes-extended/images/core-image-full-cmdline/wandboard/sw-description diff --git a/recipes-extended/images/core-image-full-cmdline.bbappend b/recipes-extended/images/core-image-full-cmdline.bbappend new file mode 100644 index 0000000..dcca4ef --- /dev/null +++ b/recipes-extended/images/core-image-full-cmdline.bbappend @@ -0,0 +1,28 @@ +# Extensions for core-image-full-cmdline image recipe +# to generate .swu image using swupdate class + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +inherit image_types_swu + +SRC_URI_wandboard = " \ + file://emmcsetup.lua \ + file://sw-description \ +" + +# Uncomment below line to enable .swu image generation +#IMAGE_FSTYPES_wandboard += "ext4.gz swu" + +# remove comment when configuring to generate ext4.gz.enc or +# ext4.gz.enc.swu images and add a key to the build directory +# as "conf/enc.key" +#SWUPDATE_AES_FILE = "${TOPDIR}/conf/enc.key" + +#SWUPDATE_IMAGES_FSTYPES[core-image-full-cmdline] = ".ext4.gz.enc" +SWUPDATE_IMAGES_FSTYPES[core-image-full-cmdline] = ".ext4.gz" + +# images to build before building swupdate image +IMAGE_DEPENDS = "core-image-full-cmdline" + +# images and files that will be included in the .swu image +SWUPDATE_IMAGES = "core-image-full-cmdline" diff --git a/recipes-extended/images/core-image-full-cmdline/wandboard/emmcsetup.lua b/recipes-extended/images/core-image-full-cmdline/wandboard/emmcsetup.lua new file mode 100644 index 0000000..58a7832 --- /dev/null +++ b/recipes-extended/images/core-image-full-cmdline/wandboard/emmcsetup.lua @@ -0,0 +1,12 @@ +function preinst() + local out = "Post installed script called" + + return true, out + +end + +function postinst() + local out = "Post installed script called" + + return true, out +end diff --git a/recipes-extended/images/core-image-full-cmdline/wandboard/sw-description b/recipes-extended/images/core-image-full-cmdline/wandboard/sw-description new file mode 100644 index 0000000..b3598fc --- /dev/null +++ b/recipes-extended/images/core-image-full-cmdline/wandboard/sw-description @@ -0,0 +1,71 @@ +software = +{ + version = "@@DISTRO_VERSION@@"; + + @@MACHINE@@ = { + hardware-compatibility: [ "revB", "revC", "revD"]; + stable : { + copy1 : { + images: ( + { + filename = "@@IMAGE_LINK_NAME@@.ext4.gz"; + type = "raw"; + compressed = true; + device = "/dev/mmcblk2p1"; + } + ); + scripts: ( + { + filename = "emmcsetup.lua"; + type = "lua"; + } + ); + uboot: ( + { + name = "rootpart"; + value = "1"; + }, + { + name = "finduuid"; + value = "part uuid mmc 0:${rootpart} uuid"; + }, + { + name = "scan_dev_for_boot_part"; + value = "setenv devplist ${rootpart};for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done"; + } + ); + + }; + copy2 : { + images: ( + { + filename = "@@IMAGE_LINK_NAME@@.ext4.gz"; + type = "raw"; + compressed = true; + device = "/dev/mmcblk2p2"; + } + ); + scripts: ( + { + filename = "emmcsetup.lua"; + type = "lua"; + } + ); + uboot: ( + { + name = "rootpart"; + value = "2"; + }, + { + name = "finduuid"; + value = "part uuid mmc 0:${rootpart} uuid"; + }, + { + name = "scan_dev_for_boot_part"; + value = "setenv devplist ${rootpart};for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done"; + } + ); + }; + }; + } +}