From patchwork Sat Sep 19 18:30:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Germann X-Patchwork-Id: 1367682 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+bncbdpppp7kyilbbt44th5qkgqemlk6bza@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linutronix.de 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=lx052IZZ; 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 4Btzm71xnMz9sSf for ; Sun, 20 Sep 2020 04:30:45 +1000 (AEST) Received: by mail-lj1-x23a.google.com with SMTP id f22sf3049789ljh.0 for ; Sat, 19 Sep 2020 11:30:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1600540240; cv=pass; d=google.com; s=arc-20160816; b=nmP8f2dWZKPvaM4M9mvBtaIE0sKSBAICy7rQJitxdw6hnuDXMCMfln+0S0rGYWAhr7 +VEP66JJWl5ezSVOFNuiznHfpejUQU4Ad0X8PHZERMzXM6y+K1zEGuCFBGA+TDG390Fq XNtGBbesG4R07pV9iQJUK6vpYrnnFw1qVXQuKg1XY08OOpLSBdYa1exAknS3hBYjdsQi qyNsN1ynRm3lwGrLHrMIHNzmooXuivV2jqbWdhI+9wE2XFTbYzwNq1EQpX2y7YwS6Tab thTxWTdd+mIxQ7SVDrPb2QAZ8jUzwqSy2ZL8RLe5bK7v50cQF+KrTn45IZOxHoUJ4DL+ FreQ== 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=qjgPXEVeYx6V/MxZN/t1snTipbRpJm7feq72SjuEp5I=; b=gL0Gz1e4CmTpRkfRu19E0O+HF/DYTMkPjA2xAPxCs3DdVTttukbmCmPVpJKG032rya 6B8F9Nan05nm3lCZ064Ts/DGs25m6eGGyxo/F1n+6ERwtEWIwpK7c0zfY12jlzOOZeHb qxfMbVGPJlWAyJhP+eeQist86HYuijtX0UITjfE34wYEPYkI78Y5nkt+bmOsH1ebBkNI +UwgL+7NmajETPzfGiD9AngE15d7KmMnjPSRvKFGnuP3O6gBH8inNezi4ntRlq+GNmjk f1hEF5Oe7Yj0aocTcz7lOAByqyUWQbgTafG55xu7ccp/ld9MWv/GBHMlIZcA1CzrS8qB 3r9w== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3KrjpU9A; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of bage@linutronix.de designates 2a0a:51c0:0:12e:550::1 as permitted sender) smtp.mailfrom=bage@linutronix.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; 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=qjgPXEVeYx6V/MxZN/t1snTipbRpJm7feq72SjuEp5I=; b=lx052IZZHkyZGooiwj/AAMKOEzAqL5sXd9St0yAQLybL8zWc1v+AsjiBX5TiEHNmj5 Cy8SHTROYjLxZgTypRa5v2oOi0E9s+fkPXRLYsiqbpjeaKiJtqyNQBvhJhgj1eRnnygn raNbkGRJctxZRAaw4ltTqs+P02/l7j7sJAhv/jMPZiqjvE9Kzj0989xriW+j6yn5EfRN BcrzvVAdcFJjNvj0mXcnAUtopRsF1gxoxHYbaWSFRyxCRW2Yr64uGndv+a5s4EB6y1R4 EQUsZQ/oi/vd36C2Rd82BhcsEKt8YcWG6UPMG2XuGDE1eim7CUI3FWhg1WaLGw3BMpGN d3bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=qjgPXEVeYx6V/MxZN/t1snTipbRpJm7feq72SjuEp5I=; b=kUdK2zB4g5qXSYOxx/Cv4d2PCp4eYwwVxV7IW8A5DSQxbUybfY1kWZ3SdPUMTIq364 MOhw7NgzR1uvMDIwrPhjQp3vn1GDPj6TPmPYcsAH4bwG9uzMhLcPxdmiSwWO3aQ9pMX7 9dtBzGmaSssAw2LI3Ym0h9vH/JpvU9mZtw3RXAbRatMLE85siXQebmdY3CIoGFO/devs FhXbgegy0hAi1V8L33N1jFrqAz1C1f9rMvvo6YwMD16om0C7E6Xq7oIULaOLeKc9TC5z JSjMAwiWVZMIUfOJikRyJkrTmPYNb4+lVj9dXXgnCsEWsq0kU6jk/deh5Hg2DdZwv8H3 v4Sg== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM5330YqPieCjTwlE6NGNdsQS9SZGO0BgpVqpFf8XSCI0GHnIemBfO kgXPKv32O8rx9uOaFsYoHcQ= X-Google-Smtp-Source: ABdhPJzlBQjy6H7ueosQNQa96DUfWv60nC/g0+J8gGmdl+iVTblsu/i4uVE1HOSH0qiydEV7M0HTzQ== X-Received: by 2002:a05:6512:3b5:: with SMTP id v21mr14523371lfp.271.1600540240245; Sat, 19 Sep 2020 11:30:40 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a19:c7c8:: with SMTP id x191ls1971847lff.0.gmail; Sat, 19 Sep 2020 11:30:38 -0700 (PDT) X-Received: by 2002:a19:b97:: with SMTP id 145mr14081533lfl.269.1600540238908; Sat, 19 Sep 2020 11:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600540238; cv=none; d=google.com; s=arc-20160816; b=UZ6remcP/QHj9dqGCOfWnS/VNzVr+y/iNWjganMOESSgeD/QXpirGgMiaDrEVMLNTV Gm7bNiIUi0gQPpIHj+rTxCCqujnGlrJd538ZqtQRc/ArURplYsJ9KKMKafl2IX4n6Oz0 YHw62UhWh4xZ2h5VVV+vLCNoNPkYnwoyxAmmRGNNqEqdWZWHAGCTrElDDD27COQKeJxJ fpRgRp9JTrBdh0JiUQFPWEuyGEYdn/Y09YCTvI8eMPEI10gUOigri8JkL+YdAo1HlaiL xDllqdzBv/cfVwCZYjYJkd3Ax12eeaRK/gmRl+3t8vDiK98VTOAa+m4Jb7UM0vavzPqV uBVw== 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:dkim-signature:dkim-signature:from; bh=PVls5JrZx3Jme8D0jI/nAGg/Vuj/K3WDh71qWc0wR6Q=; b=jWEHlNGlKyUXyIP21Lecc5cgP0zIxzpQJpeGZZbYi/HgzeWoE3Vh/4bhE6N/bgRWCw zkiwbsKd/lIJGxh8V3YmR8cjp1t6jpxSZT4Ny3D7oXq+/GIAqf44jXaNX5a/Wvv+nOh0 CwivO/eSgjcgiQR8fnLsqU/R/e3z0hUdJSpEdS8ld5dGsQQ1C5evIoORJ/Xy43TLAC8v fSBodj24Ney6xCOM9JAV4iFOeqSzY3fWjEubCue9kl9OdPeKP1zbTEw1R9L+8f8O76Wc jKWaSrhi6Z9azXw6Rkb7Q6yxp0hynUl55Wf8DWDB+N9nYQeBpknqV7jaWMm7epHsZND4 3m2g== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3KrjpU9A; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of bage@linutronix.de designates 2a0a:51c0:0:12e:550::1 as permitted sender) smtp.mailfrom=bage@linutronix.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from galois.linutronix.de (Galois.linutronix.de. [2a0a:51c0:0:12e:550::1]) by gmr-mx.google.com with ESMTPS id r6si124529lji.4.2020.09.19.11.30.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 11:30:38 -0700 (PDT) Received-SPF: pass (google.com: domain of bage@linutronix.de designates 2a0a:51c0:0:12e:550::1 as permitted sender) client-ip=2a0a:51c0:0:12e:550::1; From: bage@linutronix.de To: swupdate@googlegroups.com Cc: Bastian Germann Subject: [swupdate] [PATCH 2/2] doc: handlers: Describe property decompressed-size Date: Sat, 19 Sep 2020 20:30:10 +0200 Message-Id: <20200919183010.100367-2-bage@linutronix.de> In-Reply-To: <20200919183010.100367-1-bage@linutronix.de> References: <59cfcfc0-87e9-2923-4c7c-05fc189efec9@denx.de> <20200919183010.100367-1-bage@linutronix.de> MIME-Version: 1.0 X-Original-Sender: bage@linutronix.de X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3KrjpU9A; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of bage@linutronix.de designates 2a0a:51c0:0:12e:550::1 as permitted sender) smtp.mailfrom=bage@linutronix.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.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: , From: Bastian Germann Move the documentation about "decrypted-size" from the encrypted images doc to the UBI Volume Handler doc and reference it in the old place. Extend the description by adding decompressed-size with an example. Signed-off-by: Bastian Germann --- doc/source/encrypted_images.rst | 27 ++++------------------- doc/source/handlers.rst | 38 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 23 deletions(-) diff --git a/doc/source/encrypted_images.rst b/doc/source/encrypted_images.rst index e71cdd8..949dabb 100644 --- a/doc/source/encrypted_images.rst +++ b/doc/source/encrypted_images.rst @@ -57,30 +57,10 @@ sw-description attribute overrides the key file's IV for one specific image. Encryption of UBI volumes ------------------------- -Due to a limit in the Linux kernel api for UBI volumes, the size reserved to be -written on disk should be declared before actually write anything. -Unfortunately, the size of an encrypted image is not know until the complete -decryption, thus preventing to correctly declare the size of the file to be -written on disk. +Due to a limit in the Linux kernel API for UBI volumes, the size reserved to be +written on disk should be declared before actually writing anything. -For this reason UBI images can declare the special property "decrypted-size" like -this: - -:: - - images: ( { - filename = "rootfs.ubifs.enc"; - volume = "rootfs"; - encrypted = true; - ivt = "65D793B87B6724BB27954C7664F15FF3"; - properties = {decrypted-size = "104857600";} - } - ); - -The real size of the decrypted image should be calculated and written to the -sw-description before assembling the cpio archive. -In this example, 104857600 is the size of the rootfs after the decryption: the -encrypted size is by the way larger. +See the property "decrypted-size" in UBI Volume Handler's documentation. Example sw-description with Encrypted Image ------------------------------------------- @@ -98,6 +78,7 @@ setting. filename = "core-image-full-cmdline-beaglebone.ext3.enc"; device = "/dev/mmcblk0p3"; encrypted = true; + ivt = "65D793B87B6724BB27954C7664F15FF3"; } ); } diff --git a/doc/source/handlers.rst b/doc/source/handlers.rst index 30afb46..c487227 100644 --- a/doc/source/handlers.rst +++ b/doc/source/handlers.rst @@ -228,6 +228,44 @@ should be used with property ``auto-resize``. } } +size properties +............... +Due to a limit in the Linux kernel API for UBI volumes, the size reserved to be +written on disk should be declared before actually writing anything. +Unfortunately, the size of an encrypted or compressed image is not known until +the decryption or decompression finished. This prevents correct declaration of +the file size to be written on disk. + +For this reason UBI images can declare the special properties "decrypted-size" +or "decompressed-size" like this: + +:: + + images: ( { + filename = "rootfs.ubifs.enc"; + volume = "rootfs"; + encrypted = true; + properties: { + decrypted-size = "104857600"; + } + }, + { + filename = "homefs.ubifs.gz"; + volume = "homefs"; + properties: { + decompressed-size = "420000000"; + } + } + ); + +The real size of the image should be calculated and written to the +sw-description before assembling the cpio archive. +In this example, 104857600 is the size of the rootfs after the decryption: the +encrypted size is by the way larger. The decompressed size is of the homefs is +420000000. + +The sizes are bytes in decimal notation. + Lua Handlers ------------