Improve checksum performance for images

Do md5 and sha256 in parallel to speed things up for larger images.

Change-Id: Ib782fe54e4286ba2749a7ab7247f5d41a887a370
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2016-11-21 10:15:09 -05:00 committed by Ian Wienand
parent 96ce53fa16
commit 22952b7ea0

View File

@ -61,8 +61,9 @@ function finish_image () {
mv $OUT_IMAGE_PATH $1 mv $OUT_IMAGE_PATH $1
if [ "$DIB_CHECKSUM" == "1" ]; then if [ "$DIB_CHECKSUM" == "1" ]; then
md5sum $1 > $1.md5 # NOTE(pabelanger): Read image into memory once and generate both checksum
sha256sum $1 > $1.sha256 # files.
md5sum $1 > $1.md5 & sha256sum $1 > $1.sha256 & wait
fi fi
echo "Image file $1 created..." echo "Image file $1 created..."
} }