]> git.ipfire.org Git - thirdparty/util-linux.git/commit
hwclock: hctosys drift compensation II
authorJ William Piggott <elseifthen@gmx.com>
Wed, 15 Oct 2014 18:21:13 +0000 (14:21 -0400)
committerJ William Piggott <elseifthen@gmx.com>
Wed, 15 Oct 2014 18:21:13 +0000 (14:21 -0400)
commit2794995ad94f35b19284636224f1cfb9dca046a4
treed8875e89eed50516bfe678627cebf2d5eb98338e
parent06d199e89a5c9d1f98e985fc6d584049e232ed08
hwclock: hctosys drift compensation II

Allowing hctosys to drift compensate facilitates:

More precise setting of the System Clock early in
the boot process when --adjust cannot be used
because the file system is not writeable.

Applies sub second drift corrections immediately,
where as --adjust cannot.

Reduces boot time by not calling hwclock multiple
times, e.g., --hctosys early before fsck when the
file system is read-only, then --adjust later when
the file system is read-write and --hctosys again
for drift correction.

Use of --adjust elsewhere may no longer be
necessary.

Part II

After the original submission of this patch I
realized that now all operations except --systz
require drift corrected Hardware Clock time.
Therefore, it should be done only once early in
the process. Upon implementation of that premise
many improvements were facilitated:

* Adds drift correction to --hctosys.
* Adds setting system time with sub-second precision.
* Adds --get, a drift corrected 'show' operation.
* Improves drift factor calculation precision while
   greatly simplifying its algorithm.
* Fixes --show bug, printing integer sub-seconds, and
   now uses a more intuitive positive value.
* Fixes --predict bug, drift correction must be
   negated to predict future RTC time.
* Reduces the number of function arguments and
   lines of code.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
sys-utils/hwclock.c