From 8620a95e827c2e9559e2553e2547cfc8105bbf38 Mon Sep 17 00:00:00 2001 From: Junghoon Kim Date: Thu, 14 May 2020 14:51:00 +0900 Subject: [PATCH] scripts: tizen: Improve the image flashing performance for RPI family The current dd of the pv combination degrades the performance due to the pipe overhead and is also bad to see due to the duplicate output. It can be resolved by the use of direct mode with progress status. This reduces the flashing time of platform images by 17.5% in my environment. Change-Id: I986ce72e0294b6f143ca95419364a0f89f289d74 Signed-off-by: Junghoon Kim --- scripts/tizen/sd_fusing_rpi3.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/tizen/sd_fusing_rpi3.sh b/scripts/tizen/sd_fusing_rpi3.sh index e1f61a5..6e3c52b 100755 --- a/scripts/tizen/sd_fusing_rpi3.sh +++ b/scripts/tizen/sd_fusing_rpi3.sh @@ -65,11 +65,12 @@ function fusing_image () { return fi - local -r input_size=`du -b $fusing_img | awk '{print $1}'` + local input_size=`du -b $fusing_img | awk '{print $1}'` + input_size=`expr $input_size / 1024 / 1024` - print_message 2 "[Fusing $1]" + print_message 2 "[Fusing $1 ($input_size MiB)]" umount $device - dd if=$fusing_img | pv -s $input_size | dd of=$device bs=$bs + dd if=$fusing_img of=$device bs=$bs status=progress oflag=direct local -r fstype=`blkid -o value -s TYPE $device` if [[ "$fstype" =~ "ext" ]]; then @@ -328,7 +329,7 @@ function check_device () { function print_logo () { echo "" - echo "Raspberry Pi3 downloader, version 1.2" + echo "Raspberry Pi3 downloader, version 1.3" echo "" } -- 2.7.4