Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/etc/init.d/clock stop and start troubles [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
piroko
Tux's lil' helper
Tux's lil' helper


Joined: 25 Aug 2006
Posts: 77

PostPosted: Sun Aug 27, 2006 6:51 pm    Post subject: /etc/init.d/clock stop and start troubles [SOLVED] Reply with quote

Hello! I have been running gentoo on my powerbook since five months ago, and I am very happy to find more and more features getting implemented into the linux kernel. For the most part, I have been able to solve the problems that have come my way, but just recently my clock stops running after I shut my laptop down and I have no idea what caused it!

Just as an FYI, I'm running kernel 2.6.18-r4

My clock used to work fine, and hwclock --systohc and --hctosys work fine on boot and shutdown, as they always have. Does anyone have any suggestions as to what I may have done that killed the clock?

I will be more than happy to send any configs or command outputs that may be needed to get a better feeling of what I might have done. Any and all help will be very appreciated! Thank you in advance for reading my post!

Jeremy


Last edited by piroko on Mon Aug 28, 2006 7:01 pm; edited 3 times in total
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Mon Aug 28, 2006 5:19 pm    Post subject: Reply with quote

Software cannot "stop" your hardware clock that I know of. Do powerbooks have motherboard batteries for saving the clock time like desktops do? If it does...it might have gone bad.

While you are mulling over that problem, you could also use ntp to sync to the real time...
_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
piroko
Tux's lil' helper
Tux's lil' helper


Joined: 25 Aug 2006
Posts: 77

PostPosted: Mon Aug 28, 2006 5:55 pm    Post subject: Reply with quote

[/code]I'm pretty sure that powerbooks use the standard battery to power the clock. One thing I haven't tried yet is turning it off from OS X, and then booting it back into OS X to see if the problem is still there. If it isn't, then there must be something that OS X is doing that Linux isn't at shutdown or bootup. If only the firmware was open source! :)

EDIT: Now this is REALLY strange... I shut down my laptop from Linux at 13:46, waited 10 minutes, and booted into OS X. The clock read 13:56 as expected. Upon rebooting into Linux, the clock then read 13:47! The hardware clock init script seems to load just fine on boot. The only message I get that hints at anything wrong with the clock is this from the kernel:
Code:
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)


This sounds like a kernel misconfiguration on my part. Anyone have any suggestions or relevant RTC config lines from your (working) kernel? :)

EDIT AGAIN: Ok, I got rid of the rtc_class support out of the kernel entirely. And while playing around, I noticed that if I run /etc/init.d/clock stop, wait a minute, and then run /etc/init.d/clock start, my clock goes back to when I stopped it! However, if I run /sbin/hwclock --systohc, wait a minute, and then run /sbin/hwclock --hctosys, it works fine! It must be a problem with the script! I'm so close, but I don't understand exactly how the script works... I'm sure someone will know what to do now!

EDIT YET AGAIN AND RESOLVE!!!: I was looking through the /etc/init.d/clock script, and I noticed that there were two lines under start() for setting $errstr, one right after the other. One was
Code:
errstr=$(/sbin/hwclock ${myadj} ${myopts} 2>&1 >/dev/null)
and one right under it that read
Code:
errstr="${errstr}$(/sbin/hwclock --hctosys ${myopts} 2>&1 >/dev/null)"


I commented out the latter one, and everything worked like a charm. I have no idea how that line got there, but I'm happy I figured it out! :)
Back to top
View user's profile Send private message
timotheus25
Apprentice
Apprentice


Joined: 27 Dec 2005
Posts: 162
Location: *upstate* New York, USA

PostPosted: Tue Aug 29, 2006 2:02 am    Post subject: Reply with quote

Just a note that this problem is very classic for the powerbooks (esp. Albooks).

Make sure that /etc/init.d/clock is enabled for the boot runlevel, and that it uses the latest script from portage.

If necessary:
Code:

# rm /etc/init.d/clock
# emerge baselayout

_________________
http://tstotts.net/linux/gentoopb.html
http://tstotts.net/linux/gentooinsp640m.html
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Tue Aug 29, 2006 3:49 am    Post subject: Reply with quote

ahh, good catch, sorry I pointed you in the wrong direction, seems the other obvious problem now...
_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
rsala
Apprentice
Apprentice


Joined: 27 Jul 2003
Posts: 160
Location: Pittsfield, MA

PostPosted: Wed Aug 30, 2006 1:18 pm    Post subject: Reply with quote

I've been trying to get my new 2.6.17.7 kernel configured correctly on my Windtunnel G4, and I'm also getting the same message:
Code:

drivers/rtc/hctosys.c: unable to open rtc device (rtc0)

Which begs the question, do I want rtc_class support or rtc emulation, or both?
Back to top
View user's profile Send private message
timotheus25
Apprentice
Apprentice


Joined: 27 Dec 2005
Posts: 162
Location: *upstate* New York, USA

PostPosted: Wed Aug 30, 2006 1:54 pm    Post subject: Reply with quote

rsala wrote:

Which begs the question, do I want rtc_class support or rtc emulation, or both?


I do not know the answer to that. But on my Albook/PowerBook G4, the following works well.
Code:

#  zgrep '^CONFIG.*RTC' /proc/config.gz
CONFIG_GEN_RTC=y
CONFIG_GEN_RTC_X=y
CONFIG_RTC_LIB=m
CONFIG_RTC_CLASS=m
CONFIG_RTC_INTF_SYSFS=m
CONFIG_RTC_INTF_PROC=m
CONFIG_RTC_INTF_DEV=m


None of the modules are loaded; and nothing happens if they are loaded.
_________________
http://tstotts.net/linux/gentoopb.html
http://tstotts.net/linux/gentooinsp640m.html
Back to top
View user's profile Send private message
rsala
Apprentice
Apprentice


Joined: 27 Jul 2003
Posts: 160
Location: Pittsfield, MA

PostPosted: Wed Aug 30, 2006 2:54 pm    Post subject: Reply with quote

Do you have rtc emulation enabled as well?
Back to top
View user's profile Send private message
timotheus25
Apprentice
Apprentice


Joined: 27 Dec 2005
Posts: 162
Location: *upstate* New York, USA

PostPosted: Wed Aug 30, 2006 3:08 pm    Post subject: Reply with quote

rsala wrote:
Do you have rtc emulation enabled as well?


I think that the following are the Generic RTC emulation directives:
Code:

CONFIG_GEN_RTC=y
CONFIG_GEN_RTC_X=y


So, yes, I appear to have RTC emulation enabled and compiled-in directly. I do not recommend compiling it as a module or omitting it as I have had clock and video issues with trying that before.
_________________
http://tstotts.net/linux/gentoopb.html
http://tstotts.net/linux/gentooinsp640m.html
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum