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))
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,,-
,${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"