scripts/image: create .sha256 files of tar and zip files

Signed-off-by: Matthias Reichl <hias@horus.com>
This commit is contained in:
Matthias Reichl 2018-04-24 15:07:27 +02:00
parent adc0ff9836
commit 0f1de8fe39

View File

@ -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