]> git.ipfire.org Git - thirdparty/util-linux.git/commit
hwclock: Add --update-drift option
authorJ William Piggott <elseifthen@gmx.com>
Wed, 15 Oct 2014 19:48:17 +0000 (15:48 -0400)
committerJ William Piggott <elseifthen@gmx.com>
Wed, 15 Oct 2014 19:48:17 +0000 (15:48 -0400)
commitf276d71a3ef6a65299deb5e14a188e0a786ecebd
treefcdaae80c2cc10913484fbf0c3d1fe5a55d4a4b3
parent8db424dcbcd9dde3c1ed6b3027e8e98b9fda3d21
hwclock: Add --update-drift option

There are cases where we need to refresh the
timestamps in the adjtime file without updating the
drift factor.

For example, with ntpd and an Eleven Minute Mode
kernel, we need to call systohc at shutdown to
facilitate drift correction.  With the current
behavior hwclock will clobber the drift factor to
near zero, because the Hardware Clock and System
Clock are synced by Eleven Minute Mode.  What
actually needs to be done is refresh the adjtime
file timestamps and not calculate a new drift
factor.

Because it is a manual process to craft a good
Hardware Clock drift factor, that is, there is no
automated method that will produce a good drift
factor, this patch changes the default drift
calculation behavior to off, and it is turned on
by using the --update-drift option. Once we have a good
drift factor for a given machine we do not want
anything clobbering it, including an administrator
forgetting to turn off recalculation. A system
administrator should make a concious effort in
telling hwclock with the --update-drift option that
(s)he wants to recalculate the drift factor.

Without using the --update-drift option with calibrate
operations only the timestamps are refreshed in
the adjtime file. With the --update-drift option the old
default behavior of refreshing the timestamps and
updating the drift factor is performed.

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