#!/bin/sh

. /lib/partman/definitions.sh

dev=$1
id=$2
cd $dev

if [ -f $id/detected_filesystem ]; then
    fs=$(cat $id/detected_filesystem)
    case "$fs" in
	linux-swap|ext2|ext3|fat16|fat32)
	    true
	    ;;
	ntfs)
	    if ! search-path ntfsresize; then
		exit 0
	    fi
	    ;;
	*)
	    exit 0
	    ;;
    esac
fi

open_dialog PARTITION_INFO $id
read_line x1 id size x4 x5 x6 x7 x8
close_dialog

hsize=$(longint2human $size)

db_metaget partman-partitioning/text/resize description
RET=$(stralign -25 "$RET")
printf "resize\t%s%s\n" "${RET}" "$hsize"

