summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehoon Chung <jh80.chung@samsung.com>2021-10-01 12:09:25 +0900
committerJaehoon Chung <jh80.chung@samsung.com>2021-10-01 13:23:18 +0900
commit78c632bb5ece759d9ad3e6016231ffad824ce34f (patch)
tree20d16c8c067c526d97dffa64e68533fe140049b0
parent51dd1e4c97ccc9502c445776d5d05b17eab02c3b (diff)
downloadu-boot-78c632bb5ece759d9ad3e6016231ffad824ce34f.tar.gz
u-boot-78c632bb5ece759d9ad3e6016231ffad824ce34f.tar.bz2
u-boot-78c632bb5ece759d9ad3e6016231ffad824ce34f.zip
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 <jh80.chung@samsung.com>
-rwxr-xr-xscripts/tizen/sd_fusing_rpi3.sh17
1 files changed, 14 insertions, 3 deletions
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"