#!/bin/sh

# Installs userspace tools and helper packages in the target system.
#
# Things to install
# * cryptsetup: relies on base-installer instead

. /lib/partman/lib/base.sh

dm_crypt=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
		[ "$fs" != free ] || continue
		[ -f $id/method ] || continue
		[ -f $id/crypto_type ] || continue

		method=$(cat $id/method)
		[ $method = crypto ] || continue

		type=$(cat $id/crypto_type)
		case $type in
			dm-crypt)
				dm_crypt=yes
				;;
		esac
	done
	close_dialog
done
