Bug#785445: Bug#785419: linux-image-4.0.0-1-armmp: with 2 RTC devices -- need way to chose which one sets system clock on boot

Ben Hutchings ben at decadent.org.uk
Sat May 16 14:02:05 BST 2015


On Sat, 2015-05-16 at 05:01 -0700, Rick Thomas wrote:
> On May 16, 2015, at 3:13 AM, Ian Campbell <ijc at debian.org> wrote:
> 
> > On Fri, 2015-05-15 at 17:55 -0700, Rick Thomas wrote:
> > [...]
> >> There does not seem to be any way to over-ride this.  There's code in /etc/default/hwclock
> >> that would do part of the work in a sysvinit setup, but it seems to be ignored under systemd.
> > [...]
> >> Presumably, there is systemd magic that could do the same thing as was available under
> >> sysvinit.  Is there anybody out there with enough systemd foo to tell me how to do that?
> > 
> > I think that if systemd is not supporting /etc/default/hwclock and the
> > replacement mechanism is not apparent after some searching of the docs
> > etc then this should be considered a systemd bug (either in the docs if
> > not an actual code bug or missing feature).
> > 
> > Perhaps someone on the pkg-systemd-maintainers at alioth list will be
> > better able to advise on if/how systemd solves this problem?
> > 
> > Ian.
> 
> Thanks, Ian, for the prompt response.  I’ve submitted a separate bug
> to systemd asking for a fix.  However, it may not be possible to do
> this with systemd…  Looking at the dmesg output, it looks like the
> decision to use /dev/rtc0 is being made at the kernel level, before
> systemd even gets started.

That's right, the kernel optionally reads an RTC into the system time at
boot (CONFIG_RTC_HCTOSYS) and the name of the RTC to use is also part of
the kernel configuration (CONFIG_RTC_HCTOSYS_DEVICE).

> If that’s correct, I’m not sure if even sysvinit
> with /etc/default/hwclock could have done the right thing in my case.

This is not implemented directly by the init system.  util-linux
installs the script /lib/udev/hwclock-set and a udev rule that runs it
for each RTC device.  However, the hwclock-set script does nothing if
systemd is running.

> Do you happen to know why the patch I came across never made it into
> the kernel?

Don't know.

Ben.

-- 
Ben Hutchings
The obvious mathematical breakthrough [to break modern encryption] would be
development of an easy way to factor large prime numbers. - Bill Gates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 811 bytes
Desc: This is a digitally signed message part
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20150516/deba5f3d/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list