summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2009-03-30 21:13:40 +0200
committerDieter Plaetinck <dieter@plaetinck.be>2009-03-30 21:13:40 +0200
commitf3d44bb5f33bf927ef62bb0e6223e8312b9c4358 (patch)
tree8bcffb3efd04978688ea208304b4bc26889c71af /src
parenta6052f5c0739b5acdba0e736b7e320f339df126d (diff)
do hwclock (only) at the right time, optimize hwclock code, make UTC default (fixes FS#13752 - Make hwclock in UTC a "good idea"
Diffstat (limited to 'src')
-rw-r--r--src/core/libs/lib-misc.sh19
-rw-r--r--src/core/libs/lib-ui-interactive.sh5
2 files changed, 12 insertions, 12 deletions
diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh
index 1acebac..e09f3c8 100644
--- a/src/core/libs/lib-misc.sh
+++ b/src/core/libs/lib-misc.sh
@@ -102,19 +102,20 @@ cleanup_runtime ()
}
+# $1 UTC or localtime (hardwareclock)
dohwclock() {
- infofy "Syncing hardwareclock to systemclock ..."
- if [ "$HARDWARECLOCK" = "UTC" ]; then
- HWCLOCK_PARAMS="$HWCLOCK_PARAMS --utc"
- else
- HWCLOCK_PARAMS="$HWCLOCK_PARAMS --localtime"
- fi
-
+ infofy "Resetting hardware clock adjustment file"
[ ! -d /var/lib/hwclock ] && mkdir -p /var/lib/hwclock
if [ ! -f /var/lib/hwclock/adjtime ]; then
- echo "0.0 0 0.0" > /var/lib/hwclock/adjtime # what the hell is this for???
+ echo "0.0 0 0.0" > /var/lib/hwclock/adjtime
+ fi
+
+ infofy "Syncing hardwareclock to systemclock ..."
+ if [ "$1" = "UTC" ]; then
+ hwclock --utc
+ else
+ hwclock --localtime
fi
- hwclock $HWCLOCK_PARAMS #tpowa does it without, but i would add --noadjtime here
}
target_configure_initial_keymap_font ()
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index cb80c11..129b2cd 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -77,17 +77,16 @@ interactive_timezone () {
TIMEZONE=$ANSWER_TIMEZONE
infofy "Setting Timezone to $TIMEZONE"
[ -e /etc/localtime ] && rm -f /etc/localtime #why do we do this?? tpowa?
- dohwclock
}
interactive_time () {
# utc or localtime?
- ask_option no "Clock configuration" "Is your hardware clock in UTC or local time?" required "UTC" " " "localtime" " " || return 1
+ ask_option UTC "Clock configuration" "Is your hardware clock in UTC or local time? UTC is recommended" required "UTC" " " "localtime" " " || return 1
HARDWARECLOCK=$ANSWER_OPTION
- dohwclock
+ dohwclock $HARDWARECLOCK
if which ntpdate >/dev/null && ask_yesno "'ntpdate' was detected on your system.\n\nDo you want to use 'ntpdate' for syncing your clock,\nby using the internet clock pool?\n(You need a working internet connection for doing this!)" yes #TODO: only propose if network ok.
then