Bug 430423 - fails to set clock on bootup since rtc-cmos driver isn't loaded yet
fails to set clock on bootup since rtc-cmos driver isn't loaded yet
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Kernel Maintainer List
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-27 17:49 EST by Charles R. Anderson
Modified: 2008-01-29 11:35 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-29 11:35:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to debug initscripts hwclock setting (817 bytes, patch)
2008-01-27 17:49 EST, Charles R. Anderson
no flags Details | Diff

  None (edit)
Description Charles R. Anderson 2008-01-27 17:49:11 EST
Description of problem:
hwclock fails to set the system time from the RTC since the kernel driver for
/dev/rtc isn't loaded yet.

Version-Release number of selected component (if applicable):
initscripts-8.62-1.x86_64

How reproducible:
always

Steps to Reproduce:
1. UTC=false in /etc/sysconfig/clock (not strictly necessary)
2. chkconfg ntpd off (not strictly necessary either)
3. Boot the system and watch the messages.
4. Note that clock is incorrect, especially if you don't have UTC=true set.

Actual results:

No usable clock interface found.
Cannot access the Hardware Clock via any known method.

Clock is incorrect by the UTC offset, or sometimes completely wrong.

Expected results:

Correct system time set from RTC.

Additional info:

Here is the bootup output from debugging with the included patch which also runs
hwclock again after start_udev, where it succeeds:

SELinux:  Disabled at runtime.
audit(1201454801.799:2): selinux=0 auid=4294967295
INIT: version 2.86 booting
                Welcome to Fedora
                Press 'I' to enter interactive startup.
+ update_boot_stage RCclock
+ '[' yes = yes -a -x /usr/bin/rhgb-client ']'
+ /usr/bin/rhgb-client --update=RCclock
+ return 0
+ ARC=0
+ SRM=0
+ UTC=0
+ '[' -f /etc/sysconfig/clock ']'
+ . /etc/sysconfig/clock
++ ZONE=America/New_York
++ UTC=false
++ ARC=false
+ '[' '' = GMT ']'
+ '[' '' = ARC ']'
+ CLOCKDEF=
+ CLOCKFLAGS=' --hctosys'
+ case "$UTC" in
+ CLOCKFLAGS=' --hctosys --localtime'
+ CLOCKDEF=' (localtime)'
+ case "$ARC" in
+ case "$SRM" in
+ ls -l /dev/rtc
crw------- 1 root root 10, 135 2008-01-27 12:26 /dev/rtc
+ grep rtc
+ lsmod
+ '[' -x /sbin/hwclock ']'
+ /sbin/hwclock --debug --hctosys --localtime
hwclock from util-linux-ng 2.13.1-rc2
hwclock: Open of /dev/rtc failed, errno=2: No such file or directory.
No usable clock interface found.
Cannot access the Hardware Clock via any known method.
++ date
+ action 'Setting clock  (localtime): Sun Jan 27 12:26:43 EST 2008' /bin/true
+ /sbin/start_udev
Starting udev: udevd-event[1396]: node_symlink: device node '/dev/rtc' already
exists, link to '/dev/rtc0' will not overwrite it
                                                           [  OK  ]
+ '[' -x /sbin/hwclock ']'
+ /sbin/hwclock --debug --hctosys --localtime
hwclock from util-linux-ng 2.13.1-rc2
Using /dev interface to clock.
Assuming hardware clock is kept in local time.
Waiting for clock tick...
/dev/rtc0 does not have interrupt functions. Waiting in loop for time from
/dev/rtc0 to change
...got clock tick
Time read from Hardware Clock: 2008/01/27 17:26:48
Hw clock time : 2008/01/27 17:26:48 = 1201472808 seconds since 1969
Calling settimeofday:
        tv.tv_sec = 1201472808, tv.tv_usec = 0
        tz.tz_minuteswest = 300
++ date
+ action 'Setting clock  (localtime): Sun Jan 27 17:26:48 EST 2008' /bin/true

...

+ /bin/dmesg -n 3
++ cat /proc/cmdline
+ cmdline='ro root=/dev/l.sys/root single'
+ '[' -f /proc/sys/kernel/modprobe ']'
+ strstr 'ro root=/dev/l.sys/root single' nomodules
+ '[' 'ro root=/dev/l.sys/root single' = 'ro root=/dev/l.sys/root single' ']'
+ return 1
+ '[' -f /proc/modules ']'
+ sysctl -w kernel.modprobe=/sbin/modprobe
+ touch /dev/.in_sysinit
+ '[' -x /bin/taskset ']'
+ strstr 'ro root=/dev/l.sys/root single' default_affinity=
+ '[' 'ro root=/dev/l.sys/root single' = 'ro root=/dev/l.sys/root single' ']'
+ return 1
++ pidof nash
+ nashpid=505
+ '[' -n 505 ']'
+ kill 505
+ unset nashpid
+ /sbin/start_udev
Starting udev: udevd-event[1396]: node_symlink: device node '/dev/rtc' already
exists, link to '/dev/rtc0' will not overwrite it
                                                           [  OK  ]
+ '[' -x /sbin/hwclock ']'
+ /sbin/hwclock --debug --hctosys --localtime
hwclock from util-linux-ng 2.13.1-rc2
Using /dev interface to clock.
Assuming hardware clock is kept in local time.
Waiting for clock tick...
/dev/rtc0 does not have interrupt functions. Waiting in loop for time from
/dev/rtc0 to change
...got clock tick
Time read from Hardware Clock: 2008/01/27 17:26:48
Hw clock time : 2008/01/27 17:26:48 = 1201472808 seconds since 1969
Calling settimeofday:
        tv.tv_sec = 1201472808, tv.tv_usec = 0
        tz.tz_minuteswest = 300
++ date
+ action 'Setting clock  (localtime): Sun Jan 27 17:26:48 EST 2008' /bin/true
Comment 1 Charles R. Anderson 2008-01-27 17:49:11 EST
Created attachment 293087 [details]
patch to debug initscripts hwclock setting
Comment 2 Bill Nottingham 2008-01-28 22:01:32 EST
This would be simpler to fix by having the clock built-in; otherwise we need to
shuffle around quite a bit, and I'd rather have the clock set as early as possible.
Comment 3 Chuck Ebbert 2008-01-29 11:35:53 EST
rtc-cmos is now built-in.

Note You need to log in before you can comment on or make changes to this bug.