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"; + } + ); + }; + }; + } +}