Re: [isar-cip-core] [PATCH] swupdate-img.bbclass: add checksum in non signed case as well


Jan Kiszka
 

On 13.01.21 11:52, Claudius Heine wrote:
Hi Jan,

On 2021-01-13 11:46, Jan Kiszka wrote:
On 11.01.21 16:48, Henning Schild wrote:
From: Claudius Heine <ch@denx.de>
Can you also provide a reasoning here?
I can, but I guess you mean that a commit message should be added here.
...or that you provide me a text I can fill in on merge.

Jan

Our swupdate has `DISABLE_CPIO_CRC=y` (because our images might be >2GB)
and we also currently support update via usb stick without any
signatures. So the only checksum that we have would be the sha256sum
inside the swdescription.

regards,
Claudius


Signed-off-by: Claudius Heine <ch@denx.de>
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
  classes/swupdate-img.bbclass | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/classes/swupdate-img.bbclass b/classes/swupdate-img.bbclass
index a21d6ec..a7a70f6 100644
--- a/classes/swupdate-img.bbclass
+++ b/classes/swupdate-img.bbclass
@@ -39,14 +39,14 @@ do_swupdate_image() {
          image_do_mounts
          cp -f '${SIGN_KEY}' '${WORKDIR}/dev.key'
          test -e '${SIGN_CRT}' && cp -f '${SIGN_CRT}'
'${WORKDIR}/dev.crt'
-
-        # Fill in file check sums
-        for file in ${SWU_ADDITIONAL_FILES}; do
-            sed -i "s:$file-sha256:$(sha256sum
'${WORKDIR}/swu/'$file | cut -f 1 -d ' '):g" \
-                '${WORKDIR}/swu/${SWU_DESCRIPTION_FILE}'
-        done
      fi
  +    # Fill in file check sums
+    for file in ${SWU_ADDITIONAL_FILES}; do
+        sed -i "s:$file-sha256:$(sha256sum '${WORKDIR}/swu/'$file |
cut -f 1 -d ' '):g" \
+            '${WORKDIR}/swu/${SWU_DESCRIPTION_FILE}'
+    done
+
      cd "${WORKDIR}/swu"
      for file in '${SWU_DESCRIPTION_FILE}' ${SWU_ADDITIONAL_FILES}; do
          echo "$file"
Jan

--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

Join cip-dev@lists.cip-project.org to automatically receive all group messages.