script: sd_fusing_rpi3: fix the version checking
authorJaehoon Chung <jh80.chung@samsung.com>
Tue, 5 Oct 2021 09:49:25 +0000 (18:49 +0900)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 15 Nov 2021 14:18:27 +0000 (15:18 +0100)
Fix the version checking about supporting delete option.

Change-Id: I02d638fc30d0b8afd575ca14031a238185e3c2a8
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
scripts/tizen/sd_fusing_rpi3.sh

index 4b38aa7a908a5a3a0329ed8646a7878071f64877..0bd2bee891a1183e3316ec3ed4dcbd3a1cac9fbd 100755 (executable)
@@ -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,*