#!/bin/sh

. /lib/partman/lib/base.sh

use_crypto=no

for dev in $DEVICES/*; do
	[ -d "$dev" ] || continue
	cd $dev
	open_dialog PARTITIONS
	while { read_line num id size type fs path name; [ "$id" ]; }; do
		if [ -f $id/method ]; then
			method=$(cat $id/method)
			if [ $method = "crypto" ]; then
				use_crypto=yes
			fi
		fi
	done
	close_dialog
done

if [ "$use_crypto" = yes ]; then
	db_metaget partman-crypto/text/configure_crypto description
	printf "crypto\t%s\n" "$RET"
fi

