From patchwork Mon Oct 11 11:21:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1539255 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=q/WEZrd8; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::13e; helo=mail-lf1-x13e.google.com; envelope-from=swupdate+bncbcxploxj6ikrbb55scfqmgqecqgsvdi@googlegroups.com; receiver=) Received: from mail-lf1-x13e.google.com (mail-lf1-x13e.google.com [IPv6:2a00:1450:4864:20::13e]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HSbxk6Ng8z9sPB for ; Mon, 11 Oct 2021 22:22:50 +1100 (AEDT) Received: by mail-lf1-x13e.google.com with SMTP id x33-20020a0565123fa100b003fcfd99073dsf12544156lfa.6 for ; Mon, 11 Oct 2021 04:22:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1633951367; cv=pass; d=google.com; s=arc-20160816; b=uQuxZprm7Xxkg+AtPn2FPi8/9WbqeuOtVk+8yYyuk/jdfjykWQ4uqL7g8cMYiYw1JW zf0nqb3zoWktsVsiVt06uJhmXSgEYTifBPdWCJa/cIK7du5UrNi+64cUIMKujH48QPob XZoAfF8h911a2FYu9XLTMAQtYQLLi8VGyCF65HnaRr0fokPClBtLLEXONmot+TTPJwDz JUXeJDabXYTi3zrpRclIpGWRriwzoPeFMgUlWSGDSK0RpY4WCgKxqCXZvh/qYziupO8x YFUmpKDSNXE4mKxqzaBwfwnYCJuei84wbHPC7gRyqd43KwGldEiuG/hel+BM8J1956qs lVhA== 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; bh=k/YqDKUwDTcx5Bmi8QyasI0l/8WBZLwQyh0cbFpkrcg=; b=nmuIRf0jpbcSv9KOqVbSzxmEDMYhS0qgP/PDctrLTOslFr27bSm087/OVMgVxmOScT kF/HB7nXDVSQAusM0vB+9q4fJK6hDyw5s9e8sWE2tfTVHAMzK8FsjrSEtAytiUWxrYZe 7Kx9UkZfvezV+Czya+BPA1NWvhWCJpqjUcZjz6NgsCjd94kfFhejKGSsRjuNRSfr1uH4 dK1ehNeM5J+KDvsHKaIrikIziOmlGs+i+jKNa4NC7VESaLsCRzgSl504GSotZvE15DUp fkEULEBB+kNxMKpnm/7ftbqqlrhdm6e0rWlX1AxRJnRoGApbaBUPP4hUI/gZ4Q6DDZey J9dQ== 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 domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de 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=k/YqDKUwDTcx5Bmi8QyasI0l/8WBZLwQyh0cbFpkrcg=; b=q/WEZrd8G6+9Geew23lFRhmMOwDfQ5OKtMyhceO0yuNqXLVQfwogwSfoFRuqqh6bXZ FAa3gL4L817P3dQB71/+l0zdakRSLTYh5e5SzMY114lx6Fm4TDnmMRsCgZPuFavFI2rK t2Ut75JKbh8081ex2xqFA5vcPWrPZ5jroQ4A6DbLjdc0hQj8nMmYVF6qcEBoWWXMG5dd +JIyxlhe1vwmFFYSj3xGPY8na5HiI7QLH8qsvQaT/Pu6e6V9dkUQWJSsnmII+5b5DAWk rqbTmEIpR50mCyFC6XET+pcW0ZxC1IwaCt/LKff/WSvIUxbfzCJnO10mkKFQXnJqx51b 1RIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=k/YqDKUwDTcx5Bmi8QyasI0l/8WBZLwQyh0cbFpkrcg=; b=fKqvQcQj3e2DydZuIc7We30S8xUbYhXwd1cwZ50tqIqBIKvqxHy8O2XgNHgbipE6PV LNg/eu/CSfaM8AWDgKWu7LFC3zCKJTyB+NZiiY8x54m/5ecy4q62XlhlZ34eFmAwgRkN niNBLWtbH6mU5aBI5Ro3q5kOj9ZkrZRGSyT/3KCch9MinAUoBbVh8ciVi4bFYcY33+1t thscAZDNfJSoGx2teLVoWMHz9ge+VCrlh9OLtuKSz0U5kpJ+b5x+/+NLAdV9OK4gC0sK KuebsQ36QZDA0YsLVhR9Yquh1XvmJauItFTG9+M/vzBb8S1OkcJY3EFvoOEfHaBuvINC 8gZg== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM533Xt0bs8znkSslJHnNxfjh124nan99ncp+ECL5JwVQ5u0Oy1DFr gceXVa07UFXypeH9byn3cMs= X-Google-Smtp-Source: ABdhPJyDaw/Yk/3J8E9MTEYjBnlQ5XOJElHGn1H5jVlYgbUDrNvQh4T1B6SVBd+l6Tw/qIs3t76Kfw== X-Received: by 2002:a05:6512:1196:: with SMTP id g22mr3994650lfr.661.1633951367684; Mon, 11 Oct 2021 04:22:47 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6512:3a83:: with SMTP id q3ls92303lfu.2.gmail; Mon, 11 Oct 2021 04:22:46 -0700 (PDT) X-Received: by 2002:a05:6512:2344:: with SMTP id p4mr25934437lfu.324.1633951366813; Mon, 11 Oct 2021 04:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633951366; cv=none; d=google.com; s=arc-20160816; b=irIRoGkxYC16fFmqCz7IeNouAx471t1FF9+fafp9TXw3jOMCczuG+seSxZKXohBbH4 Ar/kFkYA5XtSwmK3oRwZtQbVAU2VeUod0+qC79ce+CF1qko1ArfZFPUdbK6INPcV2iaG +6unqKMV6+TfAZRUxFpRakAFXdsn08l1LfXqthYai+FP5w8HSdlyHaDeCZ8PB7SrGreN d92S7Rjn3i4A45A8PddSUXPmNzGc2oAPpnCPDkBoVbdfYD40G7I+uLq+pwWFW1Ld+76i pombfaIM5144Lj4urVdQK8Hs2NsA0gzD7YoQr2trKc51IIpWv96vEr1cHKxhWOa+G0G3 R83g== 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; bh=xBWaKD2+PGIye4M6uAmry958FLXDTdp44W4FczkYgfA=; b=SHfernY8zxjnkyGtRk/EUk0iNWP1ReHpWkm7AL9mdaLphhMftQL1Z/qjcj/pjh5fAg sS1rKrTO4VwTDBLP90YtObxcH88cWGqrVxS8J8iVpnokp8xvwhCpw3/uJeKyqtv/dGA3 U0P42FXCj4bCJAqxYBr857dtzCgdpVIjMS3+ILDlRbP1KtBMZfr8Ofy8tPaojheYK2/y U3wjj+Q87KdsgBQfntbnD3MA6EAlKiZ5SmDVqsySUvkjrzYRZplvD4FM5H8gvQwg5spr 9WDeHlheFiQAS8nJBLr/q3hQ3L6zxGNXKLolhe7ENssFvdqwZroQT6MQTEL7i+W7oqMu jd7w== 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 domain of sbabic@denx.de) smtp.mailfrom=sbabic@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 a19si414933lfb.10.2021.10.11.04.22.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Oct 2021 04:22:46 -0700 (PDT) Received-SPF: neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by domain of sbabic@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 4HSbxf2Jhfz1sC06; Mon, 11 Oct 2021 13:22:46 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4HSbxf2CkGz1qqkB; Mon, 11 Oct 2021 13:22:46 +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 oDkRs-yxx9ye; Mon, 11 Oct 2021 13:22:44 +0200 (CEST) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Mon, 11 Oct 2021 13:22:44 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 72FFE4540BF1; Mon, 11 Oct 2021 13:22:44 +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 j71kiDpwZUuA; Mon, 11 Oct 2021 13:22:41 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.48]) by babic.homelinux.org (Postfix) with ESMTP id 501EF4542801; Mon, 11 Oct 2021 13:22:07 +0200 (CEST) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH 27/29] doc: add documentation for delta handler Date: Mon, 11 Oct 2021 13:21:54 +0200 Message-Id: <20211011112156.44192-28-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211011112156.44192-1-sbabic@denx.de> References: <20211011112156.44192-1-sbabic@denx.de> MIME-Version: 1.0 X-Original-Sender: sbabic@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 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: , Explain attributes and properties for the delta update handler. Signed-off-by: Stefano Babic --- doc/source/handlers.rst | 80 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/doc/source/handlers.rst b/doc/source/handlers.rst index 8689585..54a9b6c 100644 --- a/doc/source/handlers.rst +++ b/doc/source/handlers.rst @@ -912,3 +912,83 @@ found on the device. It is a partition handler and it runs before any image is i "18e12df1-d8e1-4283-8727-37727eb4261d"]; } }); + +Delta Update Handler +-------------------- + +The handler processes a ZCHUNK header and finds which chunks should be downloaded +after generating the corresponding header of the running artifact to be updated. +The handler uses just a couple of attributes from the main setup, and gets more information +from the properties. The attributes are then passed to a secondary handler that +will install the artefact after the delta handler has assembled it. +The handler requires ZST because this is the compression format for Zchunk. + +The SWU must just contain the ZCK's header, while the ZCK file is put as it is on the server. +The utilities in Zchunk project are used to build the zck file. + +:: + + zck -u -h sha256 + +This will generates a file .zck. To extract the header, use the `zck_read_header` +utility: + +:: + + HSIZE=`zck_read_header -v .zck | grep "Header size" | cut -d':' -f2` + dd if=.zck of=.header bs=1 count=$((HSIZE)) + +The resulting header file must be packed inside the SWU. + +.. table:: Properties for delta update handler + + +-------------+-------------+----------------------------------------------------+ + | Name | Type | Description | + +=============+=============+====================================================+ + | url | string | This is the URL from where the handler will | + | | | download the missing chunks. | + | | | The server must support byte range header. | + +-------------+-------------+----------------------------------------------------+ + | source | string | name of the device or file to be used for | + | | | the comparison. | + +-------------+-------------+----------------------------------------------------+ + | chain | string | this is the name (type) of the handler | + | | | that is called after reassembling | + | | | the artifact. | + +-------------+-------------+----------------------------------------------------+ + | max-ranges | string | Max number of ranges that a server can | + | | | accept. Default value (150) should be ok | + | | | for most servers. | + +-------------+-------------+----------------------------------------------------+ + | zckloglevel | string | this sets the log level of the zcklib. | + | | | Logs are intercepted by SWupdate and | + | | | appear in SWUpdate's log. | + | | | Value is one of debug,info | + | | | warn,error,none | + +-------------+-------------+----------------------------------------------------+ + | debug-chunks| string | "true", default is not set. | + | | | This activates more verbose debugging | + | | | output and the list of all chunks is | + | | | printed, and it reports if a chunk | + | | | is downloaded or copied from the source. | + +-------------+-------------+----------------------------------------------------+ + + +Example: + +:: + + { + filename = "software.header"; + type = "delta"; + + path = "testimage.raw"; + properties: { + url = "http://examples.com/software.zck"; + chain = "rawfile"; + source = "/dev/mmcblk0p3"; + zckloglevel = "error"; + /* debug-chunks = "true"; */ + }; + } +