I set the RTC with hwclock -w just before shutting down. When I power it back on again it is set to 2020. At first I thought it might be the battery, but surely if that is the case it should default to 1970?
Where does the RTC get set in the shutdown sequence? I've looked around and cannot find anywhere. Someone suggested /usr/lib/systemd/system-shutdown but that doesn't seem to get run.
Someone suggested that, if true, whick it is, hwclock shouldn't be run? Any ideas?
root@Arcturus:~# zgrep HCTOSYS=y /proc/config.gz
CONFIG_RTC_HCTOSYS=y
alarm@Arcturus:~$ sudo hwclock
2020-10-10 09:10:12.405393+0100