From 22952b7ea0543bb4f446752976d1d8ba232b021a Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Mon, 21 Nov 2016 10:15:09 -0500 Subject: [PATCH] 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 --- lib/common-functions | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/common-functions b/lib/common-functions index 25452586..7ef56d81 100644 --- a/lib/common-functions +++ b/lib/common-functions @@ -61,8 +61,9 @@ function finish_image () { mv $OUT_IMAGE_PATH $1 if [ "$DIB_CHECKSUM" == "1" ]; then - md5sum $1 > $1.md5 - sha256sum $1 > $1.sha256 + # NOTE(pabelanger): Read image into memory once and generate both checksum + # files. + md5sum $1 > $1.md5 & sha256sum $1 > $1.sha256 & wait fi echo "Image file $1 created..." }