This adds a new config file section "ntpdrift" to /etc/config/ntpclient
to support setting an initial value "freq" for frequency offset.
Changes /etc/hotplug.d/iface/20-ntpclient to call adjtimex
and do an initial frequency offset before starting ntpclient.
Signed-off-by: Steffen Hoffmann <hoff.st@shaas.net>
SVN-Revision: 10355
option hostname '3.openwrt.pool.ntp.org'
option port '123'
option count '1'
+
+config ntpdrift
+ option freq '0'
local cfgtype
config_get cfgtype "$cfg" TYPE
+ # initial frequency offset, if configured
+ case "$cfgtype" in
+ ntpdrift)
+ config_get freq $cfg freq
+
+ if [ ! "$freq" = "" ]; then
+ adjtimex -f $freq
+ fi
+ ;;
+ esac
+
case "$cfgtype" in
ntpclient)
config_get hostname $cfg hostname