kbdchooser=/usr/bin/kbd-chooser
kbdmode=/usr/bin/kbd-mode

if [ "$TERM_TYPE" = virtual ]; then
	# Set console mode to unicode, if necessary.
	if [ -n "$TERM_UTF8" ] && [ -x $kbdmode ]; then
		$kbdmode -u
	fi

	# Set the kbd early, if necessary
	if [ -n "$bootkbd" ] && [ -x $kbdchooser ]; then
		debconf -o d-i $kbdchooser $bootkbd
	fi
fi
