From patchwork Thu Oct 27 14:21:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Van Den Berge X-Patchwork-Id: 1695432 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::13d; helo=mail-lf1-x13d.google.com; envelope-from=swupdate+bncbcmixzeahiip3j7ktidbubfb5w32o@googlegroups.com; receiver=) Authentication-Results: legolas.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=on3E1nWy; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=msb7XY57; dkim-atps=neutral Received: from mail-lf1-x13d.google.com (mail-lf1-x13d.google.com [IPv6:2a00:1450:4864:20::13d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MyntZ30FGz1ygr for ; Fri, 28 Oct 2022 01:21:56 +1100 (AEDT) Received: by mail-lf1-x13d.google.com with SMTP id f19-20020ac25333000000b004a96ab958d9sf685989lfh.19 for ; Thu, 27 Oct 2022 07:21:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666880510; cv=pass; d=google.com; s=arc-20160816; b=J518IGR+NqwqFaUVCy5FCtSJvg+KYje9FXQsrKSILU9NCz0NS9QrpeesDYica2RgDA MMLEG1YuqgGbs8K+2bt6ZN/M03I+roYI2FGPt1/43/hsvKC+hFVgVPicAEOuG0hBadtq cDTJD4tdAxxrsosNPqgao0BO7OGuCPfy/pKYHL4vH5/n9fwt9A5cPu3mA3jRuIgYQgRj b9QJ9n+kb5hz6VZwR4DkObhmF8efNycK987b20ARQB86pQoE+3/GrnKBb66wX+qpeF7J 3J1vh8BwMIdxpfA3Xf66o/McfwJvlt3mHUMpVOHFNjpPdGsgaG0bKk9plAP17kOa/Ypz VhVA== 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:message-id:date :subject:cc:to:from:sender:dkim-signature:dkim-signature; bh=/Mn6G4XpnMJIkPWDB4pvdinbVRA/+dtRhYlZhJbWkiM=; b=g1zNOfHCOHpT9bO7/XDRbSKybGTjaIy12Y+glPOOcOMzO6M7tZjeRZxI2V21SfxTMq ZaQbX746fO4m56IqGzD+3OaXM6kQI+VyVZCTrR+IOWgbj0xoO2WSciValNI3iKdZI+1B FnB46Pcam/5/8fmWZqTtGqg4U20HeNuuSen2OgorKDb9hnvMBKgTJhVX+PQ18qHcb5rm CktnOGTE6ORx3QjV5EMNnSjh4T0j+RPnlHo6ftbOUvUsU522yejvgH5mcFFohPmBbmmf r79B/1JTmIRbJ2k+NafVlffy6Qm8dAiBTlrrvVG19IOfBl+Eii5V4T9lxRVggZQx9hu9 S+CQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dCZFSuUk; spf=pass (google.com: domain of sam.van.den.berge@gmail.com designates 2a00:1450:4864:20::432 as permitted sender) smtp.mailfrom=sam.van.den.berge@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=/Mn6G4XpnMJIkPWDB4pvdinbVRA/+dtRhYlZhJbWkiM=; b=on3E1nWylKeE2EfvUzlMEpOQUMR8ZHbrwY8xPc8ctIsrR09cXRHP90EVVDrArZbUXW 8IrXqyL/PhJlsLN3yUOnyGImzS0XYFSGiz1ubl4So3Pc4gMvddLRffKN9R2RJl8H8q8O sDW3bfQ7f3IIfPiaib3TrjaoNAOii0xqZtgdR2heEm3RuICxQYVoHClJV5NyIJ/9kYKH phlz3S3cglmQhZ+ZPuivaxzmNIY30Oev9Rq6jbQYydMN8zv9RJRAURbKNiIU/0+6N/+g C8KOmCtT8fanaZjQcM20awWgzN+zHx9okMyRfxKS18Tz53uoa/gmqMDkBJIuSZ1X3HIS 8b7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=/Mn6G4XpnMJIkPWDB4pvdinbVRA/+dtRhYlZhJbWkiM=; b=msb7XY57+0qgoBJD8kBE0ZLLZWjZlFzRvveUyTuFI+58yuub0sR4WDs6JQGUfhDGO6 tbxLwXj6wQ8iH5AbnXnlD8ZSVMcrJSmTkCZSM1owjOpZp1CQkKofefMM/HalfmtoJ7ft HOFghhS8Z//ScnYujYR29kUoCWfbJy8QXIChEiT4e/kOxsM3qzU4sIXuJPqJroEASbIe JwrnLcSg9sPboQyndrsiAsoqrVILPDxn2BB7v2bGDAgMKPLLHTU9/+c0xFnqCv2lkko8 lYR0x8M6A65VB0ClzoTU/MLWTIX2caoXUMtlrYsR9Dd5IteetaS8BHRRnclvoiP3lCbe WRrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=/Mn6G4XpnMJIkPWDB4pvdinbVRA/+dtRhYlZhJbWkiM=; b=itmXSEcinVCNZrr3uoeTarlN/Op959g5Duz5X9MkcUUvCokQHQEcwg03gg2+koGbus UPXehtgCbXV+RwFQDQw9vw91Qfiq38ANm33o2aOJO+ykuZ2Qw1EywinDjE9zpJan8TA2 0eY4MNI3+koKNbfehM9QA55tWFqTqsiwqXaar/PFSqhqZRTcGG/Vl23dfRwWkHGZgdQK Xi9Ol9JIhrQIA6BQwpmpB4lRwoon9MhL08SBYSwns7WWL4wwqG1c2tlIBTlbW4Ik8s5m ZTUCUKxZizEIUVE2T5MuURJOsx9HKo0dXaB1xgxJFfOTRaDUY98lJCPMVnandsdeBVD6 1SGQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: ACrzQf3t88MaIvn03UxZ7TaRt+e/lx7kwwx2UDU4vGQObvzWORSy5Ihn fdwVfUT57H/8xbt2+KL2gws= X-Google-Smtp-Source: AMsMyM7xQTvt8n3pj79jCOKrvwyeH2VH6LIfbWGo/963FXbk05U8viXeabJWnydeVfdfPQJ/8w/Nog== X-Received: by 2002:a2e:b985:0:b0:26f:be8e:4b2b with SMTP id p5-20020a2eb985000000b0026fbe8e4b2bmr18270757ljp.150.1666880510416; Thu, 27 Oct 2022 07:21:50 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:ac2:4897:0:b0:49a:b814:856d with SMTP id x23-20020ac24897000000b0049ab814856dls316926lfc.1.-pod-prod-gmail; Thu, 27 Oct 2022 07:21:48 -0700 (PDT) X-Received: by 2002:a05:6512:1196:b0:4a2:4ddb:8415 with SMTP id g22-20020a056512119600b004a24ddb8415mr19057116lfr.518.1666880508883; Thu, 27 Oct 2022 07:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666880508; cv=none; d=google.com; s=arc-20160816; b=qYJlOK9xhuxTMck/qyhTM7F7P/URvO6sRvx9l47z1igv53Oid/0w2PjDs/dAVnZHTa YqEg19xCGqGkeFWImR7pVaZk89dHEmKLXibqVA1f5a2bFL2iO9QJUqtCV5K3nGwpxToW quO23T+Yb3rjtgQKppiN6/jcuzpk+mEUt9ELiIXiZRQs9XbQoRe40x4RywI1z5rUQyiI UkvFuZpmOniXWPU/pdqIZvAWhjTHZ2HRnX6aEqAZovpGAwZDyPBwh4ekko8K3S+T3Nbl axMLwjdRwf8rTHY3wXkt3rCB+fwe/qskQjFwbSsSdlxXV2i8hilaRz0pcZbnaIgR/zz3 ZGkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=yaB1MpMMhHkyQgFtrdRVsZdt4BaDegWe9bzyLm5+z2o=; b=QxTDY4MsiQhFFUL+NIhguu/pEKEM5CR8pgI5TShSc8LCCRjFR5xlQJ44wS0xQHsIf5 x0tqtyixyfqvItb6UpxAE/paRbFscuLkpQBLCiCi3sU5aPJ26b2oMzVxo535iOPkN3lc AM4H4Vfyrorp4S0WOgprq35hGD9XaSKb6QRcTBIhqkhnufaOFRluIV03RFGpEKOqcKzh YEWpcKVXs9XZ5JyktHHXOvzNVQwccQvV89sQN1FbqHCaC9C+2ULaq06BPwjYMZ0WwKy/ 1hJPcRx62Axdhqs2mqfgl+WaQcvBd1VeEomF8J3qiYBvZFgj9DgwCqcvhnTebvHzMknL mxsw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dCZFSuUk; spf=pass (google.com: domain of sam.van.den.berge@gmail.com designates 2a00:1450:4864:20::432 as permitted sender) smtp.mailfrom=sam.van.den.berge@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com. [2a00:1450:4864:20::432]) by gmr-mx.google.com with ESMTPS id o16-20020a05651205d000b0048b12871da5si59278lfo.4.2022.10.27.07.21.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Oct 2022 07:21:48 -0700 (PDT) Received-SPF: pass (google.com: domain of sam.van.den.berge@gmail.com designates 2a00:1450:4864:20::432 as permitted sender) client-ip=2a00:1450:4864:20::432; Received: by mail-wr1-x432.google.com with SMTP id w14so2427667wru.8 for ; Thu, 27 Oct 2022 07:21:48 -0700 (PDT) X-Received: by 2002:adf:d20f:0:b0:236:5e77:91f0 with SMTP id j15-20020adfd20f000000b002365e7791f0mr18265803wrh.169.1666880508055; Thu, 27 Oct 2022 07:21:48 -0700 (PDT) Received: from OP01518NB.WTSOUT.OIP.LOCAL (mail.oip.be. [81.246.50.154]) by smtp.gmail.com with ESMTPSA id bk13-20020a0560001d8d00b0023677693532sm1375113wrb.14.2022.10.27.07.21.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 07:21:47 -0700 (PDT) From: sam.van.den.berge@gmail.com To: swupdate@googlegroups.com Cc: sam.van.den.berge@gmail.com Subject: [swupdate] [meta-swupdate][PATCH] swupdate-lib.bblcass: replace swupdate_get_size with swupdate_get_decrypted_size Date: Thu, 27 Oct 2022 16:21:45 +0200 Message-Id: <20221027142145.670-1-sam.van.den.berge@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: sam.van.den.berge@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dCZFSuUk; spf=pass (google.com: domain of sam.van.den.berge@gmail.com designates 2a00:1450:4864:20::432 as permitted sender) smtp.mailfrom=sam.van.den.berge@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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: Sam Van Den Berge Commit c1586c7de422c introduced swupdate_get_size with the intention to have the unencrypted size of an artifact. However it gets the size from the artifact in the "s" folder which is the encrypted artifact. Hence currently swupdate_get_size gives the size of the encrypted artifact. To avoid any ambiguity I think it's best to rename that function to swupdate_get_decrypted_size and to get the file from the DEPLOY_DIR_IMAGE which contains the unencrypted artifact. Then it can be used without any ambiguity: properties: { decrypted-size = "$swupdate_get_decrypted_size(...)"; } Fixes: c1586c7de422c ("class: add function to get file size") Signed-off-by: Sam Van Den Berge --- classes/swupdate-lib.bbclass | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/swupdate-lib.bbclass b/classes/swupdate-lib.bbclass index 14a2a08..30d2e04 100644 --- a/classes/swupdate-lib.bbclass +++ b/classes/swupdate-lib.bbclass @@ -40,10 +40,11 @@ def swupdate_get_sha256(d, s, filename): m.update(data) return m.hexdigest() -def swupdate_get_size(d, s, filename): +def swupdate_get_decrypted_size(d, s, filename): import os - fname = os.path.join(s, filename) + deploydir = d.getVar('DEPLOY_DIR_IMAGE', True) + fname = os.path.join(deploydir, filename) fsize = os.path.getsize(fname) return str(fsize)