[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [WORKAROUND]what sets the time at boot?



Sven Joachim wrote:
On 2009-08-20 17:24 +0200, Hugo Vanwoerkom wrote:

Sven Joachim wrote:
On 2009-08-19 20:37 +0200, Hugo Vanwoerkom wrote:

Sven Joachim wrote:
On 2009-08-19 19:08 +0200, Hugo Vanwoerkom wrote:

Hugo Vanwoerkom wrote:
So my question is: who at boot time is responsible for realizing
that the hwclock is kept in local time and UTC time?

And the answer is: /etc/init.d/hwclock.sh and
/etc/init.d/hwclockfirst.sh do that from package util-linux.
They don't do this anymore unless your system is not using udev.

It's a bug:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=542443
In which you state that you don't have /dev/rtc.  I'm not sure that
systems without that file are supported.

How does one go about getting /dev/rtc?
,----
| % grep -i rtc /boot/config-$(uname -r) | grep -v ^#
| CONFIG_HPET_EMULATE_RTC=y
| CONFIG_RTC_LIB=y
| CONFIG_RTC_CLASS=y
| CONFIG_RTC_HCTOSYS=y
| CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
| CONFIG_RTC_INTF_SYSFS=y
| CONFIG_RTC_INTF_PROC=y
| CONFIG_RTC_INTF_DEV=y
| CONFIG_RTC_DRV_CMOS=y
`----

In the kernel configuration, select "Device Drivers" -> "Real Time Clock"
and check the options.  Note that udev should create a symlink
/dev/rtc -> rtc0 automatically for you.

This is what I get:

...
/home/hugoThu Aug 20-10:17:33HDC3# grep -i rtc
/boot/config-2.6.30-1-686 | grep -v ^#

This is *not* the kernel you used when you filed #542443.

Good eyes! Indeed it is not, it is the latest Debian Sid kernel 2.6.30-1-686



CONFIG_HPET_EMULATE_RTC=y
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
[...]
CONFIG_RTC_DRV_CMOS=y

Looks good, I don't think you need the other modules.

and that system with the new hwclock command claimed it could not read
the system clock!

a) Do you use udev?

Yes


b) Can you access /dev/rtc0, e.g. with "hwclock -f /dev/rtc0"?


This is what I get when booting the Debian kernel: Note that I have installed the old hwclock and the new one is named hwcock.new.

...
Script started on Thu 20 Aug 2009 11:23:36 AM CDT
executing /root/.bashrc
/Thu Aug 20-11:23:36HDC3# uname -a
Linux debian 2.6.30-1-686 #1 SMP Mon Aug 3 16:18:30 UTC 2009 i686 GNU/Linux
/Thu Aug 20-11:23:43HDC3# hwclock -r
Thu 20 Aug 2009 11:24:01 AM CDT  -0.196089 seconds
/Thu Aug 20-11:24:01HDC3# hwclock.new -r
Thu 20 Aug 2009 11:24:12 AM CDT  -0.895455 seconds
/Thu Aug 20-11:24:12HDC3# hwclock.new -f /dev/rtc0
Thu 20 Aug 2009 11:24:58 AM CDT  -0.602721 seconds
/Thu Aug 20-11:24:58HDC3# hwclock.new --version
hwclock from util-linux-ng 2.16
/Thu Aug 20-11:25:42HDC3# hwclock --version
hwclock from util-linux-ng 2.13.1.1
/Thu Aug 20-11:25:49HDC3# hwclock.new -r --debug
hwclock from util-linux-ng 2.16
Using /dev interface to clock.
Last drift adjustment done at 1250784446 seconds after 1969
Last calibration done at 1250784446 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2009/08/20 11:26:33
Hw clock time : 2009/08/20 11:26:33 = 1250785593 seconds since 1969
Thu 20 Aug 2009 11:26:33 AM CDT  -0.897704 seconds
/Thu Aug 20-11:26:33HDC3# exit
exit
Script done on Thu 20 Aug 2009 11:26:59 AM CDT
...

Which means that now I cannot get it to fail. But I swear (TM) that I tried that and got a failure.

Hugo





Reply to: