summaryrefslogtreecommitdiffstats
path: root/packages.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-12-13 22:58:39 +0000
committerJeremy Katz <katzj@redhat.com>2002-12-13 22:58:39 +0000
commitde43b6f4afd0664e6cba0e7dd7db4705bbf4b8b6 (patch)
tree56cbf4933548aa9327fef970284407fed025509c /packages.py
parent80ed55f5307310341f3fc088e1a8382f578b9b52 (diff)
downloadanaconda-de43b6f4afd0664e6cba0e7dd7db4705bbf4b8b6.tar.gz
anaconda-de43b6f4afd0664e6cba0e7dd7db4705bbf4b8b6.tar.xz
anaconda-de43b6f4afd0664e6cba0e7dd7db4705bbf4b8b6.zip
set the time up
Diffstat (limited to 'packages.py')
-rw-r--r--packages.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/packages.py b/packages.py
index 35519b6d8..fb2e19631 100644
--- a/packages.py
+++ b/packages.py
@@ -466,6 +466,36 @@ def turnOnFilesystems(dir, thefsset, diskset, partitions, upgrade, instPath):
thefsset.makeFilesystems (instPath)
thefsset.mountFilesystems (instPath)
+def setupTimezone(timezone, upgrade, instPath, dir):
+ # we don't need this on an upgrade or going backwards
+ if upgrade.get() or (dir == DISPATCH_BACK):
+ return
+
+ tzfile = "/usr/share/zoneinfo/" + timezone.tz
+ if not os.access(tzfile, os.R_OK):
+ log("unable to set timezone")
+ else:
+ try:
+ iutil.copyFile(tzfile, "/etc/localtime")
+ except OSError, (errno, msg):
+ log("Error copying timezone (from %s): %s" %(tzfile, msg))
+
+ args = [ "/usr/sbin/hwclock", "--hctosys" ]
+ if timezone.utc:
+ args.append("-u")
+ elif timezone.arc:
+ args.append("-a")
+ else:
+ flags = None
+
+ try:
+ iutil.execWithRedirect(args[0], args, stdin = None,
+ stdout = "/dev/tty5", stderr = "/dev/tty5")
+ except RuntimeError:
+ log("Failed to set clock")
+
+
+
def doPreInstall(method, id, intf, instPath, dir):
if flags.test:
return