if [ -n "$TERM_FRAMEBUFFER_TRY" ] && \
   [ "$(debconf-get debian-installer/framebuffer)" = true ]; then
	echo "Trying to enable the frame buffer..."
	if [ ! -d /sys/class/graphics/fbcon ]; then
		modprobe -q fbcon >/dev/null 2>&1
	fi

	# Put the fb modules in the ramdisk so users can see the boot process
	if [ -d /sys/class/graphics/fb0 ]; then
		if [ "$(cat /sys/class/graphics/fb0/name)" = "udlfb" ]; then
			register-module -i udlfb
		else
			driver=$(basename $(readlink /sys/class/graphics/fb0/device/driver))
			register-module -i "$driver"
		fi
		register-module -i fbcon
	else
		echo "Failed to enable frame buffer."
	fi
fi

