Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chronyd: add prefer and maxsources options #25855

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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