Power Developer
https://www.powerdeveloper.org/forums/

Problems setting time
https://www.powerdeveloper.org/forums/viewtopic.php?f=12&t=1310
Page 1 of 1

Author:  koan [ Tue Jul 03, 2007 2:05 am ]
Post subject:  Problems setting time

Hi,

I recently moved house and find myself in a new timezone.
I went into YAST and set my time to UTC+9. It seems that
every time I boot the clock is different.

This is really annoying as ext2 partitions keep getting
verified as the clock thinks it's 2012 or 2000 or something.

If I set the time from MorphOS, the clock is stable for
MOS so I don't think it is a problem with the on board
battery. (This isn't a solution because SUSE shows some weird
time and I need my file datestamps to be sensible).

I've got no idea where the problem might lie;
OF ? HAL ? SUSE ?

thanks!

(By the way, I'm running OpenSUSE 10.2)

Author:  czp [ Tue Jul 03, 2007 4:01 am ]
Post subject: 

I had similar problems only with earlier kernels. Did you remove the battery for any reason? Because in that case you need to re-initialize the real-time clock at OF level. There is a forth script floating around somewhere to fix it, hopefully still available...

Author:  geit [ Tue Jul 03, 2007 7:02 am ]
Post subject: 

Quote:
I had similar problems only with earlier kernels. Did you remove the battery for any reason? Because in that case you need to re-initialize the real-time clock at OF level. There is a forth script floating around somewhere to fix it, hopefully still available...
I had simular problems on Efika when battery power went low. Replacing by a new battery causes simular problems, as the clock was floating around.

Beside the clock at least on Efika the mac address is also changing to an alternative value.

This is how I fixed it:

1. Remove battery
2. power on and try to set clock.
3. read clock and compare if it's still correct.
4. If the time is now correct, then put (carefully) the battery without shutting down the system. Now problem is solved.
5. if the time is still incorrect, then power down, wait a few minutes, power up and restart with step 2.

This worked for me. Using the system over a month now and the problems are gone and never returned.

Geit

Author:  koan [ Wed Jul 04, 2007 1:40 am ]
Post subject: 

I didn't remove the battery, but my Peg was in transit for 2 months.

I don't like the idea of fiddling with the motherboard while powered up and I can't imagine how this procedure would be successful (OF resets itself when it doesn't find the battery ?)

The weird thing is that MOS is happy with the time. It's only SUSE that has problems.

The OF script sounds better. Any chance you remember some key words so I can search for it ?

Author:  czp [ Wed Jul 04, 2007 4:25 am ]
Post subject: 

It was rtc, as far as I can remember. It fall victim of a regular clean up of my /dev/hda1, so I don't have it any more...

Author:  koan [ Wed Jul 04, 2007 7:30 pm ]
Post subject: 

Do you think this might be it ?

(From http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml)
Code:
# decimal dev rtc sec min hour day month year set-time
# The example below sets the clock to 1:23:45 June, 7th, 2000
ok
0 > decimal dev rtc 45 23 1 6 7 2000 set-time
ok
1 >
By the way, scratch all that stuff about time being OK on MOS; it's also broken.

Author:  Neko [ Thu Jul 05, 2007 2:28 am ]
Post subject: 

Quote:
Do you think this might be it ?
It's not.

http://www.powerdeveloper.org/platforms/pegasos/rtc

Here it is! Download it to a bootable place, and do this;

ok boot hd:0 rtc.forth
ok rtc.reset

There are further instructions inside the script. It basically manually edits the real-time clock's nvram.

Author:  koan [ Thu Jul 05, 2007 10:44 pm ]
Post subject: 

Thanks Matt.

Author:  koan [ Wed Jul 11, 2007 1:15 am ]
Post subject:  It wasn't enough

I tried the rtc script and it reset the clock. I set the time in MorphOS and booted OpenSUSE and checked it again.

After another boot, SUSE changed the time. During the shutdown SUSE saves the time to the hardware clock.

I think SUSE must have some problems with timezones or something. It doesn't seem to be reading the real time clock correctly.

Author:  czp [ Wed Jul 11, 2007 1:35 am ]
Post subject: 

If you start /sbin/yast2 timezone, what do you see at the lower left part of the screen? 'localtime' or 'UTC'? If you leave it at UTC and then set the correct time, it won't work for MorphOS, which uses 'localtime' for storing the time, or for most of the Linux distributions. So, please set it to 'localtime', and your problems will most probably go away...

Author:  Neko [ Wed Jul 11, 2007 8:06 am ]
Post subject:  Re: It wasn't enough

Quote:
I tried the rtc script and it reset the clock. I set the time in MorphOS and booted OpenSUSE and checked it again.

After another boot, SUSE changed the time. During the shutdown SUSE saves the time to the hardware clock.

I think SUSE must have some problems with timezones or something. It doesn't seem to be reading the real time clock correctly.
hwclock has never worked properly on Pegasos. It assumes too much (yucky ISA clocks..), and it should be using RTAS, which should be encapsulated in the /dev/rtc interface. For some reason, on some systems, if you build in ISA style clocks, the RTAS interface through /dev/rtc stops working (wtf..?).

If you want to set your time, please use /proc/rtas/ interface for the most reliable way. It accepts a standard 32-bit value for seconds since 1970 (time_t). Passing in dates and parsing should be done by some other app.

What I would do anyway is remove the hwclock setting from the shutdown procedure. All SuSE needs to do is know the time. Also disable any NTP if you can.

Author:  czp [ Wed Jul 11, 2007 8:22 am ]
Post subject: 

I hope, my Peg does not now about this problem, as hwclock and ntpdate works here correctly from openSUSE 10.1 :) They also worked fine for 10.0, just booting 10.1 after 10.0 (or vice versa, I don't remember any more) messed up the clock a bit...

Author:  ogautherot [ Thu Jul 12, 2007 8:25 pm ]
Post subject:  Bad RTC

Koan,

I had a similar issue recently and it worked out to be the power supply that was not fully ATX-compliant (it was an old unit and I suspect the permanent 5V was missing or something).

My cent worth ;-)
Cheers
Olivier

Author:  koan [ Wed Jul 18, 2007 5:54 pm ]
Post subject: 

Thanks for the advice guys.

I tried everything you mentioned, unfortunately nothing worked. I don't know enough about hacking /proc to affect rtas but that is the next thing to look into.

I recently bought a new power supply so I don't think that is the problem. YaST thinks I'm on localtime, not UTC.

Page 1 of 1 All times are UTC-06:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/