hwclock on a IBM/Lenovo Thinkpad T60
This page covers an issue related to the system clock, which I came across when using Debian Linux on an IBM/Lenovo Thinkpad T60. According to what I found in the web, this issue however seems not to be limited to the combination Debian-T60, but also appears on a couple of other notebooks and with other Linux distributions. The symptoms are:
- If the hardware clock is running on local time, e.g. because a Windows is installed as a second operating system on the machine and expects this, the system clock under Linux has an offset of exactly the difference between UTC and the local time zone.
- During the boot process, you see the following error message when the system clock should be set:
select() to /dev/rtc to wait for clock tick timed out - If you run the command "hwclock" as root, you get the same message, "hwclock --systohc" and "hwclock --hctosys" are not working.
The reason for this problem is the interaction between the RTC driver and the hardware clock, which does not work properly here.
However, using the additional parameter "--directisa", hwclock can be forced to use direct I/O access to the clock instead of using the RTC driver.
To force hwclock to always use this parameter, the following modification can be done (as root):
- Rename the file /sbin/hwclock, e.g. into /sbin/hwclock.bin
- Create a new file /sbin/hwclock with the following content:
#! /bin/sh
/sbin/hwclock.bin --directisa $*
- Manually execute "hwclock --hctosys", which is now working, to set the system time after the hardware clock.
That's it! Now, all described symptoms are gone and the system clock is correct.
