#! /bin/sh

# Display a warning that Serial ATA RAID support is experimental.
# This script should be removed if that is no longer the case!

. /usr/share/debconf/confmodule

# Only display the warning the first time partman is initialized
if [ -f /var/lib/partman/sataraid-warning ]; then
	exit 0
fi

if type dmraid >/dev/null 2>&1; then
	if [ "$(dmraid -c -s)" != "No RAID disks" ]; then
		db_input critical partman-dmraid/experimental
		db_go || exit 10
		db_get partman-dmraid/experimental
		if [ "$RET" = false ]; then
			exit 10
		fi
	fi
fi

mkdir -p /var/lib/partman
> /var/lib/partman/sataraid-warning
