From 215d42a086af390ae116346a8ea297d7ef674f31 Mon Sep 17 00:00:00 2001 From: David Michael Date: Tue, 8 Jan 2019 20:08:30 +0000 Subject: [PATCH 1/2] net-misc/ntp: Sync with current Gentoo --- .../{ntp-4.2.8_p11-r1 => ntp-4.2.8_p12} | 10 +- .../coreos-overlay/net-misc/ntp/Manifest | 4 +- .../net-misc/ntp/files/man-pages/genmans.sh | 75 ++++++ .../ntp/files/man-pages/ntp.conf.5.patch | 27 +++ .../net-misc/ntp/files/man-pages/ntp.xsl | 218 ++++++++++++++++++ .../files/ntp-4.2.8_p12-libressl-2.8.patch | 16 ++ .../net-misc/ntp/files/ntp-client.confd | 21 ++ .../net-misc/ntp/files/ntp-client.rc | 31 +++ .../net-misc/ntp/files/ntp.conf | 47 +++- .../net-misc/ntp/files/ntp.tmpfiles | 2 - .../net-misc/ntp/files/ntpd.confd | 6 + .../net-misc/ntp/files/ntpd.rc-r1 | 22 ++ .../files/{ntpd.service => ntpd.service-r2} | 3 +- .../{ntpdate.service => ntpdate.service-r1} | 3 +- .../net-misc/ntp/files/ntpdate.service.conf | 2 + .../net-misc/ntp/files/sntp.confd | 4 + .../coreos-overlay/net-misc/ntp/files/sntp.rc | 26 +++ .../files/{sntp.service => sntp.service-r2} | 3 +- .../net-misc/ntp/files/sntp.service.conf | 2 + ...2.8_p11-r1.ebuild => ntp-4.2.8_p12.ebuild} | 41 +++- 20 files changed, 532 insertions(+), 31 deletions(-) rename sdk_container/src/third_party/coreos-overlay/metadata/md5-cache/net-misc/{ntp-4.2.8_p11-r1 => ntp-4.2.8_p12} (80%) create mode 100755 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/genmans.sh create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.conf.5.patch create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.xsl create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-4.2.8_p12-libressl-2.8.patch create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.confd create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.rc delete mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.tmpfiles create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.confd create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.rc-r1 rename sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/{ntpd.service => ntpd.service-r2} (70%) rename sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/{ntpdate.service => ntpdate.service-r1} (64%) create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service.conf create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.confd create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.rc rename sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/{sntp.service => sntp.service-r2} (65%) create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service.conf rename sdk_container/src/third_party/coreos-overlay/net-misc/ntp/{ntp-4.2.8_p11-r1.ebuild => ntp-4.2.8_p12.ebuild} (67%) diff --git a/sdk_container/src/third_party/coreos-overlay/metadata/md5-cache/net-misc/ntp-4.2.8_p11-r1 b/sdk_container/src/third_party/coreos-overlay/metadata/md5-cache/net-misc/ntp-4.2.8_p12 similarity index 80% rename from sdk_container/src/third_party/coreos-overlay/metadata/md5-cache/net-misc/ntp-4.2.8_p11-r1 rename to sdk_container/src/third_party/coreos-overlay/metadata/md5-cache/net-misc/ntp-4.2.8_p12 index 5e1e29a82e..6741565dd7 100644 --- a/sdk_container/src/third_party/coreos-overlay/metadata/md5-cache/net-misc/ntp-4.2.8_p11-r1 +++ b/sdk_container/src/third_party/coreos-overlay/metadata/md5-cache/net-misc/ntp-4.2.8_p12 @@ -1,14 +1,14 @@ -DEFINED_PHASES=configure install prepare setup +DEFINED_PHASES=configure install postinst prepare setup DEPEND=readline? ( >=sys-libs/readline-4.1:0= ) >=dev-libs/libevent-2.0.9:=[threads?] kernel_linux? ( caps? ( sys-libs/libcap ) ) zeroconf? ( net-dns/avahi[mdnsresponder-compat] ) snmp? ( net-analyzer/net-snmp ) ssl? ( !libressl? ( dev-libs/openssl:0= ) libressl? ( dev-libs/libressl ) ) parse-clocks? ( net-misc/pps-tools ) virtual/pkgconfig >=app-portage/elt-patches-20170815 !=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4 virtual/pkgconfig DESCRIPTION=Network Time Protocol suite/programs EAPI=6 HOMEPAGE=http://www.ntp.org/ -IUSE=caps debug ipv6 libressl openntpd parse-clocks perl readline samba selinux snmp ssl threads vim-syntax zeroconf -KEYWORDS=alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~m68k-mint +IUSE=caps debug ipv6 libressl openntpd parse-clocks readline samba selinux snmp ssl +threads vim-syntax zeroconf +KEYWORDS=alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~m68k-mint LICENSE=HPND BSD ISC PDEPEND=openntpd? ( net-misc/openntpd ) RDEPEND=readline? ( >=sys-libs/readline-4.1:0= ) >=dev-libs/libevent-2.0.9:=[threads?] kernel_linux? ( caps? ( sys-libs/libcap ) ) zeroconf? ( net-dns/avahi[mdnsresponder-compat] ) snmp? ( net-analyzer/net-snmp ) ssl? ( !libressl? ( dev-libs/openssl:0= ) libressl? ( dev-libs/libressl ) ) parse-clocks? ( net-misc/pps-tools ) selinux? ( sec-policy/selinux-ntp ) vim-syntax? ( app-vim/ntp-syntax ) !net-misc/ntpsec !openntpd? ( !net-misc/openntpd ) SLOT=0 -SRC_URI=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p11.tar.gz https://dev.gentoo.org/~polynomial-c/ntp-4.2.8p11-manpages.tar.xz +SRC_URI=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p12.tar.gz https://dev.gentoo.org/~polynomial-c/ntp-4.2.8p12-manpages.tar.xz _eclasses_=autotools 1bf086cdd7356f5c9a4acd9727bd2065 desktop b1d22ac8bdd4679ab79c71aca235009d epatch a1bf4756dba418a7238f3be0cb010c54 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 6e6c2737b59a4b982de6fb3ecefd87f8 flag-o-matic 55aaa148741116aa54ad0d80e361818e libtool f143db5a74ccd9ca28c1234deffede96 ltprune 08f9e1d9ee0af8f5d9a7854efbcd8c0e multilib b2f01ad412baf81650c23fcf0975fa33 preserve-libs ef207dc62baddfddfd39a164d9797648 systemd 47c677ae1d7b69031f11f630ac09f0d1 toolchain-funcs f164325a2cdb5b3ea39311d483988861 user 8bc2845510e2109af75e3eeac607ec81 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf -_md5_=2827b0b92c937709114ade748ee7f00d +_md5_=2782b707443899e7f73ab1a443f385a7 diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/Manifest b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/Manifest index 14da97e71a..657e596c28 100644 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/Manifest +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/Manifest @@ -1,2 +1,2 @@ -DIST ntp-4.2.8p11-manpages.tar.xz 25700 SHA256 55fe8bb66f1dc8d5bff3ec9875ec4c535434ed4dbc3b5e64b0ef021f43b91c0d SHA512 403bc238681abaadc838f5a6619851dcd0cfa5bf780e8aeaa94e8f77e776998d1f5142d65e3fa99c23e22e4cb7207d24b059fbbc6ddcf4414f0076a4b6ab4e81 WHIRLPOOL f0ebe7d7b87cd502b232e4a094646b4734ed78cd33372995b58c7671024cc1b74751ac7d2c7dd3944e8d8cef35c148b74cc54e0f5c1f0bd721983102562de818 -DIST ntp-4.2.8p11.tar.gz 7076566 SHA256 f14a39f753688252d683ff907035ffff106ba8d3db21309b742e09b5c3cd278e SHA512 05ac60f15a6aac50aaf340d40e4e439a421fa6e3d897bf30a69b2cef0cc97f8a6956012bfc6ceba055f4c3485a24f7fb8ebbd055e1875f1c69cbfdc35e71f236 WHIRLPOOL 9c9c2d0b967858d936f3b78ac93abea901d4d6e8fe90983f42da49f9a558ce96c00722545f8d5142594228be3dd01d837fba976c8ffb9de923adbcd16d343895 +DIST ntp-4.2.8p12-manpages.tar.xz 25700 BLAKE2B 0a84908556e997bdd08a78cd04f7f38a32a8441138f31d0adf7fefc380da79e509bea4a8bc67154501e359638f4edcab561d14cbdd1d573473bd2ea5a14f0c48 SHA512 e6df0099b9f62db63d200702267276ee094e8d00b20a67d2181f3f32fe6b871c49ac2eedbc2186b3255c919820c05eac528718b80afe7ed7ed7654b55c361f7c +DIST ntp-4.2.8p12.tar.gz 7079642 BLAKE2B d7d7817afaf9f94bf230951901b7531aff03c0828eecd40ca6fcc836ffd081387837afee44978742b507a9bee58788022fe9556733e8861dcc37d63f5637b3d1 SHA512 5382dcd1bb7feca8f28fc650f68892cb53f9364ebeb3780754cfbe71b1602057fdfd6eb27956afe79014a435624d77e2648d9e07f4d86ce7a98f5a4438d08310 diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/genmans.sh b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/genmans.sh new file mode 100755 index 0000000000..bae21e265f --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/genmans.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# +# ntpman.sh -- Create man pages for ntp +# + +VERSION=$1 +if [[ -z ${VERSION} ]] ; then + VERSION=$(ls -1d ntp-*/ 2>/dev/null | LC_COLLATE=C sort | sed -n '${s:/::;p;Q}') + if [[ -z ${VERSION} ]] ; then + VERSION=$(ls "${0%/*}"/../../ntp-*.ebuild | LC_COLLATE=C sort | sed -n '${s:.*/::;s:_::;s:[.]ebuild::;p;Q}') + if [[ -z ${VERSION} ]] ; then + echo "Usage: $0 " + exit 1 + fi + fi +fi +[[ ${VERSION} != ntp-* ]] && VERSION="ntp-${VERSION}" + +SRCDIR=${0%/*} +HTMLDIR=${SRCDIR}/${VERSION}/html +DISTFILE=/usr/portage/distfiles/${VERSION}.tar.gz +MANDIR=${SRCDIR}/man + +rm -rf ${SRCDIR}/${VERSION} +if [[ ! -d ${HTMLDIR} ]] ; then + if [[ -f ${DISTFILE} ]] ; then + tar zxf ${DISTFILE} -C ${SRCDIR} || exit 1 + else + echo "ERROR: $HTMLDIR / $DISTFILE does not exist" + exit 1 + fi +fi + +# Process a single HTML file +processfile() { + HTMLFILE=$1 + MANFILE=$2 + echo -n "Processing $HTMLFILE ..." + sed -e "s:/:" $HTMLDIR/$HTMLFILE > .$HTMLFILE + xsltproc --html --stringparam version $VERSION ${SRCDIR}/ntp.xsl .$HTMLFILE > $MANDIR/$MANFILE || exit 1 + rm -f .$HTMLFILE + echo "Done." +} + +# Print information +echo "Generates ntp man files from HTML documentation. Using:" +echo "VERSION: $VERSION" +echo "HTMLDIR: $HTMLDIR" +echo "MANDIR: $MANDIR" +echo "Press enter to continue, or Ctrl-C to cancel." +read + +# Process HTML files +rm -rf ${MANDIR} +mkdir ${MANDIR} +for f in ntp{date,dc,d,q,time,trace,dsim} keygen tickadj ; do + processfile ${f}.html ${f}.8 +done +echo + +cp -vi /usr/local/src/freebsd/src/usr.sbin/ntp/doc/*.5 ${MANDIR} +( +d=${PWD} +cd ${MANDIR} +shopt -s nullglob +for p in $d/*.5.patch ; do + patch -F0 -p0 < $p || exit 1 +done +) || exit 1 +cp -vi ${SRCDIR}/*.patch ${SRCDIR}/genmans.sh ${SRCDIR}/ntp.xsl ${MANDIR} + +tar -jcf ${VERSION}-manpages.tar.bz2 -C ${MANDIR}/.. man +du -b ${VERSION}-manpages.tar.bz2 + +rm -rf ${MANDIR} ${SRCDIR}/${VERSION} diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.conf.5.patch b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.conf.5.patch new file mode 100644 index 0000000000..c3d8123022 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.conf.5.patch @@ -0,0 +1,27 @@ +--- ntp.conf.5 ++++ ntp.conf.5 +@@ -24,16 +24,6 @@ + .Fl c + command line option). + .Pp +-The +-.Pa /etc/rc.d/ntpdate +-script reads this file to get a list of NTP servers to use if the +-variable +-.Dq Li ntpdate_hosts +-was not declared. +-Refer to the +-.Xr rc.conf 5 +-man page for further info about this. +-.Pp + The file format is similar to other + .Ux + configuration files. +@@ -2686,7 +2676,6 @@ + Diffie-Hellman agreement parameters + .El + .Sh SEE ALSO +-.Xr rc.conf 5 , + .Xr ntpd 8 , + .Xr ntpdc 8 , + .Xr ntpq 8 diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.xsl b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.xsl new file mode 100644 index 0000000000..ed9c1f8b8e --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.xsl @@ -0,0 +1,218 @@ + + + + + +]> + + + + + + + + + + + + + + + + .\" Automatically generated from HTML source. + DO NOT EDIT!&newline; + + + + + .TH + + 1 "" "ntp + + " + &newline; + .SH NAME + &newline; + + &newline; + + + + + + + + + + + + + + + + + &newline; + + .SH + + &newline; + + + + .SH AUTHOR + &newline; + + + + + + + + + &newline; + + .P + &newline; + + &newline; + + + + &newline; + &newline; + + + + + + + + &newline; + .ft CW + &newline; + .nf + &newline; + + + + &newline; + .ft R + &newline; + .fi + &newline; + + + + + + + + + + + + + + + + + .TP&newline; + .B + + &newline; + + + + + &newline; + + + + + + &newline; + &newline; + + + + + &newline; + \fB + + \fR + + + + &newline; + \fI + + \fR + + + + + + + + + + &newline; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-4.2.8_p12-libressl-2.8.patch b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-4.2.8_p12-libressl-2.8.patch new file mode 100644 index 0000000000..182fcefe88 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-4.2.8_p12-libressl-2.8.patch @@ -0,0 +1,16 @@ +--- ntp-4.2.8p12.orig/include/libssl_compat.h 2018-12-08 01:14:58.434733497 +0000 ++++ ntp-4.2.8p12/include/libssl_compat.h 2018-12-08 01:42:04.479474757 +0000 +@@ -107,10 +107,13 @@ + + #define OpenSSL_version_num SSLeay + #define OpenSSL_version SSLeay_version ++ ++# if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x20800000L + #define X509_get0_notBefore X509_get_notBefore + #define X509_getm_notBefore X509_get_notBefore + #define X509_get0_notAfter X509_get_notAfter + #define X509_getm_notAfter X509_get_notAfter ++#endif /* !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x20800000L */ + + /* ----------------------------------------------------------------- */ + #endif /* OPENSSL_VERSION_NUMBER < v1.1.0 */ diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.confd b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.confd new file mode 100644 index 0000000000..786004da83 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.confd @@ -0,0 +1,21 @@ +# /etc/conf.d/ntp-client + +# Command to run to set the clock initially +# Most people should just leave this line alone ... +# however, if you know what you're doing, and you +# want to use ntpd to set the clock, change this to 'ntpd' +NTPCLIENT_CMD="ntpdate" + +# Options to pass to the above command +# This default setting should work fine but you should +# change the default 'pool.ntp.org' to something closer +# to your machine. See http://www.pool.ntp.org/ or +# try running `netselect -s 3 pool.ntp.org`. +NTPCLIENT_OPTS="-s -b -u \ + 0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org \ + 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" + +# If you use hostnames above, then you should depend on dns +# being up & running before we try to run. Otherwise, you +# can disable this. +rc_use="dns" diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.rc b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.rc new file mode 100644 index 0000000000..5b5d594473 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.rc @@ -0,0 +1,31 @@ +#!/sbin/openrc-run +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + before cron portmap + after net + use dns logger +} + +checkconfig() { + if ! type "${NTPCLIENT_CMD}" >/dev/null 2>&1 ; then + eerror "Please edit /etc/conf.d/ntp-client" + eerror "Unable to locate the client command ${NTPCLIENT_CMD}!" + return 1 + fi + if [ -z "${NTPCLIENT_OPTS}" ] ; then + eerror "Please edit /etc/conf.d/ntp-client" + eerror "I need to know what server/options to use!" + return 1 + fi + return 0 +} + +start() { + checkconfig || return $? + + ebegin "Setting clock via the NTP client '${NTPCLIENT_CMD}'" + "${NTPCLIENT_CMD}" ${NTPCLIENT_OPTS} + eend $? "Failed to set clock" +} diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.conf b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.conf index bbd8e21437..97bed8dd13 100644 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.conf +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.conf @@ -1,8 +1,34 @@ -# Common pool -server 0.coreos.pool.ntp.org -server 1.coreos.pool.ntp.org -server 2.coreos.pool.ntp.org -server 3.coreos.pool.ntp.org +# NOTES: +# DHCP clients can append or replace NTP configuration files. +# You should consult your DHCP client documentation about its +# default behaviour and how to change it. + +# Name of the servers ntpd should sync with +# Please respect the access policy as stated by the responsible person. +#server ntp.example.tld iburst + +# Common pool for random people +#server pool.ntp.org + +# Pools for Gentoo users +server 0.gentoo.pool.ntp.org +server 1.gentoo.pool.ntp.org +server 2.gentoo.pool.ntp.org +server 3.gentoo.pool.ntp.org + +## +# A list of available servers can be found here: +# http://www.pool.ntp.org/ +# http://www.pool.ntp.org/#use +# A good way to get servers for your machine is: +# netselect -s 3 pool.ntp.org +## + +# you should not need to modify the following paths +driftfile /var/lib/ntp/ntp.drift + +#server ntplocal.example.com prefer +#server timeserver.example.org # Warning: Using default NTP settings will leave your NTP # server accessible to all hosts on the Internet. @@ -11,9 +37,18 @@ server 3.coreos.pool.ntp.org # from accessing the NTP server, uncomment: #restrict default ignore + # Default configuration: # - Allow only time queries, at a limited rate, sending KoD when in excess. # - Allow all local queries (IPv4, IPv6) -restrict default nomodify nopeer noquery notrap limited kod +restrict default nomodify nopeer noquery limited kod restrict 127.0.0.1 restrict [::1] + + +# To allow machines within your network to synchronize +# their clocks with your server, but ensure they are +# not allowed to configure the server or used as peers +# to synchronize against, uncomment this line. +# +#restrict 192.168.0.0 mask 255.255.255.0 nomodify nopeer notrap diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.tmpfiles b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.tmpfiles deleted file mode 100644 index ac582aaeab..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.tmpfiles +++ /dev/null @@ -1,2 +0,0 @@ -d /var/lib/ntp 0755 ntp ntp - - -L /etc/ntp.conf - - - - /usr/share/ntp/ntp.conf diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.confd b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.confd new file mode 100644 index 0000000000..2b74282c57 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.confd @@ -0,0 +1,6 @@ +# /etc/conf.d/ntpd + +# Options to pass to the ntpd process +# Most people should leave this line alone ... +# however, if you know what you're doing, feel free to tweak +NTPD_OPTS="-g -u ntp:ntp" diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.rc-r1 b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.rc-r1 new file mode 100644 index 0000000000..7573411c99 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.rc-r1 @@ -0,0 +1,22 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="ntpd - the network time protocol daemon" +pidfile="/var/run/ntpd.pid" +command="/usr/sbin/ntpd" +command_args="-p ${pidfile} ${NTPD_OPTS}" +start_stop_daemon_args="--pidfile ${pidfile}" + +depend() { + use net dns logger + after ntp-client +} + +start_pre() { + if [ ! -f /etc/ntp.conf ] ; then + eerror "Please create /etc/ntp.conf" + return 1 + fi + return 0 +} diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.service b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.service-r2 similarity index 70% rename from sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.service rename to sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.service-r2 index 65c109b243..5f11b27e92 100644 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.service +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.service-r2 @@ -4,9 +4,8 @@ After=ntpdate.service sntp.service Conflicts=systemd-timesyncd.service [Service] -ExecStart=/usr/sbin/ntpd -g -n -f /var/lib/ntp/ntp.drift +ExecStart=/usr/sbin/ntpd -g -n PrivateTmp=true -Restart=always [Install] WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service-r1 similarity index 64% rename from sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service rename to sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service-r1 index 0d16f19bc0..f9bc9ddefc 100644 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service-r1 @@ -3,11 +3,10 @@ Description=Set time via NTP using ntpdate After=network-online.target nss-lookup.target Before=time-sync.target Wants=time-sync.target -Conflicts=systemd-timesyncd.service +Conflicts=systemd-timesyncd.service [Service] Type=oneshot -Environment="SERVER=0.coreos.pool.ntp.org 1.coreos.pool.ntp.org 2.coreos.pool.ntp.org 3.coreos.pool.ntp.org" ExecStart=/usr/sbin/ntpdate -b -u $SERVER RemainAfterExit=yes diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service.conf b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service.conf new file mode 100644 index 0000000000..75e4f41b41 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service.conf @@ -0,0 +1,2 @@ +[Service] +Environment="SERVER=0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.confd b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.confd new file mode 100644 index 0000000000..d11983a3fb --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.confd @@ -0,0 +1,4 @@ +# /etc/conf.d/sntp + +# Options to pass to sntp +SNTP_OPTS="-s 0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.rc b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.rc new file mode 100644 index 0000000000..4ed56ae2bf --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.rc @@ -0,0 +1,26 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +command="/usr/bin/sntp" + +depend() { + before cron portmap + after net + use dns logger +} + +start_pre() { + if [ -z "${SNTP_OPTS}" ] ; then + eerror "Please edit /etc/conf.d/sntp" + eerror "I need to know what server/options to use!" + return 1 + fi + return 0 +} + +start() { + ebegin "Setting clock via SNTP" + ${command} ${SNTP_OPTS} + eend $? "Failed to set clock" +} diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service-r2 similarity index 65% rename from sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service rename to sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service-r2 index 98aa475770..9bdd578ffb 100644 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service-r2 @@ -3,11 +3,10 @@ Description=Set time via SNTP After=network.target NetworkManager-wait-online.service nss-lookup.target Before=time-sync.target Wants=time-sync.target -Conflicts=systemd-timesyncd.service +Conflicts=systemd-timesyncd.service [Service] Type=oneshot -Environment="SERVER=0.coreos.pool.ntp.org 1.coreos.pool.ntp.org 2.coreos.pool.ntp.org 3.coreos.pool.ntp.org" ExecStart=/usr/bin/sntp -s $SERVER RemainAfterExit=yes diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service.conf b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service.conf new file mode 100644 index 0000000000..75e4f41b41 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service.conf @@ -0,0 +1,2 @@ +[Service] +Environment="SERVER=0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/ntp-4.2.8_p11-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/ntp-4.2.8_p12.ebuild similarity index 67% rename from sdk_container/src/third_party/coreos-overlay/net-misc/ntp/ntp-4.2.8_p11-r1.ebuild rename to sdk_container/src/third_party/coreos-overlay/net-misc/ntp/ntp-4.2.8_p12.ebuild index bacd3c6a5b..eb032edec7 100644 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/ntp-4.2.8_p11-r1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/ntp-4.2.8_p12.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=6 @@ -13,8 +13,8 @@ SRC_URI="http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-${PV:0:3}/${MY_P}.tar LICENSE="HPND BSD ISC" SLOT="0" -KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~m68k-mint" -IUSE="caps debug ipv6 libressl openntpd parse-clocks perl readline samba selinux snmp ssl threads vim-syntax zeroconf" +KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~m68k-mint" +IUSE="caps debug ipv6 libressl openntpd parse-clocks readline samba selinux snmp ssl +threads vim-syntax zeroconf" CDEPEND="readline? ( >=sys-libs/readline-4.1:0= ) >=dev-libs/libevent-2.0.9:=[threads?] @@ -42,6 +42,7 @@ PATCHES=( "${FILESDIR}"/${PN}-4.2.8-ipc-caps.patch #533966 "${FILESDIR}"/${PN}-4.2.8-sntp-test-pthreads.patch #563922 "${FILESDIR}"/${PN}-4.2.8_p10-fix-build-wo-ssl-or-libressl.patch + "${FILESDIR}"/${PN}-4.2.8_p12-libressl-2.8.patch ) pkg_setup() { @@ -51,7 +52,6 @@ pkg_setup() { src_prepare() { default - use perl || sed -i -e '/^SUBDIRS *=/,/[^\\]$/{/scripts/d;}' Makefile.am || die append-cppflags -D_GNU_SOURCE #264109 # Make sure every build uses the same install layout. #539092 find sntp/loc/ -type f '!' -name legacy -delete || die @@ -97,10 +97,19 @@ src_install() { dodoc INSTALL WHERE-TO-START doman "${WORKDIR}"/man/*.[58] - insinto /usr/share/ntp + insinto /etc doins "${FILESDIR}"/ntp.conf - use ipv6 || sed -i '/^restrict .*::1/d' "${ED%/}"/usr/share/ntp/ntp.conf #524726 - systemd_newtmpfilesd "${FILESDIR}"/ntp.tmpfiles ntp.conf + use ipv6 || sed -i '/^restrict .*::1/d' "${ED%/}"/etc/ntp.conf #524726 + newinitd "${FILESDIR}"/ntpd.rc-r1 ntpd + newconfd "${FILESDIR}"/ntpd.confd ntpd + newinitd "${FILESDIR}"/ntp-client.rc ntp-client + newconfd "${FILESDIR}"/ntp-client.confd ntp-client + newinitd "${FILESDIR}"/sntp.rc sntp + newconfd "${FILESDIR}"/sntp.confd sntp + if ! use caps ; then + sed -i "s|-u ntp:ntp||" "${ED%/}"/etc/conf.d/ntpd || die + fi + sed -i "s:/usr/bin:/usr/sbin:" "${ED%/}"/etc/init.d/ntpd || die keepdir /var/lib/ntp use prefix || fowners ntp:ntp /var/lib/ntp @@ -109,9 +118,10 @@ src_install() { cd "${ED}" || die rm usr/sbin/ntpd || die rm -r var/lib || die + rm etc/{conf,init}.d/ntpd || die rm usr/share/man/*/ntpd.8 || die else - systemd_dounit "${FILESDIR}"/ntpd.service + systemd_newunit "${FILESDIR}"/ntpd.service-r2 ntpd.service if use caps ; then sed -i '/ExecStart/ s|$| -u ntp:ntp|' \ "${D%/}$(systemd_get_systemunitdir)"/ntpd.service \ @@ -120,6 +130,17 @@ src_install() { systemd_enable_ntpunit 60-ntpd ntpd.service fi - systemd_dounit "${FILESDIR}"/ntpdate.service - systemd_dounit "${FILESDIR}"/sntp.service + systemd_newunit "${FILESDIR}"/ntpdate.service-r1 ntpdate.service + systemd_install_serviced "${FILESDIR}"/ntpdate.service.conf + systemd_newunit "${FILESDIR}"/sntp.service-r2 sntp.service + systemd_install_serviced "${FILESDIR}"/sntp.service.conf +} + +pkg_postinst() { + if grep -qs '^[^#].*notrust' "${EROOT}"/etc/ntp.conf ; then + eerror "The notrust option was found in your /etc/ntp.conf!" + ewarn "If your ntpd starts sending out weird responses," + ewarn "then make sure you have keys properly setup and see" + ewarn "https://bugs.gentoo.org/41827" + fi } From bce51ac7868d51103d8d938e810d234ddc05a831 Mon Sep 17 00:00:00 2001 From: David Michael Date: Tue, 8 Jan 2019 20:51:17 +0000 Subject: [PATCH 2/2] net-misc/ntp: Apply CoreOS changes We make the following changes on top of Gentoo's files: - Check out our previous ntp.conf and service units - Disable USE=threads - Add USE=perl, disabled to skip the scripts subdir - Do the /etc -> /usr/share + tmpfiles dance for ntp.conf - Drop unused init scripts and pkg_postinst --- .../metadata/md5-cache/net-misc/ntp-4.2.8_p12 | 6 +- .../net-misc/ntp/files/man-pages/genmans.sh | 75 ------ .../ntp/files/man-pages/ntp.conf.5.patch | 27 --- .../net-misc/ntp/files/man-pages/ntp.xsl | 218 ------------------ .../net-misc/ntp/files/ntp-client.confd | 21 -- .../net-misc/ntp/files/ntp-client.rc | 31 --- .../net-misc/ntp/files/ntp.conf | 47 +--- .../net-misc/ntp/files/ntp.tmpfiles | 2 + .../net-misc/ntp/files/ntpd.confd | 6 - .../net-misc/ntp/files/ntpd.rc-r1 | 22 -- .../files/{ntpd.service-r2 => ntpd.service} | 3 +- .../{ntpdate.service-r1 => ntpdate.service} | 3 +- .../net-misc/ntp/files/ntpdate.service.conf | 2 - .../net-misc/ntp/files/sntp.confd | 4 - .../coreos-overlay/net-misc/ntp/files/sntp.rc | 26 --- .../files/{sntp.service-r2 => sntp.service} | 3 +- .../net-misc/ntp/files/sntp.service.conf | 2 - .../net-misc/ntp/ntp-4.2.8_p12.ebuild | 36 +-- 18 files changed, 25 insertions(+), 509 deletions(-) delete mode 100755 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/genmans.sh delete mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.conf.5.patch delete mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.xsl delete mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.confd delete mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.rc create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.tmpfiles delete mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.confd delete mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.rc-r1 rename sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/{ntpd.service-r2 => ntpd.service} (70%) rename sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/{ntpdate.service-r1 => ntpdate.service} (64%) delete mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service.conf delete mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.confd delete mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.rc rename sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/{sntp.service-r2 => sntp.service} (65%) delete mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service.conf diff --git a/sdk_container/src/third_party/coreos-overlay/metadata/md5-cache/net-misc/ntp-4.2.8_p12 b/sdk_container/src/third_party/coreos-overlay/metadata/md5-cache/net-misc/ntp-4.2.8_p12 index 6741565dd7..8db8b7cdb4 100644 --- a/sdk_container/src/third_party/coreos-overlay/metadata/md5-cache/net-misc/ntp-4.2.8_p12 +++ b/sdk_container/src/third_party/coreos-overlay/metadata/md5-cache/net-misc/ntp-4.2.8_p12 @@ -1,9 +1,9 @@ -DEFINED_PHASES=configure install postinst prepare setup +DEFINED_PHASES=configure install prepare setup DEPEND=readline? ( >=sys-libs/readline-4.1:0= ) >=dev-libs/libevent-2.0.9:=[threads?] kernel_linux? ( caps? ( sys-libs/libcap ) ) zeroconf? ( net-dns/avahi[mdnsresponder-compat] ) snmp? ( net-analyzer/net-snmp ) ssl? ( !libressl? ( dev-libs/openssl:0= ) libressl? ( dev-libs/libressl ) ) parse-clocks? ( net-misc/pps-tools ) virtual/pkgconfig >=app-portage/elt-patches-20170815 !=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4 virtual/pkgconfig DESCRIPTION=Network Time Protocol suite/programs EAPI=6 HOMEPAGE=http://www.ntp.org/ -IUSE=caps debug ipv6 libressl openntpd parse-clocks readline samba selinux snmp ssl +threads vim-syntax zeroconf +IUSE=caps debug ipv6 libressl openntpd parse-clocks perl readline samba selinux snmp ssl threads vim-syntax zeroconf KEYWORDS=alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~m68k-mint LICENSE=HPND BSD ISC PDEPEND=openntpd? ( net-misc/openntpd ) @@ -11,4 +11,4 @@ RDEPEND=readline? ( >=sys-libs/readline-4.1:0= ) >=dev-libs/libevent-2.0.9:=[thr SLOT=0 SRC_URI=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p12.tar.gz https://dev.gentoo.org/~polynomial-c/ntp-4.2.8p12-manpages.tar.xz _eclasses_=autotools 1bf086cdd7356f5c9a4acd9727bd2065 desktop b1d22ac8bdd4679ab79c71aca235009d epatch a1bf4756dba418a7238f3be0cb010c54 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 6e6c2737b59a4b982de6fb3ecefd87f8 flag-o-matic 55aaa148741116aa54ad0d80e361818e libtool f143db5a74ccd9ca28c1234deffede96 ltprune 08f9e1d9ee0af8f5d9a7854efbcd8c0e multilib b2f01ad412baf81650c23fcf0975fa33 preserve-libs ef207dc62baddfddfd39a164d9797648 systemd 47c677ae1d7b69031f11f630ac09f0d1 toolchain-funcs f164325a2cdb5b3ea39311d483988861 user 8bc2845510e2109af75e3eeac607ec81 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf -_md5_=2782b707443899e7f73ab1a443f385a7 +_md5_=60884e02aacf398cd787efe8860c65d5 diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/genmans.sh b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/genmans.sh deleted file mode 100755 index bae21e265f..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/genmans.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# -# ntpman.sh -- Create man pages for ntp -# - -VERSION=$1 -if [[ -z ${VERSION} ]] ; then - VERSION=$(ls -1d ntp-*/ 2>/dev/null | LC_COLLATE=C sort | sed -n '${s:/::;p;Q}') - if [[ -z ${VERSION} ]] ; then - VERSION=$(ls "${0%/*}"/../../ntp-*.ebuild | LC_COLLATE=C sort | sed -n '${s:.*/::;s:_::;s:[.]ebuild::;p;Q}') - if [[ -z ${VERSION} ]] ; then - echo "Usage: $0 " - exit 1 - fi - fi -fi -[[ ${VERSION} != ntp-* ]] && VERSION="ntp-${VERSION}" - -SRCDIR=${0%/*} -HTMLDIR=${SRCDIR}/${VERSION}/html -DISTFILE=/usr/portage/distfiles/${VERSION}.tar.gz -MANDIR=${SRCDIR}/man - -rm -rf ${SRCDIR}/${VERSION} -if [[ ! -d ${HTMLDIR} ]] ; then - if [[ -f ${DISTFILE} ]] ; then - tar zxf ${DISTFILE} -C ${SRCDIR} || exit 1 - else - echo "ERROR: $HTMLDIR / $DISTFILE does not exist" - exit 1 - fi -fi - -# Process a single HTML file -processfile() { - HTMLFILE=$1 - MANFILE=$2 - echo -n "Processing $HTMLFILE ..." - sed -e "s:/:" $HTMLDIR/$HTMLFILE > .$HTMLFILE - xsltproc --html --stringparam version $VERSION ${SRCDIR}/ntp.xsl .$HTMLFILE > $MANDIR/$MANFILE || exit 1 - rm -f .$HTMLFILE - echo "Done." -} - -# Print information -echo "Generates ntp man files from HTML documentation. Using:" -echo "VERSION: $VERSION" -echo "HTMLDIR: $HTMLDIR" -echo "MANDIR: $MANDIR" -echo "Press enter to continue, or Ctrl-C to cancel." -read - -# Process HTML files -rm -rf ${MANDIR} -mkdir ${MANDIR} -for f in ntp{date,dc,d,q,time,trace,dsim} keygen tickadj ; do - processfile ${f}.html ${f}.8 -done -echo - -cp -vi /usr/local/src/freebsd/src/usr.sbin/ntp/doc/*.5 ${MANDIR} -( -d=${PWD} -cd ${MANDIR} -shopt -s nullglob -for p in $d/*.5.patch ; do - patch -F0 -p0 < $p || exit 1 -done -) || exit 1 -cp -vi ${SRCDIR}/*.patch ${SRCDIR}/genmans.sh ${SRCDIR}/ntp.xsl ${MANDIR} - -tar -jcf ${VERSION}-manpages.tar.bz2 -C ${MANDIR}/.. man -du -b ${VERSION}-manpages.tar.bz2 - -rm -rf ${MANDIR} ${SRCDIR}/${VERSION} diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.conf.5.patch b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.conf.5.patch deleted file mode 100644 index c3d8123022..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.conf.5.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- ntp.conf.5 -+++ ntp.conf.5 -@@ -24,16 +24,6 @@ - .Fl c - command line option). - .Pp --The --.Pa /etc/rc.d/ntpdate --script reads this file to get a list of NTP servers to use if the --variable --.Dq Li ntpdate_hosts --was not declared. --Refer to the --.Xr rc.conf 5 --man page for further info about this. --.Pp - The file format is similar to other - .Ux - configuration files. -@@ -2686,7 +2676,6 @@ - Diffie-Hellman agreement parameters - .El - .Sh SEE ALSO --.Xr rc.conf 5 , - .Xr ntpd 8 , - .Xr ntpdc 8 , - .Xr ntpq 8 diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.xsl b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.xsl deleted file mode 100644 index ed9c1f8b8e..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/man-pages/ntp.xsl +++ /dev/null @@ -1,218 +0,0 @@ - - - - - -]> - - - - - - - - - - - - - - - - .\" Automatically generated from HTML source. - DO NOT EDIT!&newline; - - - - - .TH - - 1 "" "ntp - - " - &newline; - .SH NAME - &newline; - - &newline; - - - - - - - - - - - - - - - - - &newline; - - .SH - - &newline; - - - - .SH AUTHOR - &newline; - - - - - - - - - &newline; - - .P - &newline; - - &newline; - - - - &newline; - &newline; - - - - - - - - &newline; - .ft CW - &newline; - .nf - &newline; - - - - &newline; - .ft R - &newline; - .fi - &newline; - - - - - - - - - - - - - - - - - .TP&newline; - .B - - &newline; - - - - - &newline; - - - - - - &newline; - &newline; - - - - - &newline; - \fB - - \fR - - - - &newline; - \fI - - \fR - - - - - - - - - - &newline; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.confd b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.confd deleted file mode 100644 index 786004da83..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.confd +++ /dev/null @@ -1,21 +0,0 @@ -# /etc/conf.d/ntp-client - -# Command to run to set the clock initially -# Most people should just leave this line alone ... -# however, if you know what you're doing, and you -# want to use ntpd to set the clock, change this to 'ntpd' -NTPCLIENT_CMD="ntpdate" - -# Options to pass to the above command -# This default setting should work fine but you should -# change the default 'pool.ntp.org' to something closer -# to your machine. See http://www.pool.ntp.org/ or -# try running `netselect -s 3 pool.ntp.org`. -NTPCLIENT_OPTS="-s -b -u \ - 0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org \ - 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" - -# If you use hostnames above, then you should depend on dns -# being up & running before we try to run. Otherwise, you -# can disable this. -rc_use="dns" diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.rc b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.rc deleted file mode 100644 index 5b5d594473..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp-client.rc +++ /dev/null @@ -1,31 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -depend() { - before cron portmap - after net - use dns logger -} - -checkconfig() { - if ! type "${NTPCLIENT_CMD}" >/dev/null 2>&1 ; then - eerror "Please edit /etc/conf.d/ntp-client" - eerror "Unable to locate the client command ${NTPCLIENT_CMD}!" - return 1 - fi - if [ -z "${NTPCLIENT_OPTS}" ] ; then - eerror "Please edit /etc/conf.d/ntp-client" - eerror "I need to know what server/options to use!" - return 1 - fi - return 0 -} - -start() { - checkconfig || return $? - - ebegin "Setting clock via the NTP client '${NTPCLIENT_CMD}'" - "${NTPCLIENT_CMD}" ${NTPCLIENT_OPTS} - eend $? "Failed to set clock" -} diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.conf b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.conf index 97bed8dd13..bbd8e21437 100644 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.conf +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.conf @@ -1,34 +1,8 @@ -# NOTES: -# DHCP clients can append or replace NTP configuration files. -# You should consult your DHCP client documentation about its -# default behaviour and how to change it. - -# Name of the servers ntpd should sync with -# Please respect the access policy as stated by the responsible person. -#server ntp.example.tld iburst - -# Common pool for random people -#server pool.ntp.org - -# Pools for Gentoo users -server 0.gentoo.pool.ntp.org -server 1.gentoo.pool.ntp.org -server 2.gentoo.pool.ntp.org -server 3.gentoo.pool.ntp.org - -## -# A list of available servers can be found here: -# http://www.pool.ntp.org/ -# http://www.pool.ntp.org/#use -# A good way to get servers for your machine is: -# netselect -s 3 pool.ntp.org -## - -# you should not need to modify the following paths -driftfile /var/lib/ntp/ntp.drift - -#server ntplocal.example.com prefer -#server timeserver.example.org +# Common pool +server 0.coreos.pool.ntp.org +server 1.coreos.pool.ntp.org +server 2.coreos.pool.ntp.org +server 3.coreos.pool.ntp.org # Warning: Using default NTP settings will leave your NTP # server accessible to all hosts on the Internet. @@ -37,18 +11,9 @@ driftfile /var/lib/ntp/ntp.drift # from accessing the NTP server, uncomment: #restrict default ignore - # Default configuration: # - Allow only time queries, at a limited rate, sending KoD when in excess. # - Allow all local queries (IPv4, IPv6) -restrict default nomodify nopeer noquery limited kod +restrict default nomodify nopeer noquery notrap limited kod restrict 127.0.0.1 restrict [::1] - - -# To allow machines within your network to synchronize -# their clocks with your server, but ensure they are -# not allowed to configure the server or used as peers -# to synchronize against, uncomment this line. -# -#restrict 192.168.0.0 mask 255.255.255.0 nomodify nopeer notrap diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.tmpfiles b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.tmpfiles new file mode 100644 index 0000000000..ac582aaeab --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntp.tmpfiles @@ -0,0 +1,2 @@ +d /var/lib/ntp 0755 ntp ntp - - +L /etc/ntp.conf - - - - /usr/share/ntp/ntp.conf diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.confd b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.confd deleted file mode 100644 index 2b74282c57..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.confd +++ /dev/null @@ -1,6 +0,0 @@ -# /etc/conf.d/ntpd - -# Options to pass to the ntpd process -# Most people should leave this line alone ... -# however, if you know what you're doing, feel free to tweak -NTPD_OPTS="-g -u ntp:ntp" diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.rc-r1 b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.rc-r1 deleted file mode 100644 index 7573411c99..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.rc-r1 +++ /dev/null @@ -1,22 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2016 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -description="ntpd - the network time protocol daemon" -pidfile="/var/run/ntpd.pid" -command="/usr/sbin/ntpd" -command_args="-p ${pidfile} ${NTPD_OPTS}" -start_stop_daemon_args="--pidfile ${pidfile}" - -depend() { - use net dns logger - after ntp-client -} - -start_pre() { - if [ ! -f /etc/ntp.conf ] ; then - eerror "Please create /etc/ntp.conf" - return 1 - fi - return 0 -} diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.service-r2 b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.service similarity index 70% rename from sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.service-r2 rename to sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.service index 5f11b27e92..65c109b243 100644 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.service-r2 +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpd.service @@ -4,8 +4,9 @@ After=ntpdate.service sntp.service Conflicts=systemd-timesyncd.service [Service] -ExecStart=/usr/sbin/ntpd -g -n +ExecStart=/usr/sbin/ntpd -g -n -f /var/lib/ntp/ntp.drift PrivateTmp=true +Restart=always [Install] WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service-r1 b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service similarity index 64% rename from sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service-r1 rename to sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service index f9bc9ddefc..0d16f19bc0 100644 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service-r1 +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service @@ -3,10 +3,11 @@ Description=Set time via NTP using ntpdate After=network-online.target nss-lookup.target Before=time-sync.target Wants=time-sync.target -Conflicts=systemd-timesyncd.service +Conflicts=systemd-timesyncd.service [Service] Type=oneshot +Environment="SERVER=0.coreos.pool.ntp.org 1.coreos.pool.ntp.org 2.coreos.pool.ntp.org 3.coreos.pool.ntp.org" ExecStart=/usr/sbin/ntpdate -b -u $SERVER RemainAfterExit=yes diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service.conf b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service.conf deleted file mode 100644 index 75e4f41b41..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/ntpdate.service.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -Environment="SERVER=0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.confd b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.confd deleted file mode 100644 index d11983a3fb..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.confd +++ /dev/null @@ -1,4 +0,0 @@ -# /etc/conf.d/sntp - -# Options to pass to sntp -SNTP_OPTS="-s 0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.rc b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.rc deleted file mode 100644 index 4ed56ae2bf..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.rc +++ /dev/null @@ -1,26 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2016 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -command="/usr/bin/sntp" - -depend() { - before cron portmap - after net - use dns logger -} - -start_pre() { - if [ -z "${SNTP_OPTS}" ] ; then - eerror "Please edit /etc/conf.d/sntp" - eerror "I need to know what server/options to use!" - return 1 - fi - return 0 -} - -start() { - ebegin "Setting clock via SNTP" - ${command} ${SNTP_OPTS} - eend $? "Failed to set clock" -} diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service-r2 b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service similarity index 65% rename from sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service-r2 rename to sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service index 9bdd578ffb..98aa475770 100644 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service-r2 +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service @@ -3,10 +3,11 @@ Description=Set time via SNTP After=network.target NetworkManager-wait-online.service nss-lookup.target Before=time-sync.target Wants=time-sync.target -Conflicts=systemd-timesyncd.service +Conflicts=systemd-timesyncd.service [Service] Type=oneshot +Environment="SERVER=0.coreos.pool.ntp.org 1.coreos.pool.ntp.org 2.coreos.pool.ntp.org 3.coreos.pool.ntp.org" ExecStart=/usr/bin/sntp -s $SERVER RemainAfterExit=yes diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service.conf b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service.conf deleted file mode 100644 index 75e4f41b41..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/files/sntp.service.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -Environment="SERVER=0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/ntp-4.2.8_p12.ebuild b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/ntp-4.2.8_p12.ebuild index eb032edec7..df8a20e9dc 100644 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/ntp-4.2.8_p12.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/ntp/ntp-4.2.8_p12.ebuild @@ -14,7 +14,7 @@ SRC_URI="http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-${PV:0:3}/${MY_P}.tar LICENSE="HPND BSD ISC" SLOT="0" KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~m68k-mint" -IUSE="caps debug ipv6 libressl openntpd parse-clocks readline samba selinux snmp ssl +threads vim-syntax zeroconf" +IUSE="caps debug ipv6 libressl openntpd parse-clocks perl readline samba selinux snmp ssl threads vim-syntax zeroconf" CDEPEND="readline? ( >=sys-libs/readline-4.1:0= ) >=dev-libs/libevent-2.0.9:=[threads?] @@ -52,6 +52,7 @@ pkg_setup() { src_prepare() { default + use perl || sed -i -e '/^SUBDIRS *=/,/[^\\]$/{/scripts/d;}' Makefile.am || die append-cppflags -D_GNU_SOURCE #264109 # Make sure every build uses the same install layout. #539092 find sntp/loc/ -type f '!' -name legacy -delete || die @@ -97,19 +98,10 @@ src_install() { dodoc INSTALL WHERE-TO-START doman "${WORKDIR}"/man/*.[58] - insinto /etc + insinto /usr/share/ntp doins "${FILESDIR}"/ntp.conf - use ipv6 || sed -i '/^restrict .*::1/d' "${ED%/}"/etc/ntp.conf #524726 - newinitd "${FILESDIR}"/ntpd.rc-r1 ntpd - newconfd "${FILESDIR}"/ntpd.confd ntpd - newinitd "${FILESDIR}"/ntp-client.rc ntp-client - newconfd "${FILESDIR}"/ntp-client.confd ntp-client - newinitd "${FILESDIR}"/sntp.rc sntp - newconfd "${FILESDIR}"/sntp.confd sntp - if ! use caps ; then - sed -i "s|-u ntp:ntp||" "${ED%/}"/etc/conf.d/ntpd || die - fi - sed -i "s:/usr/bin:/usr/sbin:" "${ED%/}"/etc/init.d/ntpd || die + use ipv6 || sed -i '/^restrict .*::1/d' "${ED%/}"/usr/share/ntp/ntp.conf #524726 + systemd_newtmpfilesd "${FILESDIR}"/ntp.tmpfiles ntp.conf keepdir /var/lib/ntp use prefix || fowners ntp:ntp /var/lib/ntp @@ -118,10 +110,9 @@ src_install() { cd "${ED}" || die rm usr/sbin/ntpd || die rm -r var/lib || die - rm etc/{conf,init}.d/ntpd || die rm usr/share/man/*/ntpd.8 || die else - systemd_newunit "${FILESDIR}"/ntpd.service-r2 ntpd.service + systemd_dounit "${FILESDIR}"/ntpd.service if use caps ; then sed -i '/ExecStart/ s|$| -u ntp:ntp|' \ "${D%/}$(systemd_get_systemunitdir)"/ntpd.service \ @@ -130,17 +121,6 @@ src_install() { systemd_enable_ntpunit 60-ntpd ntpd.service fi - systemd_newunit "${FILESDIR}"/ntpdate.service-r1 ntpdate.service - systemd_install_serviced "${FILESDIR}"/ntpdate.service.conf - systemd_newunit "${FILESDIR}"/sntp.service-r2 sntp.service - systemd_install_serviced "${FILESDIR}"/sntp.service.conf -} - -pkg_postinst() { - if grep -qs '^[^#].*notrust' "${EROOT}"/etc/ntp.conf ; then - eerror "The notrust option was found in your /etc/ntp.conf!" - ewarn "If your ntpd starts sending out weird responses," - ewarn "then make sure you have keys properly setup and see" - ewarn "https://bugs.gentoo.org/41827" - fi + systemd_dounit "${FILESDIR}"/ntpdate.service + systemd_dounit "${FILESDIR}"/sntp.service }