OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

> Wrong Date And Pdaxrom On/off Issues, How I dealed with them some time ago
kkazakov13
post Feb 17 2007, 10:58 PM
Post #1





Group: Members
Posts: 409
Joined: 3-December 06
Member No.: 13,063



When I started with beta3, had some time issues and pdaxrom occasionally "locking up" - which turns out to be because of wrong clock. Here I share my way of fixing them.

I use the following pair of scripts.
When you need date synchronization, just call 'dt' script.

(modify the values to your needs, I live in Sofia and use for sync ntp.intergenia.de, which you might not be able to access. Place the files in /usr/local/bin, and 'chmod +x' )

dt
CODE
#!/bin/bash

lt_unset

ntpdate ntp.intergenia.de
hwclock --systohc

lt_set


lt_set:
CODE
#!/bin/bash

rm -f /etc/localtime
ln -s /usr/share/zoneinfo/Europe/Sofia /etc/localtime


lt_unset:
CODE
#!/bin/bash

rm -f /etc/localtime



in /etc/apm/scripts.d/hwclock the functions inside look like this:

CODE
suspend() {
 lt_unset
 hwclock --systohc
 lt_set
 return 0
}

resume() {
 lt_unset
 hwclock --hctosys
 lt_set
 return 0
}


I can guarantee you that you will have _no_ problems with the clock anymore, just set the correct timezone and ntp server. If you don't have internet, you just can issue commands in 'dt' one by one, replacing ntpdate with 'date xxxx' command to set the clock.

Also, if you accidentally turn off your zaurus, don't turn it on immediately. wait 3-4 seconds at least, and then do it.

timezones package from the feed is required.
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
ToneBlind
post Jul 10 2009, 02:30 PM
Post #2





Group: Members
Posts: 82
Joined: 11-December 07
Member No.: 21,059



The obvious solution was to only stop atd before calling hwclock, and starting it right after. I've tested this, and now both the clock and atd (which means KO/PI alarm wakeup events) work.

CODE
suspend() {
/etc/rc.d/init.d/atd stop 2>/dev/null >/dev/null
hwclock --systohc
/etc/rc.d/init.d/atd start 2>/dev/null >/dev/null
return 0
}

resume() {
/etc/rc.d/init.d/atd stop 2>/dev/null >/dev/null
hwclock --hctosys
/etc/rc.d/init.d/atd start 2>/dev/null >/dev/null
return 0
}
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 30th July 2014 - 09:12 AM