From: Jaehoon Chung Date: Fri, 1 Oct 2021 03:09:25 +0000 (+0900) Subject: scripts: tizen: sd_fusing_rpi: use delete option about newer sfdisk X-Git-Tag: submit/tizen/20211123.233157~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32dc23dacd721386d867aa6ac2b1be2fa1c2bf4e;p=platform%2Fkernel%2Fu-boot.git scripts: tizen: sd_fusing_rpi: use delete option about newer sfdisk Use delete option before format. It's more stable than using dd. Change-Id: Ic77b543f49e7633027cbcf524c7c7a76a474d04e Signed-off-by: Jaehoon Chung --- diff --git a/scripts/tizen/sd_fusing_rpi3.sh b/scripts/tizen/sd_fusing_rpi3.sh index 16bab27913..4b38aa7a90 100755 --- a/scripts/tizen/sd_fusing_rpi3.sh +++ b/scripts/tizen/sd_fusing_rpi3.sh @@ -165,11 +165,18 @@ function mkpart_3 () { if [ $major -gt 2 ]; then sfdisk_new=1 else - if [ $major -eq 2 -a $minor -ge 26 ]; then + if [ $major -eq 2 -a $minor -ge 28 ]; then sfdisk_new=1 fi fi + if [ $sfdisk_new == 0 ]; then + echo "$(tput setaf 3)$(tput bold)NOTICE: Your sfidk ${version[0]}.${version[1]} version is too old. It can do unstable behavior!" + tput sgr 0 + echo "" + + fi + local -r DISK=$DEVICE local -r SIZE=`sfdisk -s $DISK` local -r SIZE_MB=$((SIZE >> 10)) @@ -225,10 +232,11 @@ function mkpart_3 () { umount $mnt done - echo "Remove partition table..." - dd if=/dev/zero of=$DISK bs=512 count=16 conv=notrunc if [ $sfdisk_new == 1 ]; then + echo "Remove partition table..." + sfdisk --delete $DISK + sfdisk $DISK <<-__EOF__ 4MiB,${BOOT_SZ}MiB,0xE,* 8MiB,${ROOTFS_SZ}MiB,,- @@ -243,6 +251,9 @@ function mkpart_3 () { ,${RESERVED2_SZ}MiB,,- __EOF__ else + echo "Remove partition table..." + dd if=/dev/zero of=$DISK bs=512 count=16 conv=notrunc + # calculate start positions for alignment for extended partitions let "USER_START = 4 + $BOOT_SZ + $ROOTFS_SZ + $DATA_SZ + 1" let "MODULE_START = $USER_START + $USER_SZ + 1"