-
-
Notifications
You must be signed in to change notification settings - Fork 70
Description
The Finit RTC plugin today handles restoring system clock from RTC at boot and saving system clock to RTC at reboot/poweroff. It is up to a NTP client to report synchronized status to the kernel so it can periodically (11 mins) update the RTC (in case of power-loss).
However, many embedded systems either have a broken RTC, or unreliable non-battery or supercap backed RTC, or don't even have an RTC at all. Particularly bad RTC behavior is when starting up with a completely random time, far into the future, instead of detecting power loss and defaulting to 1970-01-01T12:00:00. Because this will cause time skips backwards when the NTP client synchronizes the clock -- many alarm systems treat such time skips either badly or as warning conditions.
A useful enhancement for such systems would be if the Finit RTC plugin could restore time time from a file instead, and periodically (every 11 mins) save current system time to file. This would ensure time could only ever skip forwards, which is what most applications relying on time can deal with (better).
On systems with broken RTC you could either disable the driver or remove the node from the device tree to prevent the kernel from creating a /dev/rtc device. Finit could trigger the file based time save/restore based on missing /dev/rtc device.