Skip to content

Commit

Permalink
chronyd: add prefer and maxsources options
Browse files Browse the repository at this point in the history
* Added support for specifiying prefer option in server/pool/peer
* Added support for specifying maxsources option for pool

Maintainer: Miroslav Lichvar <[email protected]>
Signed-off-by: Jakub Lewandowski <[email protected]>
  • Loading branch information
Quba1 committed Jan 29, 2025
1 parent f9effa4 commit 7f3be50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/chrony/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=chrony
PKG_VERSION:=4.6.1
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://chrony-project.org/releases/
Expand Down
6 changes: 5 additions & 1 deletion net/chrony/files/chronyd.init
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ INCLUDEFILE=/var/etc/chrony.d/10-uci.conf
RTCDEVICE=/dev/rtc0

handle_source() {
local cfg=$1 sourcetype=$2 disabled hostname minpoll maxpoll iburst nts
local cfg=$1 sourcetype=$2 disabled hostname minpoll maxpoll iburst nts prefer maxsources

config_get_bool disabled "$cfg" disabled 0
[ "$disabled" = "1" ] && return
Expand All @@ -21,12 +21,16 @@ handle_source() {
config_get maxpoll "$cfg" maxpoll
config_get_bool iburst "$cfg" iburst 0
config_get_bool nts "$cfg" nts 0
config_get_bool prefer "$cfg" prefer 0
[ "$sourcetype" = "pool" ] && config_get maxsources "$cfg" maxsources
echo $(
echo $sourcetype $hostname
[ -n "$minpoll" ] && echo minpoll $minpoll
[ -n "$maxpoll" ] && echo maxpoll $maxpoll
[ "$iburst" = "1" ] && echo iburst
[ "$nts" = "1" ] && echo nts
[ "$prefer" = "1" ] && echo prefer
if [ "$sourcetype" = "pool" ] && [ -n "$maxsources" ]; then echo maxsources $maxsources; fi
)
}

Expand Down

0 comments on commit 7f3be50

Please sign in to comment.