diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/libs/lib-misc.sh | 19 | ||||
-rw-r--r-- | src/core/libs/lib-ui-interactive.sh | 5 |
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 |