#! /bin/sh

. /usr/share/debconf/confmodule

db_get auto-install/enable && [ "$RET" = true ] || exit 0
# disable locale & kbd selection for now
echo 1 >/var/run/auto-install.active

# if any (uncloaked) preseed has been specified, we exit
if { [ -e /preseed.cfg ] &&
		 ! { db_get auto-install/cloak_initrd_preseed && [ "$RET" = true ]; }
   } ||
   { db_get preseed/url  && [ "$RET" ]; } ||
   { db_get preseed/file && [ "$RET" ]; }
then
	exit 0
fi

# otherwise, register that no preseed was specified.
touch /var/run/preseed_unspecified_at_boot
# A preseed URL might still be delivered via DHCP.
# auto-install.sh checks for that, and removes the file if need be.
