summaryrefslogtreecommitdiff
path: root/configs/install-iso/overlay/usr/bin
diff options
context:
space:
mode:
authorGerhard Brauer <gerbra@archlinux.de>2008-12-18 09:40:51 -0800
committerAaron Griffin <aaronmgriffin@gmail.com>2008-12-18 22:09:18 -0600
commit2267d62099d1bb5fa99efa1f81c9fe2151528c0d (patch)
treee7b6d3585b096145293fb26345a0ea2673a11151 /configs/install-iso/overlay/usr/bin
parent1b248c4ed6cefcee52ec78f1aa7e21b11c9e1cca (diff)
downloadarchiso32-2267d62099d1bb5fa99efa1f81c9fe2151528c0d.tar.xz
localtime/UTC corrections to the TZ script
The previous code handled timezone changes poorly when fiddling with the hwclock. Add localtime/UTC selection for the hwclock to circumvent this Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'configs/install-iso/overlay/usr/bin')
-rwxr-xr-xconfigs/install-iso/overlay/usr/bin/tz19
1 files changed, 16 insertions, 3 deletions
diff --git a/configs/install-iso/overlay/usr/bin/tz b/configs/install-iso/overlay/usr/bin/tz
index b1ebe92..05cfb28 100755
--- a/configs/install-iso/overlay/usr/bin/tz
+++ b/configs/install-iso/overlay/usr/bin/tz
@@ -1,10 +1,12 @@
#!/bin/bash
# written by Tobias Powalowski <tpowa@archlinux.org>
+# modified by Gerhard Brauer <gerbra@archlinux.de>
ANSWER="/tmp/.tz"
PATH=$PATH:/tmp/bin:/tmp/usr/bin:/tmp/sbin:/tmp/usr/sbin
TITLE="Arch Linux Time Setting"
BASEDIR="/usr/share/zoneinfo"
+CLOCKSOURCE="localtime"
abort()
{
@@ -74,6 +76,9 @@ dotimezone () {
REGIONS=""
SET_REGION=""
SET_ZONE=""
+
+dodialog yesno "Your current BIOS time is:\n$(hwclock)\n\nIf your BIOS clock is set to UTC choose YES\nOtherwise (or if unsure) choose NO" 15 65 && CLOCKSOURCE="UTC"
+
for i in $(grep ^[A-Z] $BASEDIR/zone.tab | cut -f 3 | sed -e 's#/.*##g'| sort -u); do
REGIONS="$REGIONS $i -"
done
@@ -90,6 +95,16 @@ if [ "${SET_REGION}" = "1" ]; then
echo $region/$zone > /tmp/.timezone
[ -e /etc/localtime ] && rm -f /etc/localtime
cp $BASEDIR/$region/$zone /etc/localtime
+ # after timezone changing set the system time back to hwclock value.
+ # Mostly on new installations the bios clock represent the correct time
+ # for the user. Either it is the users localtime or he has set the BIOS
+ # to UTC. CLOCKSOURCE value choose how the system time is resetted.
+ if [ "${CLOCKSOURCE}" = "UTC" ]; then
+ hwclock --hctosys --utc
+ else
+ hwclock --hctosys
+ fi
+
dohwclock
else
dodialog msgbox "Skipping Region and Timezone, else please select a Timezone!"
@@ -113,7 +128,7 @@ USE_NTPDATE=""
dodialog yesno "Do you want to use UTC for your clock?\n\nIf you choose 'YES' UTC (recommended default) is used,\nwhich ensures daylightsaving is set automatically.\n\nIf you choose 'NO' Localtime is used,\nwhich means the system will not change the time.\nLocaltime is also prefered on dualboot machines,\nwhich also run Windows, because UTC confuses it." 15 65 && HARDWARECLOCK="UTC"
dodialog infobox "Syncing hardwareclock to systemclock ..."
HWCLOCK_PARAMS="--hctosys"
-dodialog yesno "Your current time is:\n$(date)\n\nDo you want to change it?" "" "" && SET_TIME="1"
+dodialog yesno "Your (new) current time is:\n$(date)\n\nDo you want to correct it?" "" "" && SET_TIME="1"
if [ "${SET_TIME}" = "1" ]; then
[ $(which ntpdate) ] && dodialog 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!)" "" "" default=no && USE_NTPDATE="1"
if [ "${USE_NTPDATE}" = "1" ]; then
@@ -141,8 +156,6 @@ if [ "${SET_TIME}" = "1" ]; then
dohwclock
dodialog msgbox "Your current time is now:\n$(date)"
fi
-else
- dodialog msgbox "Current time was not changed!"
fi
S_NEXTITEM="3"
}