#!/bin/sh -e
# Use tzsetup because it's just like tzconfig but has a debconf UI
# (Also, it can ask about whether the hardware clock is GMT..)
. /usr/share/debconf/confmodule

if [ "$1" = new ]; then
	ASK=-g
	if db_get debian-installer/only-os && [ "$RET" = true ]; then
		ASK=
	fi
	db_get debian-installer/country || true
	tzsetup -y $ASK -c "$RET"

	# Work around timezone date problem as described in #246993
	if grep "^UTC=no" /etc/default/rcS >/dev/null; then
		touch /etc/modules.conf
		if [ -f /lib/modules/`uname -r`/modules.dep ]; then
			touch /lib/modules/`uname -r`/modules.dep
		fi
	fi
else
	tzsetup -y -g
fi
