[systemd-devel] Support machines with multiple RTCs?

Kay Sievers kay.sievers at vrfy.org
Tue Nov 22 09:28:02 PST 2011


On Tue, Nov 22, 2011 at 18:10, Martin Langhoff
<martin.langhoff at gmail.com> wrote:
> I have just been perusing the systemd code, and wondering whether it
> supports systems that have two RTCs (where usually only one of them is
> the battery-backed clock, the other isn't battery backed but can wake
> the system up).
>
> Background: OLPC's new laptop, XO-1.75, is an ARM SoC that has exactly
> that configuration. Linux kernels from 2.6.32 (and maybe earlier) can
> handle multiple RTCs, and let you configure which one to use to sync
> the clock in early boot (so userland doesn't have to).
>
> I have just reported a related bug in Fedora's initscripts (
> https://bugzilla.redhat.com/show_bug.cgi?id=756089 ), and a quick
> check of systemd sources hints at similar trouble here...
>
> Two key things seem to be missing:
>
>  #1 -- check for the hctosys property. If _any_ rtc present in the
> system has sysfs attribute hctosys == 1, it means that the kernel took
> care of it all, and userland doesn't need to call hwclock, at all.

Systemd requires that the time was set by the kernel. It does not
support any other config natively, that would be done by plugging-in
hwclock like it was on non-systemd systems.

The kernel's hctosys is hard coded in the kernel config, right?

>  #2 -- is customary to prefer /dev/rtc if present -- so that we can
> symlink to the right rtc from udev. src/util.c seems to hardcode rtc0.

Udev does that by default today:
  SUBSYSTEM=="rtc", DRIVERS=="rtc_cmos", SYMLINK+="rtc"

If possible, we could invent a /dev/rtc-systemtime symlink and use
that, if its not needed during bootup before udev is started and has
created the symlink?

Kay


More information about the systemd-devel mailing list