From 5b80bfd7bffd4c20d80b7c70a7130529e9a755dd Mon Sep 17 00:00:00 2001 From: ToshikazuOhiwa Date: Mon, 30 Mar 2020 09:24:26 +0900 Subject: agl-basesystem --- .../ntp/ntp/ntp-4.2.4_p6-nano.patch | 27 ++++ .../recipes-support/ntp/ntp/ntp.conf | 17 ++ .../meta-networking/recipes-support/ntp/ntp/ntpd | 84 ++++++++++ .../recipes-support/ntp/ntp/ntpd.list | 1 + .../recipes-support/ntp/ntp/ntpd.service | 11 ++ .../recipes-support/ntp/ntp/ntpdate | 54 +++++++ .../recipes-support/ntp/ntp/ntpdate.default | 7 + .../recipes-support/ntp/ntp/ntpdate.service | 11 ++ ...reproducibility-fixed-path-to-posix-shell.patch | 15 ++ ...reproducibility-respect-source-date-epoch.patch | 16 ++ .../meta-networking/recipes-support/ntp/ntp/sntp | 1 + .../recipes-support/ntp/ntp/sntp.service | 11 ++ .../recipes-support/ntp/ntp_4.2.8p13.bb | 178 +++++++++++++++++++++ 13 files changed, 433 insertions(+) create mode 100644 external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp-4.2.4_p6-nano.patch create mode 100644 external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp.conf create mode 100755 external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd create mode 100644 external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.list create mode 100644 external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.service create mode 100755 external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate create mode 100644 external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.default create mode 100644 external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.service create mode 100644 external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/reproducibility-fixed-path-to-posix-shell.patch create mode 100644 external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/reproducibility-respect-source-date-epoch.patch create mode 100644 external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp create mode 100644 external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp.service create mode 100644 external/meta-openembedded/meta-networking/recipes-support/ntp/ntp_4.2.8p13.bb (limited to 'external/meta-openembedded/meta-networking/recipes-support/ntp') diff --git a/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp-4.2.4_p6-nano.patch b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp-4.2.4_p6-nano.patch new file mode 100644 index 00000000..d45b7e38 --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp-4.2.4_p6-nano.patch @@ -0,0 +1,27 @@ +From 2310898533f059d875dcffd26ab6cf1b280292fd Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Wed, 12 Jan 2011 21:38:46 +0100 + +--- + include/ntp_syscall.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/include/ntp_syscall.h b/include/ntp_syscall.h +index d1ce03e..9e18432 100644 +--- a/include/ntp_syscall.h ++++ b/include/ntp_syscall.h +@@ -10,6 +10,14 @@ + # include + #endif + ++#if defined(ADJ_NANO) && !defined(MOD_NANO) ++#define MOD_NANO ADJ_NANO ++#endif ++ ++#if defined(ADJ_TAI) && !defined(MOD_TAI) ++#define MOD_TAI ADJ_TAI ++#endif ++ + #ifndef NTP_SYSCALLS_LIBC + # ifdef NTP_SYSCALLS_STD + # define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t)) diff --git a/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp.conf b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp.conf new file mode 100644 index 00000000..676e1864 --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp.conf @@ -0,0 +1,17 @@ +# This is the most basic ntp configuration file +# The driftfile must remain in a place specific to this +# machine - it records the machine specific clock error +driftfile /var/lib/ntp/drift +# This should be a server that is close (in IP terms) +# to the machine. Add other servers as required. +# Unless you un-comment the line below ntpd will sync +# only against the local system clock. +# +# server time.server.example.com +# +# Using local hardware clock as fallback +# Disable this when using ntpd -q -g -x as ntpdate or it will sync to itself +server 127.127.1.0 +fudge 127.127.1.0 stratum 14 +# Defining a default security setting +restrict default diff --git a/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd new file mode 100755 index 00000000..d1b9c490 --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd @@ -0,0 +1,84 @@ +#! /bin/sh + +### BEGIN INIT INFO +# Provides: ntp +# Required-Start: $network $remote_fs $syslog +# Required-Stop: $network $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: +# Short-Description: Start NTP daemon +### END INIT INFO + +PATH=/sbin:/bin:/usr/bin:/usr/sbin + +DAEMON=/usr/sbin/ntpd +PIDFILE=/var/run/ntpd.pid + +# ntpd init.d script for ntpdc from ntp.isc.org +test -x $DAEMON -a -r /etc/ntp.conf || exit 0 + +# rcS contains TICKADJ +test -r /etc/default/rcS && . /etc/default/rcS + +# Source function library. +. /etc/init.d/functions + +# Functions to do individual actions +settick(){ + # If TICKADJ is set we *must* adjust it before we start, because the + # driftfile relies on the correct setting + test -n "$TICKADJ" -a -x /usr/sbin/tickadj && { + echo -n "Setting tick to $TICKADJ: " + /usr/sbin/tickadj "$TICKADJ" + echo "done" + } +} +startdaemon(){ + # The -g option allows ntpd to step the time to correct it just + # once. The daemon will exit if the clock drifts too much after + # this. If ntpd seems to disappear after a while assume TICKADJ + # above is set to a totally incorrect value. + echo -n "Starting ntpd: " + start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -u ntp:ntp -p $PIDFILE "$@" + echo "done" +} +stopdaemon(){ + echo -n "Stopping ntpd: " + start-stop-daemon --stop --quiet --oknodo -p $PIDFILE + echo "done" +} + +case "$1" in + start) + settick + startdaemon -g + ;; + stop) + stopdaemon + ;; + force-reload) + stopdaemon + settick + startdaemon -g + ;; + restart) + # Don't reset the tick here + stopdaemon + startdaemon -g + ;; + reload) + # Must do this by hand, but don't do -g + stopdaemon + startdaemon + ;; + status) + status /usr/sbin/ntpd; + exit $? + ;; + *) + echo "Usage: ntpd { start | stop | status | restart | reload }" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.list b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.list new file mode 100644 index 00000000..d1fe6b7e --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.list @@ -0,0 +1 @@ +ntpd.service diff --git a/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.service b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.service new file mode 100644 index 00000000..0e3d7cd3 --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.service @@ -0,0 +1,11 @@ +[Unit] +Description=Network Time Service +After=network.target + +[Service] +Type=forking +PIDFile=/run/ntpd.pid +ExecStart=/usr/sbin/ntpd -u ntp:ntp -p /run/ntpd.pid -g + +[Install] +WantedBy=multi-user.target diff --git a/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate new file mode 100755 index 00000000..17b64d13 --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate @@ -0,0 +1,54 @@ +#!/bin/sh + +PATH=/sbin:/bin:/usr/bin:/usr/sbin + +test -x /usr/sbin/ntpdate || exit 0 + +if test -f /etc/default/ntpdate ; then +. /etc/default/ntpdate +fi + +if [ "$NTPSERVERS" = "" ] ; then + if [ "$METHOD" = "" -a "$1" != "silent" ] ; then + echo "Please set NTPSERVERS in /etc/default/ntpdate" + exit 1 + else + exit 0 + fi +fi + +# This is a heuristic: The idea is that if a static interface is brought +# up, that is a major event, and we can put in some extra effort to fix +# the system time. Feel free to change this, especially if you regularly +# bring up new network interfaces. +if [ "$METHOD" = static ]; then + OPTS="-b" +fi + +if [ "$METHOD" = loopback ]; then + exit 0 +fi + +( + +LOCKFILE=/var/lock/ntpdate + +# Avoid running more than one at a time +if [ -x /usr/bin/lockfile-create ]; then + lockfile-create $LOCKFILE + lockfile-touch $LOCKFILE & + LOCKTOUCHPID="$!" +fi + +if /usr/sbin/ntpdate -s $OPTS $NTPSERVERS 2>/dev/null; then + if [ "$UPDATE_HWCLOCK" = "yes" ]; then + hwclock --systohc || : + fi +fi + +if [ -x /usr/bin/lockfile-create ] ; then + kill $LOCKTOUCHPID + lockfile-remove $LOCKFILE +fi + +) & diff --git a/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.default b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.default new file mode 100644 index 00000000..486b6e07 --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.default @@ -0,0 +1,7 @@ +# Configuration script used by ntpdate-sync script + +NTPSERVERS="" + +# Set to "yes" to write time to hardware clock on success +UPDATE_HWCLOCK="no" + diff --git a/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.service b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.service new file mode 100644 index 00000000..10cbd70f --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.service @@ -0,0 +1,11 @@ +[Unit] +Description=Network Time Service (one-shot ntpdate mode) +Before=ntpd.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/ntpdate-sync silent +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/reproducibility-fixed-path-to-posix-shell.patch b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/reproducibility-fixed-path-to-posix-shell.patch new file mode 100644 index 00000000..571db75f --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/reproducibility-fixed-path-to-posix-shell.patch @@ -0,0 +1,15 @@ +--- ntp-4.2.8p12.original/sntp/libopts/m4/libopts.m4 2018-11-12 17:54:57.747220846 +1300 ++++ ntp-4.2.8p12/sntp/libopts/m4/libopts.m4 2018-11-12 18:00:50.626211641 +1300 +@@ -114,12 +114,6 @@ + AC_PROG_SED + [while : + do +- POSIX_SHELL=`which bash` +- test -x "$POSIX_SHELL" && break +- POSIX_SHELL=`which dash` +- test -x "$POSIX_SHELL" && break +- POSIX_SHELL=/usr/xpg4/bin/sh +- test -x "$POSIX_SHELL" && break + POSIX_SHELL=`/bin/sh -c ' + exec 2>/dev/null + if ! true ; then exit 1 ; fi diff --git a/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/reproducibility-respect-source-date-epoch.patch b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/reproducibility-respect-source-date-epoch.patch new file mode 100644 index 00000000..58e71c3b --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/reproducibility-respect-source-date-epoch.patch @@ -0,0 +1,16 @@ +--- ntp-4.2.8p12.original/scripts/build/mkver.in 2018-11-12 14:06:49.333020430 +1300 ++++ ntp-4.2.8p12/scripts/build/mkver.in 2018-11-12 14:15:04.947480167 +1300 +@@ -15,7 +15,12 @@ + *) ConfStr="${ConfStr}-@VER_SUFFIX@" ;; + esac + +-ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`" ++if [ -n "$SOURCE_DATE_EPOCH" ]; then ++ ConfStr="$ConfStr `LC_TIME=C TZ=UTC date -d@$SOURCE_DATE_EPOCH 2>/dev/null`" || ++ ConfStr="$ConfStr `LC_TIME=C TZ=UTC date -r $SOURCE_DATE_EPOCH`" ++else ++ ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`" ++fi + + if [ ! -f .version ]; then + echo 0 > .version diff --git a/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp new file mode 100644 index 00000000..f8c5895b --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp @@ -0,0 +1 @@ +NTPSERVER="ntpserver.example.org" diff --git a/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp.service b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp.service new file mode 100644 index 00000000..4898b8a7 --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp.service @@ -0,0 +1,11 @@ +[Unit] +Description=Simple Network Time Service Client +After=network.target + +[Service] +Type=oneshot +EnvironmentFile=-/etc/default/sntp +ExecStart=/usr/sbin/sntp -s $NTPSERVER + +[Install] +WantedBy=multi-user.target diff --git a/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp_4.2.8p13.bb b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp_4.2.8p13.bb new file mode 100644 index 00000000..dc18a602 --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/ntp/ntp_4.2.8p13.bb @@ -0,0 +1,178 @@ +SUMMARY = "Network Time Protocol daemon and utilities" +DESCRIPTION = "The Network Time Protocol (NTP) is used to \ +synchronize the time of a computer client or server to \ +another server or reference time source, such as a radio \ +or satellite receiver or modem." +HOMEPAGE = "http://support.ntp.org" +SECTION = "net" +LICENSE = "NTP" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=4cee33257467509e498f4cd9a6a4bd53" + +DEPENDS = "libevent" + +SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \ + file://ntp-4.2.4_p6-nano.patch \ + file://reproducibility-fixed-path-to-posix-shell.patch \ + file://reproducibility-respect-source-date-epoch.patch \ + file://ntpd \ + file://ntp.conf \ + file://ntpdate \ + file://ntpdate.default \ + file://ntpdate.service \ + file://ntpd.service \ + file://sntp.service \ + file://sntp \ + file://ntpd.list \ +" + +SRC_URI[md5sum] = "ea040ab9b4ca656b5229b89d6b822f13" +SRC_URI[sha256sum] = "288772cecfcd9a53694ffab108d1825a31ba77f3a8466b0401baeca3bc232a38" + +inherit autotools update-rc.d useradd systemd pkgconfig + +# The ac_cv_header_readline_history is to stop ntpdc depending on either +# readline or curses +EXTRA_OECONF += "--with-net-snmp-config=no \ + --without-ntpsnmpd \ + ac_cv_header_readline_history_h=no \ + --with-yielding_select=yes \ + --with-locfile=redhat \ + --without-rpath \ + " +CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED" + +USERADD_PACKAGES = "${PN}" +NTP_USER_HOME ?= "/var/lib/ntp" +USERADD_PARAM_${PN} = "--system --home-dir ${NTP_USER_HOME} \ + --no-create-home \ + --shell /bin/false --user-group ntp" + +# NB: debug is default-enabled by NTP; keep it default-enabled here. +PACKAGECONFIG ??= "cap debug refclocks openssl \ + ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ +" +PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \ + --with-openssl-incdir=${STAGING_INCDIR} \ + --with-crypto, \ + --without-openssl --without-crypto, \ + openssl" +PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap" +PACKAGECONFIG[readline] = "--with-lineeditlibs,--without-lineeditlibs,readline" +PACKAGECONFIG[refclocks] = "--enable-all-clocks,--disable-all-clocks,pps-tools" +PACKAGECONFIG[debug] = "--enable-debugging,--disable-debugging" +PACKAGECONFIG[mdns] = "ac_cv_header_dns_sd_h=yes,ac_cv_header_dns_sd_h=no,mdns" +PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," + +do_install_append() { + install -d ${D}${sysconfdir}/init.d + install -m 644 ${WORKDIR}/ntp.conf ${D}${sysconfdir} + install -m 755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d + install -d ${D}${bindir} + install -m 755 ${WORKDIR}/ntpdate ${D}${bindir}/ntpdate-sync + + install -m 755 -d ${D}${NTP_USER_HOME} + chown ntp:ntp ${D}${NTP_USER_HOME} + + # Fix hardcoded paths in scripts + sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync + sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync + sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync + sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync + sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${bindir}/ntpdate-sync + sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntptrace + sed -i '/use/i use warnings;' ${D}${sbindir}/ntptrace + sed -i '1s,#!.*perl,#! ${bindir}/env perl,' ${D}${sbindir}/ntp-wait + sed -i '/use/i use warnings;' ${D}${sbindir}/ntp-wait + sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/calc_tickadj + sed -i '/use/i use warnings;' ${D}${sbindir}/calc_tickadj + + install -d ${D}/${sysconfdir}/default + install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate + install -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/ + + install -d ${D}/${sysconfdir}/network/if-up.d + ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d + + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/sntp.service ${D}${systemd_unitdir}/system/ + + install -d ${D}${systemd_unitdir}/ntp-units.d + install -m 0644 ${WORKDIR}/ntpd.list ${D}${systemd_unitdir}/ntp-units.d/60-ntpd.list + + # Remove an empty libexecdir. + rmdir --ignore-fail-on-non-empty ${D}${libexecdir} +} + +PACKAGES += "ntpdate sntp ntpq ${PN}-tickadj ${PN}-utils" +# NOTE: you don't need ntpdate, use "ntpd -q -g -x" + +# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms +# with wonky clocks (e.g. OpenSlug) +RDEPENDS_${PN} = "${PN}-tickadj" +# ntpd require libgcc for execution +RDEPENDS_${PN} += "libgcc" +# Handle move from bin to utils package +RPROVIDES_${PN}-utils = "${PN}-bin" +RREPLACES_${PN}-utils = "${PN}-bin" +RCONFLICTS_${PN}-utils = "${PN}-bin" +# ntpq was split out of ntp-utils +RDEPENDS_${PN}-utils = "ntpq" + +SYSTEMD_PACKAGES = "${PN} ntpdate sntp" +SYSTEMD_SERVICE_${PN} = "ntpd.service" +SYSTEMD_SERVICE_ntpdate = "ntpdate.service" +SYSTEMD_SERVICE_sntp = "sntp.service" +SYSTEMD_AUTO_ENABLE_sntp = "disable" + +RPROVIDES_${PN} += "${PN}-systemd" +RREPLACES_${PN} += "${PN}-systemd" +RCONFLICTS_${PN} += "${PN}-systemd" + +RPROVIDES_ntpdate += "ntpdate-systemd" +RREPLACES_ntpdate += "ntpdate-systemd" +RCONFLICTS_ntpdate += "ntpdate-systemd" + +RSUGGESTS_${PN} = "iana-etc" + +FILES_${PN} = "${sbindir}/ntpd.ntp ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${libdir} \ + ${NTP_USER_HOME} \ + ${systemd_unitdir}/ntp-units.d/60-ntpd.list ${libexecdir}\ +" +FILES_${PN}-tickadj = "${sbindir}/tickadj" +FILES_${PN}-utils = "${sbindir} ${datadir}/ntp/lib" +RDEPENDS_${PN}-utils += "perl" +FILES_ntpdate = "${sbindir}/ntpdate \ + ${sysconfdir}/network/if-up.d/ntpdate-sync \ + ${bindir}/ntpdate-sync \ + ${sysconfdir}/default/ntpdate \ + ${systemd_unitdir}/system/ntpdate.service \ +" +FILES_sntp = "${sbindir}/sntp \ + ${sysconfdir}/default/sntp \ + ${systemd_unitdir}/system/sntp.service \ + " +FILES_ntpq = "${sbindir}/ntpq" + +CONFFILES_${PN} = "${sysconfdir}/ntp.conf" +CONFFILES_ntpdate = "${sysconfdir}/default/ntpdate" + +INITSCRIPT_NAME = "ntpd" +# No dependencies, so just go in at the standard level (20) +INITSCRIPT_PARAMS = "defaults" + +pkg_postinst_ntpdate() { + if ! grep -q -s ntpdate $D/var/spool/cron/root; then + echo "adding crontab" + test -d $D/var/spool/cron || mkdir -p $D/var/spool/cron + echo "30 * * * * ${bindir}/ntpdate-sync silent" >> $D/var/spool/cron/root + fi +} + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" + +ALTERNATIVE_${PN} = "ntpd" +ALTERNATIVE_LINK_NAME[ntpd] = "${sbindir}/ntpd" -- cgit 1.2.3-korg