CHROMIUM: tlsdated: Use bootstat to sync RTC on start/stop

We need to synchronize uptime and RTC before tlsdated has
a chance to touch it, so add a call on startup.

Note that this may delay tlsdated start a little (as `bootstat
--sync=rtc` may take a second to return), but this is not in the
critical path for boot.

The stop code is not normally used in production, but the boot
time autotest will manually stop tlsdated on shutdown to ensure
RTC/bootime is synchronize before reboot.

BUG=b:181084968
TEST=stop tlsdated; dmesg | grep sync

Cq-Depend: chromium:2741761
Change-Id: I952aebd234c0afe8bb7deb64bc06081432747ca8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/tlsdate/+/2744972
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
1 file changed