Fix the version checking about supporting delete option.
Change-Id: I02d638fc30d0b8afd575ca14031a238185e3c2a8
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
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
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,*