Setting Permanent Clock
-
I'm trying to debug a kernel issue that seems like it is rebooting on kernel panic. I see that the parameter is set to -1 (reboot immediately) , which I changed to 0 (disable). But viewing the journalctl logs is quite annoying. Especially since the date is always set to Dec 15 2021.
I see there might be RTC support in the kernel setting the /dev/rtc0 clock to beginning of UTC time.
Dec 10 09:15:49 voxl kernel: rtc-pm8xxx c440000.qcom,spmi:qcom,pm8150@0:qcom,pm8150_rtc: rtc core: registered pm8xxx_rtc as rtc0 Dec 10 09:15:49 voxl kernel: rtc-pm8xxx c440000.qcom,spmi:qcom,pm8150@0:qcom,pm8150_rtc: setting system clock to 1970-01-01 00:00:05 UTC (5)
So couple questions
- Is that actually a RTC or is it virtual?
- Where is Dec 15 2021 set? Is it in the BIOS? I can't find it anywhere.
- timedatectl set-time does not stick after reboot, guessing date is defaulting to BIOS
- How can I modify BIOS either pre/post firmware flash to update the time I want?
-
@mrawding There is no RTC. If you have an Internet connection it will use NTP to set the time and it will save that time. If you start again but do not have an Internet connection it will use that saved time. It will not update that saved time until NTP is available again.
-
@Eric-Katzfey Thanks for the response. Chrony is our timesync service we use, but it doesn't stick after reboot. I'll have to look into mimicking the NTP sync in a different service. Thanks!
-
@mrawding Just answering my own forum for those who don't have access to internet based NTP server. A few solutions to stop it being synced back to Dec 15 2021
-
Run a local NTP server on the groundstation
-
If running a timesync service like chrony - write a system service to detect a difference between the system time and the last modification time of
/var/lib/systemd/timesync/clock
and then runningtouch /var/lib/systemd/timesync/clock
to reset this time - probably 1-5s daemon rate would make sense.
-