change config file used for hwclock-is-UTC setting
So, ever since the dawn of time, hwclock has written whether the
system's hardware clock is in UTC or not to /etc/adjtime whenever
it saves the hardware clock, and reads that file whenever it
restores it.
Given that, it seems odd that we've been maintaining that state
in a separate file all this time. The following patches to
anaconda and system-config-date stop doing that.
While they are there, they also nuke the arc stuff, because
1) if hwclock doesn't support figuring that out automatically,
it should
2) the current Alpha ports of Fedora don't support any ARC console
machines any more, in any case
Bill
diff --git a/installclass.py b/installclass.py
index 68a7e37..e9fcbe5 100644
--- a/installclass.py
+++ b/installclass.py
@@ -263,8 +263,8 @@ class BaseInstallClass(object):
def setGateway(self, id, gateway):
id.network.setGateway(gateway)
# Get the time zone info from the time zone page
if "timezone" in self.showPages:
- timezone, utc, arc = self.timezonePage.getTimezoneInfo ()
+ timezone, utc = self.timezonePage.getTimezoneInfo ()
else:
- timezone, utc, arc = self.timezoneBackend.getTimezoneInfo ()
+ timezone, utc = self.timezoneBackend.getTimezoneInfo ()
- if arc != "false":
- if arc != 0:
- arc = "true"
- else:
- arc = "false"
-
try:
shutil.copyfile(fromFile, "/etc/localtime")
except OSError, (errno, msg):
@@ -90,12 +84,20 @@
f.write('# The ZONE parameter is only evaluated by system-config-date.
')
f.write('# The time zone of the system is defined by the contents of /etc/localtime.
')
f.write('ZONE="%s"
' % timezone)
- f.write("UTC=%s
" % utc)
- f.write("ARC=%s
" % arc)
f.close()
-
- f = open("/etc/sysconfig/clock", "r")
- tmp = f.read()
+
+ f = open("/etc/adjtime", "r")
+ l = f.readlines()
+ f.close()
+
+ f = open("/etc/adjtime", "w")
+ f.write(l[0])
+ f.write(l[1])
+ if utc == 'true':
+ f.write("UTC
")
+ else:
+ f.write("LOCAL
")
+ f.close()
change config file used for hwclock-is-UTC setting
On Mon, 2008-02-04 at 15:56 -0500, Bill Nottingham wrote:
> So, ever since the dawn of time, hwclock has written whether the
> system's hardware clock is in UTC or not to /etc/adjtime whenever
> it saves the hardware clock, and reads that file whenever it
> restores it.
>
> Given that, it seems odd that we've been maintaining that state
> in a separate file all this time. The following patches to
> anaconda and system-config-date stop doing that.
Seems fine. Although the format of /etc/adjtime makes me want to cry a
little inside ;-)
Jeremy
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
02-11-2008, 05:36 PM
Bill Nottingham
change config file used for hwclock-is-UTC setting
Jeremy Katz (katzj@redhat.com) said:
> On Mon, 2008-02-04 at 15:56 -0500, Bill Nottingham wrote:
> > So, ever since the dawn of time, hwclock has written whether the
> > system's hardware clock is in UTC or not to /etc/adjtime whenever
> > it saves the hardware clock, and reads that file whenever it
> > restores it.
> >
> > Given that, it seems odd that we've been maintaining that state
> > in a separate file all this time. The following patches to
> > anaconda and system-config-date stop doing that.
>
> Seems fine. Although the format of /etc/adjtime makes me want to cry a
> little inside ;-)
Pushed.
Bill
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list