From 8402fc16564acb758873edbfde91171404d51796 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Tue, 5 Oct 2021 18:49:25 +0900 Subject: script: sd_fusing_rpi3: fix the version checking Fix the version checking about supporting delete option. Change-Id: I02d638fc30d0b8afd575ca14031a238185e3c2a8 Signed-off-by: Jaehoon Chung --- scripts/tizen/sd_fusing_rpi3.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/tizen/sd_fusing_rpi3.sh b/scripts/tizen/sd_fusing_rpi3.sh index 4b38aa7a90..0bd2bee891 100755 --- a/scripts/tizen/sd_fusing_rpi3.sh +++ b/scripts/tizen/sd_fusing_rpi3.sh @@ -161,12 +161,16 @@ function mkpart_3 () { local major=${version[0]} local minor=${version[1]} local sfdisk_new=0 + local support_delete=0 if [ $major -gt 2 ]; then sfdisk_new=1 else - if [ $major -eq 2 -a $minor -ge 28 ]; then + if [ $major -eq 2 -a $minor -ge 26 ]; then sfdisk_new=1 + if [ $major -eq 2 -a $minor -ge 28 ]; then + support_delete=1 + fi fi fi @@ -235,7 +239,11 @@ function mkpart_3 () { if [ $sfdisk_new == 1 ]; then echo "Remove partition table..." - sfdisk --delete $DISK + if [ $support_delete == 1 ]; then + sfdisk --delete $DISK + else + dd if=/dev/zero of=$DISK bs=512 count=16 conv=notrunc + fi sfdisk $DISK <<-__EOF__ 4MiB,${BOOT_SZ}MiB,0xE,* -- cgit v1.2.3