Bump buildroot to 2019.02
This commit is contained in:
@@ -12,7 +12,12 @@ if BR2_PACKAGE_NTP
|
||||
config BR2_PACKAGE_NTP_SNTP
|
||||
bool "sntp"
|
||||
help
|
||||
Simple network time protocol program
|
||||
Simple network time protocol program (a replacement
|
||||
for the ntpdate tool)
|
||||
|
||||
A script is installed as S48sntp which will retrieve and
|
||||
step the time if there is a large difference before ntpd
|
||||
takes over the necessary slew adjustments in S49ntp.
|
||||
|
||||
config BR2_PACKAGE_NTP_NTP_KEYGEN
|
||||
bool "ntp-keygen"
|
||||
|
||||
55
bsp/buildroot/package/ntp/S48sntp
Normal file
55
bsp/buildroot/package/ntp/S48sntp
Normal file
@@ -0,0 +1,55 @@
|
||||
#!/bin/sh
|
||||
|
||||
DAEMON="sntp"
|
||||
# sntp uses all the IPs resolved for the hostname (i.e. pool.ntp.org has 4).
|
||||
# It will try each until they either all timeout or time has been set. Thus
|
||||
# default to only providing one NTP pool host.
|
||||
SNTP_SERVERS="pool.ntp.org"
|
||||
# Step if time delta is greater then 128ms, otherwise slew
|
||||
SNTP_ARGS="-Ss -M 128"
|
||||
SNTP_KEY_CACHE="/tmp/kod"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
start() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
# Create key cache file to prevents warning that file is missing
|
||||
touch $SNTP_KEY_CACHE
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
/usr/bin/$DAEMON $SNTP_ARGS -K $SNTP_KEY_CACHE $SNTP_SERVERS
|
||||
# sntp behavior
|
||||
# - Does not background
|
||||
# - Does not infinitely block
|
||||
# - Time-out w/o network = ~2 sec
|
||||
# - Time-out w/ network = ~5sec * # of servers
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "Nothing to do, $DAEMON is not a daemon."
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
echo "Nothing to do, $DAEMON does not support reload."
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
||||
6
bsp/buildroot/package/ntp/S49ntp
Executable file → Normal file
6
bsp/buildroot/package/ntp/S49ntp
Executable file → Normal file
@@ -1,10 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
NAME=ntpd
|
||||
DAEMON=/usr/sbin/$NAME
|
||||
|
||||
# Gracefully exit if the package has been removed.
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
# Read config file if it is present.
|
||||
if [ -r /etc/default/$NAME ]
|
||||
@@ -15,7 +11,7 @@ fi
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting $NAME: "
|
||||
start-stop-daemon -S -q -x $DAEMON -- -g
|
||||
start-stop-daemon -S -q -x /usr/sbin/ntpd -- -g
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
NTP_VERSION_MAJOR = 4.2
|
||||
NTP_VERSION = $(NTP_VERSION_MAJOR).8p12
|
||||
NTP_SITE = https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-$(NTP_VERSION_MAJOR)
|
||||
NTP_DEPENDENCIES = host-pkgconf libevent $(if $(BR2_PACKAGE_BUSYBOX),busybox)
|
||||
NTP_DEPENDENCIES = host-pkgconf libevent
|
||||
NTP_LICENSE = NTP
|
||||
NTP_LICENSE_FILES = COPYRIGHT
|
||||
NTP_CONF_ENV = ac_cv_lib_md5_MD5Init=no
|
||||
@@ -22,7 +22,7 @@ NTP_CONF_OPTS = \
|
||||
# 0002-ntp-syscalls-fallback.patch
|
||||
NTP_AUTORECONF = YES
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
|
||||
ifeq ($(BR2_PACKAGE_OPENSSL),y)
|
||||
NTP_CONF_OPTS += --with-crypto --enable-openssl-random
|
||||
NTP_DEPENDENCIES += openssl
|
||||
else
|
||||
@@ -93,8 +93,16 @@ define NTP_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -m 644 package/ntp/ntpd.etc.conf $(TARGET_DIR)/etc/ntp.conf
|
||||
endef
|
||||
|
||||
# This script will step the time if there is a large difference
|
||||
# before ntpd takes over the necessary slew adjustments
|
||||
ifeq ($(BR2_PACKAGE_NTP_SNTP),y)
|
||||
define NTP_INSTALL_INIT_SYSV_SNTP
|
||||
$(INSTALL) -D -m 755 package/ntp/S48sntp $(TARGET_DIR)/etc/init.d/S48sntp
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_NTP_NTPD),y)
|
||||
define NTP_INSTALL_INIT_SYSV
|
||||
define NTP_INSTALL_INIT_SYSV_NTPD
|
||||
$(INSTALL) -D -m 755 package/ntp/S49ntp $(TARGET_DIR)/etc/init.d/S49ntp
|
||||
endef
|
||||
|
||||
@@ -106,4 +114,9 @@ define NTP_INSTALL_INIT_SYSTEMD
|
||||
endef
|
||||
endif
|
||||
|
||||
define NTP_INSTALL_INIT_SYSV
|
||||
$(NTP_INSTALL_INIT_SYSV_NTPD)
|
||||
$(NTP_INSTALL_INIT_SYSV_SNTP)
|
||||
endef
|
||||
|
||||
$(eval $(autotools-package))
|
||||
|
||||
Reference in New Issue
Block a user