From 0f1de8fe3982ab24c3f9e10268584265f227be8d Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Tue, 24 Apr 2018 15:07:27 +0200 Subject: [PATCH] scripts/image: create .sha256 files of tar and zip files Signed-off-by: Matthias Reichl --- scripts/image | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/image b/scripts/image index d7644be694..e52bdaf24b 100755 --- a/scripts/image +++ b/scripts/image @@ -319,6 +319,11 @@ if [ "$1" = "release" -o "$1" = "mkimage" -o "$1" = "amlpkg" -o "$1" = "noobs" ] # create release tarball tar cf $TARGET_IMG/$IMAGE_NAME.tar -C target $IMAGE_NAME + # create sha256 checksum of tarball + ( cd $TARGET_IMG + sha256sum ${IMAGE_NAME}.tar > ${IMAGE_NAME}.tar.sha256 + ) + # create image files if requested if [[ ( "$1" = "amlpkg" || "$1" = "noobs" || "$1" = "mkimage" ) && -n "$BOOTLOADER" ]]; then # projects can set KERNEL_NAME (kernel.img) @@ -423,6 +428,11 @@ if [ "$1" = "release" -o "$1" = "mkimage" -o "$1" = "amlpkg" -o "$1" = "noobs" ] zip -q $TARGET_IMG/$IMAGE_NAME.zip * + # create sha256 checksum of zip + ( cd $TARGET_IMG + sha256sum ${IMAGE_NAME}.zip > ${IMAGE_NAME}.zip.sha256 + ) + popd > /dev/null popd > /dev/null @@ -531,6 +541,11 @@ if [ "$1" = "release" -o "$1" = "mkimage" -o "$1" = "amlpkg" -o "$1" = "noobs" ] # create release tarball tar cf $TARGET_IMG/${IMAGE_NAME}-$1.tar -C $TARGET ${IMAGE_NAME}-$1 + + # create sha256 checksum of tarball + ( cd $TARGET_IMG + sha256sum ${IMAGE_NAME}-$1.tar > ${IMAGE_NAME}-$1.tar.sha256 + ) fi if [ -d $RELEASE_DIR ]; then