From 33cd89a57f2be3fccda75a00836570fa47f6d49d Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Fri, 1 Mar 2024 21:28:43 +0100 Subject: [PATCH] ntpclient: remove ntp sources are dead and gone. The most important functionality is now provided by ntpd. Signed-off-by: Paul Donald (cherry picked from commit 2cd10d81134b5ff4b6350c477da3c9196e1b7489) --- net/ntpclient/Makefile | 57 ----------------- net/ntpclient/files/ntpclient.config | 23 ------- net/ntpclient/files/ntpclient.hotplug | 78 ------------------------ net/ntpclient/patches/100-daemon.patch | 22 ------- net/ntpclient/patches/200-time.patch | 54 ---------------- net/ntpclient/patches/300-siocgarp.patch | 12 ---- 6 files changed, 246 deletions(-) delete mode 100644 net/ntpclient/Makefile delete mode 100644 net/ntpclient/files/ntpclient.config delete mode 100644 net/ntpclient/files/ntpclient.hotplug delete mode 100644 net/ntpclient/patches/100-daemon.patch delete mode 100644 net/ntpclient/patches/200-time.patch delete mode 100644 net/ntpclient/patches/300-siocgarp.patch diff --git a/net/ntpclient/Makefile b/net/ntpclient/Makefile deleted file mode 100644 index ffe9e88412..0000000000 --- a/net/ntpclient/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -# -# Copyright (C) 2006-2014 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=ntpclient -PKG_VERSION:=2015_365 -PKG_RELEASE:=4 - -PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://doolittle.icarus.com/ntpclient -PKG_HASH:=95c3646919a9a2278fa384aa8e37117b250577ff8b09b8c93ba53e04e729b54b - -PKG_MAINTAINER:=Ted Hess - -PKG_LICENSE:=GPL-2.0 - -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-2015 - -include $(INCLUDE_DIR)/package.mk - -define Package/ntpclient - SUBMENU:=Time Synchronization - SECTION:=net - CATEGORY:=Network - TITLE:=NTP (Network Time Protocol) client - URL:=http://doolittle.icarus.com/ntpclient/ - DEPENDS:=+librt -endef - -define Package/ntpclient/description - NTP client for setting system time from NTP servers. -endef - -define Package/ntpclient/conffiles -/etc/config/ntpclient -endef - -MAKE_FLAGS += \ - all adjtimex - -define Package/ntpclient/install - $(INSTALL_DIR) $(1)/etc/hotplug.d/iface - $(INSTALL_DATA) ./files/ntpclient.hotplug $(1)/etc/hotplug.d/iface/20-ntpclient - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./files/ntpclient.config $(1)/etc/config/ntpclient - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpclient $(1)/usr/sbin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/adjtimex $(1)/usr/sbin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/rate.awk $(1)/usr/sbin/ -endef - -$(eval $(call BuildPackage,ntpclient)) diff --git a/net/ntpclient/files/ntpclient.config b/net/ntpclient/files/ntpclient.config deleted file mode 100644 index 10be886263..0000000000 --- a/net/ntpclient/files/ntpclient.config +++ /dev/null @@ -1,23 +0,0 @@ -config ntpserver - option hostname '0.openwrt.pool.ntp.org' - option port '123' - -config ntpserver - option hostname '1.openwrt.pool.ntp.org' - option port '123' - -config ntpserver - option hostname '2.openwrt.pool.ntp.org' - option port '123' - -config ntpserver - option hostname '3.openwrt.pool.ntp.org' - option port '123' - -config ntpdrift - option freq '0' - -config ntpclient - option interval 600 - #option count 10 - #option interface wan diff --git a/net/ntpclient/files/ntpclient.hotplug b/net/ntpclient/files/ntpclient.hotplug deleted file mode 100644 index 3a622b2b38..0000000000 --- a/net/ntpclient/files/ntpclient.hotplug +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh -# Copyright (C) 2006-2014 OpenWrt.org - -. /lib/functions.sh - -unset SERVER -unset PORT -unset INTERVAL -unset COUNT -unset INTERFACE_GLOBAL - -NTPC=$(command -v ntpclient) - -check_server() { - local hostname - local port - local interface - [ -n "$SERVER" ] && return - config_get hostname $1 hostname - config_get port $1 port - config_get interface $1 interface - - [ -z "$interface" ] && interface=$INTERFACE_GLOBAL - - [ -n "$interface" ] && { - # $INTERFACE is passed from hotplug event - [ "$interface" = "$INTERFACE" ] || return - } - - [ -z "$hostname" ] && return - $NTPC -c 1 -p ${port:-123} -i 2 -h $hostname > /dev/null && { SERVER=$hostname; PORT=${port:-123}; } -} - -set_drift() { - config_get freq $1 freq - [ -n "$freq" ] && adjtimex -f $freq >/dev/null -} - -start_ntpclient() { - config_foreach set_drift ntpdrift - config_foreach check_server ntpserver - [ -z "$SERVER" ] && exit 0 - logger starting ntpclient - $NTPC ${COUNT:+-c $COUNT} ${INTERVAL:+-i $INTERVAL} -s -l -D -p $PORT -h $SERVER 2> /dev/null -} - -stop_ntpclient() { - logger stopping ntpclient - killall ntpclient -} - -load_settings() { - local interval - local count - local interface - - config_get interval $1 interval - config_get count $1 count - config_get interface $1 interface - - [ -n "$count" ] && COUNT=$count - [ -n "$interval" ] && INTERVAL=$interval - [ -n "$interface" ] && INTERFACE_GLOBAL=$interface -} - -config_load ntpclient -config_foreach load_settings ntpclient - -NTP_RUNNING=$(busybox ps | grep $NTPC | grep -v grep) - -case "${ACTION:-ifup}" in - ifup) - [ -z "$NTP_RUNNING" ] && start_ntpclient - ;; - ifdown) - [ -n "$NTP_RUNNING" ] && stop_ntpclient - ;; -esac diff --git a/net/ntpclient/patches/100-daemon.patch b/net/ntpclient/patches/100-daemon.patch deleted file mode 100644 index 15135f0f2e..0000000000 --- a/net/ntpclient/patches/100-daemon.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/ntpclient.c -+++ b/ntpclient.c -@@ -608,7 +608,7 @@ int main(int argc, char *argv[]) { - ntpc.cross_check=1; - - for (;;) { -- c = getopt( argc, argv, "c:" DEBUG_OPTION "f:g:h:i:lp:q:" REPLAY_OPTION "st"); -+ c = getopt( argc, argv, "c:" DEBUG_OPTION "f:g:h:i:lp:q:" REPLAY_OPTION "stD"); - if (c == EOF) break; - switch (c) { - case 'c': -@@ -657,6 +657,10 @@ int main(int argc, char *argv[]) { - ntpc.cross_check = 0; - break; - -+ case 'D': -+ daemon(0, 0); -+ break; -+ - default: - usage(argv[0]); - exit(1); diff --git a/net/ntpclient/patches/200-time.patch b/net/ntpclient/patches/200-time.patch deleted file mode 100644 index 38138e179c..0000000000 --- a/net/ntpclient/patches/200-time.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- a/adjtimex.c -+++ b/adjtimex.c -@@ -36,6 +36,7 @@ - * gcc -Wall -O adjtimex_1.c -o adjtimex - */ - -+#include - #include - #include - #include -@@ -143,12 +144,12 @@ int main(int argc, char ** argv) - " precision: %ld\n" - " tolerance: %ld\n" - "-t tick: %ld\n" -- " time.tv_sec: %ld\n" -- " time.tv_usec: %ld\n" -+ " time.tv_sec: %" PRId64 "\n" -+ " time.tv_usec: %" PRId64 "\n" - " return value: %d (%s)\n", - txc.constant, - txc.precision, txc.tolerance, txc.tick, -- txc.time.tv_sec, txc.time.tv_usec, ret, -+ (int64_t)txc.time.tv_sec, (int64_t)txc.time.tv_usec, ret, - (ret >= 0 && ret <= 5) ? ret_code_descript[ret] : "error" ); - } - return (ret<0); ---- a/ntpclient.c -+++ b/ntpclient.c -@@ -29,6 +29,7 @@ - * labelled "XXX fixme - non-automatic build configuration". - */ - -+#include - #include - #include - #include -@@ -181,7 +182,7 @@ static void set_time(struct ntptime *new - exit(1); - } - if (debug) { -- printf("set time to %lu.%.9lu\n", tv_set.tv_sec, tv_set.tv_nsec); -+ printf("set time to %" PRId64 ".%.9" PRId64 "\n", (int64_t)tv_set.tv_sec, (int64_t)tv_set.tv_nsec); - } - #else - /* Traditional Linux way to set the system clock -@@ -196,7 +197,7 @@ static void set_time(struct ntptime *new - exit(1); - } - if (debug) { -- printf("set time to %lu.%.6lu\n", tv_set.tv_sec, tv_set.tv_usec); -+ printf("set time to %" PRId64 ".%.6" PRId64 "\n", (int64_t)tv_set.tv_sec, (int64_t)tv_set.tv_usec); - } - #endif - } diff --git a/net/ntpclient/patches/300-siocgarp.patch b/net/ntpclient/patches/300-siocgarp.patch deleted file mode 100644 index e03c9b93e3..0000000000 --- a/net/ntpclient/patches/300-siocgarp.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/ntpclient.c -+++ b/ntpclient.c -@@ -43,6 +43,9 @@ - #include - #ifdef PRECISION_SIOCGSTAMP - #include -+#ifdef __GLIBC__ -+#include -+#endif - #endif - #ifdef USE_OBSOLETE_GETTIMEOFDAY - #include