[lfs-dev] Possible bug in hwclock

Pierre Labastie pierre.labastie at neuf.fr
Wed Oct 18 03:34:06 PDT 2017

On 18/10/2017 08:38, Pierre Labastie wrote:
> Hi,
> Some of the computers I use (those with Windows dual boot), have a hardware
> clock set to local time. In this case, I set UTC=0 in /etc/sysconfig/clock,
> and until recently, all was fine. But now, after each reboot, the system clock
> is at (local time)+2h, that is, the system clock is set as if the hardware
> clock were at utc (time in Western Europe with daylight saving is UTC+2).
> Since ntpd is run, the system clock is back to the correct time after a few
> minutes, and then everything is OK. But if I begin working to early after boot
> (usually updating the system to recent updates in the book), I may have files
> with a date in the future, and "make" is at lost.
> Now I have tried (in case this is not evident "mardi" is "Tuesday"):
> ------------------
> pierre at turboli:~$ cat /etc/adjtime
> 0.329349 1508224464 0.000000
> 1508224464
> pierre at turboli:~$ date
> mardi 17 octobre 2017, 09:16:08 (UTC+0200)
> pierre at turboli:~$ sudo hwclock --utc
> 2017-10-17 11:17:04.765018+0200
> pierre at turboli:~$ sudo hwclock --localtime
> 2017-10-17 09:17:13.327558+0200
> pierre at turboli:~$ sudo hwclock --systohc
> pierre at turboli:~$ sudo hwclock --hctosys
> pierre at turboli:~$ date
> mardi 17 octobre 2017, 09:17:33 (UTC+0200)
> --------------------
> So everything is OK, and I suspect the problem occurs only when "hwclock
> --hctosys" is called for the first time: there is something in the man page
> about a difference between first time and next times (note that I am not sure
> whether it is in the kernel or in hwclock).
> More tests to come, but it is a little harder to test while the boot scripts
> are run.
> Ah, forgot to tell: it is with SYSV. Maybe the systemd units take care of that...

Hmm, there is no Sxxsetclock link in any rcx.d directory...

Well, browsing the bootscript logs seems to imply that udev is supposed 
to take care of this (?)

OK, it is in our 55-lfs.rules :
SUBSYSTEM=="rtc", ACTION=="add", MODE="0644", 
RUN+="/etc/rc.d/init.d/setclock start"
KERNEL=="rtc", ACTION=="add", MODE="0644", 
RUN+="/etc/rc.d/init.d/setclock start"

And... 55-lfs.rules is not there !!!

it is because I reinstalled eudev using the new lfs updater in 
jhalfs/blfs... And an error occurred (the udev-lfs tarball was not 
found), but got unnoticed. I hate bash: "set -e" works every other time.

Anyway sorry for the noise, and for anybody using the lfs updater in 
jhalfs/blfs, this is a warning


More information about the lfs-dev mailing list