[OLPC-AU] hwclock accuracy

James Cameron quozl at laptop.org
Wed Jan 26 23:30:27 EST 2011

On Wed, Jan 26, 2011 at 06:09:02PM -0600, Jerry Vonau wrote:
> That actually makes things worse, try installing ntpdate and run it with
> the stock /etc/adjtime file, now the real time clock is set to localtime
> as that is the first time hwclock is run.
> http://osdir.com/ml/fedora-olpc-list/2009-08/msg00102.html
> http://dev.laptop.org/ticket/9705

http://dev.laptop.org/ticket/10605 in particular.

Until these problems are fixed, please change your build; remove
/etc/adjtime from /etc/rwtab, change the third line of /etc/adjtime to
be UTC, copy the zoneinfo file for to /etc/localtime, install ntpdate,
and write a script in /etc/NetworkManager/dispatcher.d/99-ntpdate 

if [ "$2" = "up" ]; then
  ntpdate ${YOUR_NTP_SERVER} && \
    hwclock --systohc

This will attempt to synchronise the time when the laptop connects to
infrastructure wireless.  (It can't be done at boot by
/etc/init.d/ntpdate because there is no network connection then).

You will also need to set timezone in Sugar, since it ignores
/etc/localtime.  Setting it in /etc/localtime is not enough.  GNOME and
text console timezone are correct.

Choose an appropriate NTP server.  pool.ntp.org might not be the best
for a large population of school based laptops.

Consider a longer timeout for ntpdate.  The default may not be suitable
for a class of laptops on a shared wet string.

The above tested on os860.

To read the RTC in OpenFirmware:

	ok select /rtc get-time decimal .s

The values are least significant first.

James Cameron

More information about the Devel mailing list