scripts: tizen: Improve the image flashing performance for RPI family 52/233352/3
authorJunghoon Kim <jhoon20.kim@samsung.com>
Thu, 14 May 2020 05:51:00 +0000 (14:51 +0900)
committerJunghoon Kim <jhoon20.kim@samsung.com>
Thu, 14 May 2020 07:19:10 +0000 (16:19 +0900)
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 <jhoon20.kim@samsung.com>
scripts/tizen/sd_fusing_rpi3.sh

index e1f61a5..6e3c52b 100755 (executable)
@@ -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 ""
 }