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

2009-08-20 Thread Hugo Vanwoerkom

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 ^#

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_DS1307=m
CONFIG_RTC_DRV_DS1374=m
CONFIG_RTC_DRV_DS1672=m
CONFIG_RTC_DRV_MAX6900=m
CONFIG_RTC_DRV_RS5C372=m
CONFIG_RTC_DRV_ISL1208=m
CONFIG_RTC_DRV_X1205=m
CONFIG_RTC_DRV_PCF8563=m
CONFIG_RTC_DRV_PCF8583=m
CONFIG_RTC_DRV_M41T80=m
CONFIG_RTC_DRV_S35390A=m
CONFIG_RTC_DRV_FM3130=m
CONFIG_RTC_DRV_RX8581=m
CONFIG_RTC_DRV_M41T94=m
CONFIG_RTC_DRV_DS1305=m
CONFIG_RTC_DRV_DS1390=m
CONFIG_RTC_DRV_MAX6902=m
CONFIG_RTC_DRV_R9701=m
CONFIG_RTC_DRV_RS5C348=m
CONFIG_RTC_DRV_DS3234=m
CONFIG_RTC_DRV_CMOS=y
CONFIG_RTC_DRV_DS1286=m
CONFIG_RTC_DRV_DS1511=m
CONFIG_RTC_DRV_DS1553=m
CONFIG_RTC_DRV_DS1742=m
CONFIG_RTC_DRV_STK17TA8=m
CONFIG_RTC_DRV_M48T86=m
CONFIG_RTC_DRV_M48T35=m
CONFIG_RTC_DRV_M48T59=m
CONFIG_RTC_DRV_BQ4802=m
CONFIG_RTC_DRV_V3020=m
CONFIG_RTC_DRV_WM8350=m
CONFIG_RTC_DRV_PCF50633=m
...

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


Hugo


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org




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

2009-08-20 Thread Sven Joachim
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. 

 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?

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

Sven


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



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

2009-08-20 Thread Hugo Vanwoerkom

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





--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org




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

2009-08-20 Thread Sven Joachim
On 2009-08-20 18:42 +0200, Hugo Vanwoerkom wrote:

 Sven Joachim wrote:

 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

And what about your home-brew kernel?

 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.

Are you sure that it was not your self-compiled kernel under which that
failed?

Sven


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



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

2009-08-20 Thread Hugo Vanwoerkom

Sven Joachim wrote:

On 2009-08-20 18:42 +0200, Hugo Vanwoerkom wrote:


Sven Joachim wrote:
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


And what about your home-brew kernel?



I am adding those now, with the new make-kpkg, done.
Try booting that next.

snip


Are you sure that it was not your self-compiled kernel under which that
failed?


I am sure because I had to edit the grub menu for the Debian kernel to boot.
Mystery :-(

Hugo


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org




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

2009-08-19 Thread Hugo Vanwoerkom

Hugo Vanwoerkom wrote:

Hi,

Just did a giant Sid dist-upgrade. It caused trouble with the clock.

The hwclock is kept at local time. And 'hwclock --debug --directisa' 
says just that.


But now when the system boots it thinks that the time is UTC time and so 
for the local time it subtracts 5 hours.


That causes e2fsck to fail on all partitions in /etc/fstab because the 
time in their superblocks is 5 hours ahead of what it thinks the local 
time is.


date gives the true local time -5 hours
date -u gives the true local time

/etc/timezone has SystemV/CST6CDT

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.


But after the upgrade to util-linux version 2.16-3 the hwclock command 
fails to work on my system w/o the --directisa option. And these scripts 
don't use that.


So the clock cannot be set nor saved. As a result the system thinks that 
the current localtime is UTC and that the true localtime is 5 hours earlier.


Then when you reboot all fs get errors because the superblock time is 5 
hours in the future, producing an unusable system.


My solution was to dpkg -i util-linux_2.13.1.1-1_i386.deb which 
installed a util-linux version with a working hwclock.


On second thought I think I should have just replaced /sbin/hwclock with 
the working version.


It's a bug:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=542443

But util-linux has currently 439 bugs reported.

Hugo


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org




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

2009-08-19 Thread Sven Joachim
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.

 But util-linux has currently 439 bugs reported.

The maintainer is overloaded, that's for sure.

Sven


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



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

2009-08-19 Thread Hugo Vanwoerkom

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?

Hugo


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org




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

2009-08-19 Thread Sven Joachim
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.

Sven


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org