Files
finit/plugins
Joachim Wiberg bc8118d515 Fix #418: support systems with a broken RTC
This patch introduces a new configure option --with-rtc-file=FILE.  When
enabled the RTC plugin detects missing RTC device and falls back to save
and restore system time from a file instead.  When --with-rtc-file is
used without an argument the default file is /var/lib/misc/rtc, but the
feature itself is disabled by default.

The usefulness of this feature may not be obvious at first, but some
systems are equipped with an RTC that resets to a random date at power
on.  This can be really bad in the case the date is far in the future,
because an NTP sync would then cause time skips backwards, which shows
up in logs and causes a whole lot of pain in alarm systems.

The solution is to disable the RTC driver or device tree node, and when
Finit starts up, the RTC plugin detects a the device node and instead
restores time from the last save game.  Meaning time will always only
move forwards.

NOTE: when Finit is built --with-rtc-file we always save to disk, but
      only restore from the "save game" if restoring from RTC fails.
      If the system has no RTC we always restore from disk.

      As an added bonus, this change also makes sure to periodically
      sync also the RTC with the system clock.  Useful for systems
      that do not run an NTP client.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-04 10:40:35 +01:00
..
2017-01-16 07:32:09 +01:00
2024-01-07 01:50:50 +01:00
2024-01-07 01:50:50 +01:00
2024-01-07 01:50:50 +01:00
2024-01-07 01:50:50 +01:00
2024-01-07 01:50:50 +01:00
2024-01-07 01:50:50 +01:00
2024-01-07 01:50:50 +01:00
2024-01-07 01:50:50 +01:00
2024-01-07 01:50:50 +01:00
2024-04-28 19:38:03 +02:00
2024-01-07 01:50:50 +01:00
2024-01-07 01:50:50 +01:00