From: Sam Van Den Berge <
sam.van....@gmail.com>
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 <
sam.van....@gmail.com>
---
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)
--
2.34.1