[systemd-devel] systemd and hardware real time clock

MichaƂ Zegan webczat_200 at poczta.onet.pl
Tue Jan 17 11:29:09 UTC 2017


Hello.

I am aware of the fact that systemd relies on the kernel to set system
clock from hardware clock, and that requires compiling rtc drivers into
the kernel, not as modules.
I am also aware that doing it othervise would mix timestamps in log entries.
The question is: if I have rtc driver as a module anyway, how to modify
initramfs so that system time would be set, in such a way so that it
happens *before* journald in initramfs starts? I assume it is an
initramfs using systemd inside of it.
One approach would be to have an udev rule that does trigger after rtc
appears or rtc symlink is added, this rule would start a service that
sets the system clock, but this service would have to always run before
journald, and that seems not possible in such a configuration, because
if someone would unplug the rtc the service would not run?
Another thing is to load rtc and i2c bus module where rtc is connected
statically without udev detection, and then the hwclock service would
always be triggered before journald without looking for rtcs appearing...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 525 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170117/e38525ba/attachment.sig>


More information about the systemd-devel mailing list