#!/bin/sh
set -e

. /usr/share/debconf/confmodule
. /lib/preseed/preseed.sh

# Re-enable locale and kbd selection
echo 0 >/var/run/auto-install.active

# transitional kludge to deal with old path based locations
db_get preseed/file
[ "${RET#/floppy*}" != "$RET" ] && RET="floppy://${RET#/floppy}"
[ "${RET#/*}" != "$RET" ] && RET="file://$RET"
db_set preseed/file $RET

preseed preseed/file
preseed_command preseed/early_command

# check if fetch-method/floppy has set a flag
if [ -e /var/run/preseed-usedfloppy ]; then
	umount /media || true
	rm /var/run/preseed-usedfloppy
fi
