hwclock-set: use both systz and hctosys
Ben Hutchings wrote: If you use NTP and tell the kernel to adjust the system time, that causes the kernel to periodically write the system time to the RTC too, because the system time will be more accurate. For hysterical raisins, the first call to settimeofday() that specifies a 'time zone' (local time offset) implicitly sets whether the RTC is supposed to hold local time or UTC: if the time value is unspecified and the time offset is non-zero then the RTC holds local time, otherwise it holds UTC. There is no way to change this later! 'hwclock --hctosys' specifies both time value and time offset, and therefore implicitly configures the RTC to hold UTC (but only when NTP is used and it is written periodically by the kernel). So we absolutely have to run 'hwclock --systz' first. We could *also* run 'hwclock --hctosys' straight after that. Closes: #764552 Thanks: Ben Hutchings for debugging this.
Please register or sign in to comment