From ab63af3116c409d4e12a9a2bcf18f2587441eed6 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 2 Apr 2021 11:28:48 +0900 Subject: [PATCH] scripts: tizen: sd_fusing: umount block part only when mounted The umount command is used without checking the block part is really mounted. Umount part only when mounted. The series for cleaning up fusing script is done, so bump up minor version instead of sub version. Change-Id: Ic665936838be4529973d63c6123db9a2c7acc7d7 Signed-off-by: Seung-Woo Kim --- scripts/tizen/sd_fusing_rpi3.sh | 9 +++++++-- scripts/tizen/sd_fusing_xu4.sh | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/tizen/sd_fusing_rpi3.sh b/scripts/tizen/sd_fusing_rpi3.sh index 1116b9b664..b1d28df0be 100755 --- a/scripts/tizen/sd_fusing_rpi3.sh +++ b/scripts/tizen/sd_fusing_rpi3.sh @@ -92,7 +92,12 @@ function fusing_image () { local -r input_size_mb=`expr $input_size / 1024 / 1024` print_message 2 "[Fusing $1 ($input_size_mb MiB)]" - umount $device + if [ "$blktype" == "part" ]; then + local MOUNT_PART=`mount | grep $device` + if [ "$MOUNT_PART" != "" ]; then + umount $device + fi + fi if [ $OLD_DD == 1 ]; then dd if=$fusing_img | pv -s $input_size | dd of=$device bs=$bs else @@ -370,7 +375,7 @@ function check_device () { function print_logo () { echo "" - echo "Raspberry Pi downloader, version 2.0.7" + echo "Raspberry Pi downloader, version 2.1.0" echo "" } diff --git a/scripts/tizen/sd_fusing_xu4.sh b/scripts/tizen/sd_fusing_xu4.sh index e35ad2735f..b9617fea41 100755 --- a/scripts/tizen/sd_fusing_xu4.sh +++ b/scripts/tizen/sd_fusing_xu4.sh @@ -141,7 +141,12 @@ function fusing_image () { local -r input_size_mb=`expr $input_size / 1024 / 1024` print_message 2 "[Fusing $1 ($input_size_mb MiB)]" - umount $device + if [ "$blktype" == "part" ]; then + local MOUNT_PART=`mount | grep $device` + if [ "$MOUNT_PART" != "" ]; then + umount $device + fi + fi if [ $OLD_DD == 1 ]; then dd if=$fusing_img | pv -s $input_size | dd of=$device seek=$seek bs=$bs else @@ -396,7 +401,7 @@ function check_device () { function print_logo () { echo "" - echo "[Odroid-XU3/4 downloader version 1.4.5]" + echo "[Odroid-XU3/4 downloader version 1.5.0]" echo "This version also supports Tizen 4.0." echo "" } -- 2.34.1