case $MODE in
  configure)
    ARCH=${ARCH:-"$(dpkg --print-architecture)"}
    # force building an i386 environment on amd64 servers
    if [ "$ARCH" = "amd64" ]; then
	ARCH=i386

	# Force network APT source for the netinst CD, as the i386
	# binaries are missing on the CD.
	if [ file:///cdrom = "$option_mirror_value" ] ; then
	    if grep -qi "^deb cdrom:.*i386" /etc/apt/sources.list; then
		echo "info: Found i386 binaries on amd64 CD/DVD.  Keeping LTSP mirror as '$MIRROR'"
	    else
		NEWMIRROR=$(awk '/^deb (http|ftp):\/\/.* main/ { if (!first) { print $2; first=1 } }' < /etc/apt/sources.list)
		echo "info: Changing LTSP mirror from '$option_mirror_value' to '$NEWMIRROR'"
		option_mirror_value=$NEWMIRROR
		option_extra_mirror_value="http://ftp.skolelinux.org/skolelinux/ $option_dist_value local"
		echo "info: Added LTSP extra mirror '$option_extra_mirror_value'"
		NEWCOMPONENTS=$(echo $option_components_value | sed -r -e 's/(,local|local,)//')
		echo "info: Removing 'local' from components for other mirrors"
		option_components_value=$NEWCOMPONENTS
		echo "info: Adding Debian-Edu Archive key to apt-keys"
		option_apt_keys_value="$option_apt_keys_value,/usr/share/keyrings/debian-edu-archive-keyring.gpg"
		if [ high = "$http_proxy" ]; then
		    unset http_proxy
		    echo "info: http_proxy was set to high, this seems to be a debconf bug, remove it"
		fi
	    fi
	fi
    fi
  ;;
esac
