From patchwork Wed Aug 16 13:12:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 802057 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:400c:c0c::238; helo=mail-wr0-x238.google.com; envelope-from=swupdate+bncbaabbruj2hgakgqesn526ny@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="oY82YvWT"; dkim-atps=neutral Received: from mail-wr0-x238.google.com (mail-wr0-x238.google.com [IPv6:2a00:1450:400c:c0c::238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xXVBf5MZ0z9sRg for ; Wed, 16 Aug 2017 23:12:41 +1000 (AEST) Received: by mail-wr0-x238.google.com with SMTP id w63sf1896888wrc.2 for ; Wed, 16 Aug 2017 06:12:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1502889158; cv=pass; d=google.com; s=arc-20160816; b=g0vtrnltUsKPcsbq5dpOnbyn5s2YkgWjPZMxRqDgK7nqsE11gOYACIlNcPp5IMobGa QUejxmKdNFepJtE/2nCfSSZmRNii7/UOxJ226IpwlMfAT2VQxAYO2hbSX/IAqKprPNiP WTptRhrNd+vGh3IFs057/M/JB/5xBfX8ipa9saW/rcJz4/A1u9ueg+Walywrrll8/DMD 3Dn8b0KIE6pM9BYVaGwXHES1nJ+slCkvVtQ6+OtctCTvnwvlskMJKTdEIbNKIebPhuUe wvx9Rkn0yqwDMRPEE4u9YnouJ8HXTGvgAS6h8vuyUDd3QQE37HwqOdKVgXHBjMb57WZc tk2w== 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:message-id:date:subject:cc:to:from :arc-authentication-results:arc-message-signature:mime-version :sender:dkim-signature:arc-authentication-results; bh=Qf85L9J+Kb9UQND76/l1fVv5ynknNkILurmIEFJKlfs=; b=BH3IOVyxjEK1WOTJKZDwis5GgXwOEPmAEcwQFrzMB9AD5Sdn1OuId1/dnR0t+9TSBh qvCqNcJVy8tsjo2/LlBCw79/rL9T4lNLiuejZpcssbXotGnzSYAP0eJfCBbkGMPB0JTQ trqdufkHeygPzGpkQOnz2+/NGna2mAxxQg45ai+dErZMlwwoBVhTIZBeyXa2ufBDyB9j mDyUldJMKI1RQr1Ccrj3pJP/ndmMe9O0WMlHqxs96jKG74/vP1LsO7pUBabCIgCWDOUC VtzFZvQWpYeEx0SHws20O7fZIkHL62+Gk5jt5AIlEgoEpNoSTIqihCObkuxayKiNYHzO fXvA== 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 sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=Qf85L9J+Kb9UQND76/l1fVv5ynknNkILurmIEFJKlfs=; b=oY82YvWT4NjZA5UpHjFeL/2IoJf8VdxByW1Ye1EP8v0gh6RY5zeXqHGj33XyMfAG2c 3H1tLFwSWhPR+I5VlZLUPPp+M/S3pZtxJwI2dyuSSyln+r2fDhbG3gclGkBkZyIxTi73 aOfoBC9ZXRf9DI2a22AEs5L4lBr2OFAMkfqulQDCKqLVXjYkluUNhGrUdEsRLrexDZwv CQQe5WWRPv1Uh7oJ60Q7qWmU4CI3jnnc5+ydfSVmYwusncmNTLZrjIACyX77qFS5fRba 53SnQfgFVTlZwB4qhvZ7K3SiHl4AxDL9JTOKcUxVKRyQ5RnqvCZYQROclUWt3diFnyhA vF6A== 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:cc:subject:date :message-id: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=Qf85L9J+Kb9UQND76/l1fVv5ynknNkILurmIEFJKlfs=; b=F5kCcm5mdvcichecYIgj+Ehocb686ueb/G9gOUkkGushDQ3a6k2TvbWE4t3dtaGI5+ amAT11hezOdror2nqkIVg45y5YncUYbzxOh0MdBIkVPMG+GgLYqR8MS83jRRNIDYzgWI 2cFP6GyUMUYQ0fgxhnHWzyTWg1NWZI21MwBBBZ9BlTEZq694YFVVk7397/3Wd5ZawJpd /1bsCTZLnnfQsFs2UsmKo5g+mK7VPCVfJClEdqhjeGTDwsTemF1MbBQNKwuunLCD3Vsk idRXw6E2T5fpfWDdphoWcGDkJBZDjJOQp5Ia/P3zshESa4SdCQXb0pntP5mpn4YsojQX 1EnA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AHYfb5gfdpcFQQ7U+uNhgRr1F3OvUXSuRPM1C3X3vyPKjmsiq3AiCS10 SR9DiNw6FRYKJQ== X-Received: by 10.25.20.215 with SMTP id 84mr2483lfu.20.1502889158349; Wed, 16 Aug 2017 06:12:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.25.31.211 with SMTP id f202ls97703lff.24.gmail; Wed, 16 Aug 2017 06:12:37 -0700 (PDT) X-Received: by 10.25.169.68 with SMTP id s65mr355592lfe.34.1502889157852; Wed, 16 Aug 2017 06:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502889157; cv=none; d=google.com; s=arc-20160816; b=IJkvetWGA3ex8y5/hABlHsu+nDq6miObJl+HUw0A1e7KrHmILBNcBUJbCBamNMIMMP 2Vvu5S+rI43x8d1KEAKrKaCeGIkPtkDNBPHYuq5HCI+2gCe1Y6XM34rS1CbmE2xbkSyq xaSrACpK8K/nQc/TuBjw7CM2futODcuOtafKHUBFC1/j4LmkMjUwJjVees3goaYOkHbN nGe7bKRPsPY94BEArP2Nh3pThbVa40jmjHLAsM74TChMYdBRTJsnxe/CJD73GQ0C7dgw Sdm/kBYCh4Ww+cJPxBhlI4eHow0TNF9RDYfWe1Rj/zSocyplWWrEfpbQOzghuOZjnGvU cKtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=iFS4ktyr6cW598YmxlElRp3IoJ4l5NCOdZWXEYj88MI=; b=QQWxSZkR98veEW6sZjSezJ+k0IY81+Y/sb2M2apIl/9qy1SooJtwc5ssfOXWq2wlEg z5MaIAiBos7Uy/pOORidf8LBIMmTvbPLDs7jR0hdnyrctOS1XadHi2AviFqyhkab6Pvh l7nynfkOzmS0U8nJqUXVnHRuNSv953Nx41DWKCy2uH645q8HkjYXBBJAGy6vOAEdYuaw ci9IMfm8xKfSu/ND/jqmU61pZd0vcoDmflvhjNJ89HzBx1B3jnolWj2Wxhm+YpUMPLW+ EcwZJjMjxIa4riY1X+YshFkkoHyvO8QRTBC1nfh0P9PMfAeEuDFj0nIeA4bXWxGF3kPQ /u/g== 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 sbabic@denx.de) smtp.mailfrom=sbabic@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 h133si1328632wmg.2.2017.08.16.06.12.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Aug 2017 06:12:37 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@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 3xXVBY46gkz1qsDB; Wed, 16 Aug 2017 15:12:37 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3xXVBY3pTFz3jgYn; Wed, 16 Aug 2017 15:12:37 +0200 (CEST) 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 SXWPUcdIW07Z; Wed, 16 Aug 2017 15:12:36 +0200 (CEST) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Wed, 16 Aug 2017 15:12:36 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 817F54540495; Wed, 16 Aug 2017 15:12:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cA6WP7Bdg6qa; Wed, 16 Aug 2017 15:12:32 +0200 (CEST) Received: from papero.fritz.box (papero.fritz.box [192.168.178.132]) by babic.homelinux.org (Postfix) with ESMTP id 6EDC2454035C; Wed, 16 Aug 2017 15:12:32 +0200 (CEST) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH] doc: howto using meta-swupdate Date: Wed, 16 Aug 2017 15:12:24 +0200 Message-Id: <1502889144-13237-1-git-send-email-sbabic@denx.de> X-Mailer: git-send-email 2.7.4 X-Original-Sender: sbabic@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 sbabic@denx.de) smtp.mailfrom=sbabic@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 a section about building with Yocto and how to use the swupdate class to generate the SWU image. Signed-off-by: Stefano Babic --- doc/source/building-with-yocto.rst | 115 +++++++++++++++++++++++++++++++++++++ doc/source/index.rst | 1 + 2 files changed, 116 insertions(+) create mode 100644 doc/source/building-with-yocto.rst diff --git a/doc/source/building-with-yocto.rst b/doc/source/building-with-yocto.rst new file mode 100644 index 0000000..0e0702c --- /dev/null +++ b/doc/source/building-with-yocto.rst @@ -0,0 +1,115 @@ +================================== +meta-swupdate: building with Yocto +================================== + +Overview +======== + +The Yocto-Project_ is a community project under the umbrella of the Linux +Foundation that provides tools and template to create the own custom Linux-based +software for embedded systems. + +.. _Yocto-Project: http://www.yoctoproject.org +.. _meta-SWUpdate: https://github.com/sbabic/meta-swupdate.git + +Add-on features can be added using *layers*. meta-swupdate_ is the layer to +cross-compile the SWUpdate application and to generate the compound SWU images +containing the release of the product. As described in Yocto's documentation +about layers, you should include it in your *bblayers.conf* file to use it. + +The swupdate class +================== + +meta-swupdate contains a class specific for SWUpdate. It helps to generate the +SWU image starting from images built inside the Yocto. It requires that all +components, that means the artifacts that are part of the SWU image, are present +in the Yocto's deploy directory. This class should be inherited by recipes +generating the SWU. The class defines new variables, all of them have the prefix +*SWUPDATE_* in the name. + +- **SWUPDATE_IMAGES** : this is a list of the artifacts to be packaged together. + The list contains the name of images without any extension for MACHINE or + filetype, that are added automatically. + Example : + +:: + + SWUPDATE_IMAGES = "core-image-full-cmdline uImage" + +- **SWUPDATE_IMAGES_FSTYPES** : extension of the artifact. Each artifact can + have multiple extension according to the IMAGE_FSTYPES variable. + For example, an image can be generated as tarball and as UBIFS for target. + Setting the variable for each artifact telles the class which file must + be packed into the SWU image. + + +:: + + SWUPDATE_IMAGES_FSTYPES[core-image-full-cmdline] = ".ubifs" + +- **SWUPDATE_IMAGES_NOAPPEND_MACHINE** : flag to use drop the machine name from the + artifact file. Most images in *deploy* have the name of the Yocto's machine in the + filename. The class adds automatically the name of the MACHINE to the file, but some + artifacts can be deploes without it. + +:: + + SWUPDATE_IMAGES_NOAPPEND_MACHINE[my-image] = "1" + +- **SWUPDATE_SIGNING** : if set, the SWU is signed. +- **SWUPDATE_SIGN_TOOL** : instead of using openssl, use SWUPDATE_SIGN_TOOL to sign + the image. A typical use case is together with a hardware key. +- **SWUPDATE_PRIVATE_KEY** : this is the file with the private key used to sign the + image. +- **SWUPDATE_PASSWORD_FILE** : an optional file containing the password for the private + key. + +Automatic sha256 in sw-description +---------------------------------- + +The swupdate class takes care of computing and inserting sha256 hashes in the +sw-description file. The attribute *sha256* **must** be set in case the image +is signed. Each artifact must have the attribute: + +:: + + sha256 = "@artifact-file-name@" + +For example, to add sha256 to the standard Yocto core-image-full-cmdline: + +:: + + sha256 = "@core-image-full-cmdline-machine.ubifs"; + + +The name of the file must be the same as in deploy directory. + + +Template for recipe using the class +----------------------------------- + +:: + + DESCRIPTION = "Example recipe generating SWU image" + SECTION = "" + + LICENSE = "" + + # Add all local files to be added to the SWU + # sw-description must always be in the list. + # You can extend with scripts or wahtever you need + SRC_URI = " \ + file://sw-description \ + " + + # images to build before building swupdate image + IMAGE_DEPENDS = "core-image-full-cmdline virtual/kernel" + + # images and files that will be included in the .swu image + SWUPDATE_IMAGES = "core-image-full-cmdline uImage" + + # a deployable image can have multiple format, choose one + SWUPDATE_IMAGES_FSTYPES[core-image-full-cmdline] = ".ubifs" + SWUPDATE_IMAGES_FSTYPES[uImage] = ".bin" + + inherit swupdate diff --git a/doc/source/index.rst b/doc/source/index.rst index 2f74c7d..f7c4b85 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -32,6 +32,7 @@ SWUpdate Documentation suricatta.rst swupdate-ipc.rst progress.rst + building-with-yocto.rst ############################################ Help and support