diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
commit | 1b8dfe266937a37a4c642f96ceb2347bf4c00a17 (patch) | |
tree | 0c6aab146bb3c82efd9c7846a9a4e70dcb0ec84f /meta-networking/recipes-support/ntp | |
download | meta-openembedded-daisy-140929.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-networking/recipes-support/ntp')
14 files changed, 428 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/ntp/files/ntp-4.2.4_p6-nano.patch b/meta-networking/recipes-support/ntp/files/ntp-4.2.4_p6-nano.patch new file mode 100644 index 0000000000..cb1e2f7341 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntp-4.2.4_p6-nano.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | --- a/include/ntp_syscall.h.orig 2009-05-19 16:44:55.048156467 -0400 | ||
2 | +++ b/include/ntp_syscall.h 2009-05-19 16:46:19.293323686 -0400 | ||
3 | @@ -14,6 +14,14 @@ | ||
4 | # include <sys/timex.h> | ||
5 | #endif | ||
6 | |||
7 | +#if defined(ADJ_NANO) && !defined(MOD_NANO) | ||
8 | +#define MOD_NANO ADJ_NANO | ||
9 | +#endif | ||
10 | + | ||
11 | +#if defined(ADJ_TAI) && !defined(MOD_TAI) | ||
12 | +#define MOD_TAI ADJ_TAI | ||
13 | +#endif | ||
14 | + | ||
15 | #ifndef NTP_SYSCALLS_LIBC | ||
16 | #ifdef NTP_SYSCALLS_STD | ||
17 | # define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t)) | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntp.conf b/meta-networking/recipes-support/ntp/files/ntp.conf new file mode 100644 index 0000000000..875b7ebc1d --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntp.conf | |||
@@ -0,0 +1,17 @@ | |||
1 | # This is the most basic ntp configuration file | ||
2 | # The driftfile must remain in a place specific to this | ||
3 | # machine - it records the machine specific clock error | ||
4 | driftfile /etc/ntp.drift | ||
5 | # This should be a server that is close (in IP terms) | ||
6 | # to the machine. Add other servers as required. | ||
7 | # Unless you un-comment the line below ntpd will sync | ||
8 | # only against the local system clock. | ||
9 | # | ||
10 | # server time.server.example.com | ||
11 | # | ||
12 | # Using local hardware clock as fallback | ||
13 | # Disable this when using ntpd -q -g -x as ntpdate or it will sync to itself | ||
14 | server 127.127.1.0 | ||
15 | fudge 127.127.1.0 stratum 14 | ||
16 | # Defining a default security setting | ||
17 | restrict default | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntpd b/meta-networking/recipes-support/ntp/files/ntpd new file mode 100755 index 0000000000..a62b8ce691 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntpd | |||
@@ -0,0 +1,64 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | PATH=/sbin:/bin:/usr/bin:/usr/sbin | ||
4 | |||
5 | # ntpd init.d script for ntpdc from ntp.isc.org | ||
6 | test -x /usr/sbin/ntpd -a -r /etc/ntp.conf || exit 0 | ||
7 | # rcS contains TICKADJ | ||
8 | test -r /etc/default/rcS && . /etc/default/rcS | ||
9 | |||
10 | # Functions to do individual actions | ||
11 | settick(){ | ||
12 | # If TICKADJ is set we *must* adjust it before we start, because the | ||
13 | # driftfile relies on the correct setting | ||
14 | test -n "$TICKADJ" -a -x /usr/sbin/tickadj && { | ||
15 | echo -n "Setting tick to $TICKADJ: " | ||
16 | /usr/sbin/tickadj "$TICKADJ" | ||
17 | echo "done" | ||
18 | } | ||
19 | } | ||
20 | startdaemon(){ | ||
21 | # The -g option allows ntpd to step the time to correct it just | ||
22 | # once. The daemon will exit if the clock drifts too much after | ||
23 | # this. If ntpd seems to disappear after a while assume TICKADJ | ||
24 | # above is set to a totally incorrect value. | ||
25 | echo -n "Starting ntpd: " | ||
26 | start-stop-daemon --start -x /usr/sbin/ntpd -- -u ntp:ntp -p /var/run/ntp.pid "$@" | ||
27 | echo "done" | ||
28 | } | ||
29 | stopdaemon(){ | ||
30 | echo -n "Stopping ntpd: " | ||
31 | start-stop-daemon --stop -p /var/run/ntp.pid | ||
32 | echo "done" | ||
33 | } | ||
34 | |||
35 | case "$1" in | ||
36 | start) | ||
37 | settick | ||
38 | startdaemon -g | ||
39 | ;; | ||
40 | stop) | ||
41 | stopdaemon | ||
42 | ;; | ||
43 | force-reload) | ||
44 | stopdaemon | ||
45 | settick | ||
46 | startdaemon -g | ||
47 | ;; | ||
48 | restart) | ||
49 | # Don't reset the tick here | ||
50 | stopdaemon | ||
51 | startdaemon -g | ||
52 | ;; | ||
53 | reload) | ||
54 | # Must do this by hand, but don't do -g | ||
55 | stopdaemon | ||
56 | startdaemon | ||
57 | ;; | ||
58 | *) | ||
59 | echo "Usage: ntpd { start | stop | restart | reload }" >&2 | ||
60 | exit 1 | ||
61 | ;; | ||
62 | esac | ||
63 | |||
64 | exit 0 | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntpdate b/meta-networking/recipes-support/ntp/files/ntpdate new file mode 100755 index 0000000000..17b64d1335 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntpdate | |||
@@ -0,0 +1,54 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | PATH=/sbin:/bin:/usr/bin:/usr/sbin | ||
4 | |||
5 | test -x /usr/sbin/ntpdate || exit 0 | ||
6 | |||
7 | if test -f /etc/default/ntpdate ; then | ||
8 | . /etc/default/ntpdate | ||
9 | fi | ||
10 | |||
11 | if [ "$NTPSERVERS" = "" ] ; then | ||
12 | if [ "$METHOD" = "" -a "$1" != "silent" ] ; then | ||
13 | echo "Please set NTPSERVERS in /etc/default/ntpdate" | ||
14 | exit 1 | ||
15 | else | ||
16 | exit 0 | ||
17 | fi | ||
18 | fi | ||
19 | |||
20 | # This is a heuristic: The idea is that if a static interface is brought | ||
21 | # up, that is a major event, and we can put in some extra effort to fix | ||
22 | # the system time. Feel free to change this, especially if you regularly | ||
23 | # bring up new network interfaces. | ||
24 | if [ "$METHOD" = static ]; then | ||
25 | OPTS="-b" | ||
26 | fi | ||
27 | |||
28 | if [ "$METHOD" = loopback ]; then | ||
29 | exit 0 | ||
30 | fi | ||
31 | |||
32 | ( | ||
33 | |||
34 | LOCKFILE=/var/lock/ntpdate | ||
35 | |||
36 | # Avoid running more than one at a time | ||
37 | if [ -x /usr/bin/lockfile-create ]; then | ||
38 | lockfile-create $LOCKFILE | ||
39 | lockfile-touch $LOCKFILE & | ||
40 | LOCKTOUCHPID="$!" | ||
41 | fi | ||
42 | |||
43 | if /usr/sbin/ntpdate -s $OPTS $NTPSERVERS 2>/dev/null; then | ||
44 | if [ "$UPDATE_HWCLOCK" = "yes" ]; then | ||
45 | hwclock --systohc || : | ||
46 | fi | ||
47 | fi | ||
48 | |||
49 | if [ -x /usr/bin/lockfile-create ] ; then | ||
50 | kill $LOCKTOUCHPID | ||
51 | lockfile-remove $LOCKFILE | ||
52 | fi | ||
53 | |||
54 | ) & | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntpdate.default b/meta-networking/recipes-support/ntp/files/ntpdate.default new file mode 100644 index 0000000000..486b6e07d3 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntpdate.default | |||
@@ -0,0 +1,7 @@ | |||
1 | # Configuration script used by ntpdate-sync script | ||
2 | |||
3 | NTPSERVERS="" | ||
4 | |||
5 | # Set to "yes" to write time to hardware clock on success | ||
6 | UPDATE_HWCLOCK="no" | ||
7 | |||
diff --git a/meta-networking/recipes-support/ntp/files/openssl-check.patch b/meta-networking/recipes-support/ntp/files/openssl-check.patch new file mode 100644 index 0000000000..8b4a6733cd --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/openssl-check.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | Hack OpenSSL check to work when libssl and libcrypto aren't in same dir | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
6 | --- | ||
7 | configure | 4 ++-- | ||
8 | m4/ntp_openssl.m4 | 4 ++-- | ||
9 | sntp/configure | 4 ++-- | ||
10 | 3 files changed, 6 insertions(+), 6 deletions(-) | ||
11 | |||
12 | diff --git a/configure b/configure | ||
13 | index aae2c01..6a3c15e 100755 | ||
14 | --- a/configure | ||
15 | +++ b/configure | ||
16 | @@ -22868,8 +22868,8 @@ case "$ans" in | ||
17 | test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break | ||
18 | ;; | ||
19 | *) | ||
20 | - test -f $i/libcrypto.so -a -f $i/libssl.so && break | ||
21 | - test -f $i/libcrypto.a -a -f $i/libssl.a && break | ||
22 | + test -f $i/libssl.so && break | ||
23 | + test -f $i/libssl.a && break | ||
24 | ;; | ||
25 | esac | ||
26 | done | ||
27 | diff --git a/m4/ntp_openssl.m4 b/m4/ntp_openssl.m4 | ||
28 | index 7d9f477..67bdd55 100644 | ||
29 | --- a/m4/ntp_openssl.m4 | ||
30 | +++ b/m4/ntp_openssl.m4 | ||
31 | @@ -41,8 +41,8 @@ case "$ans" in | ||
32 | test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break | ||
33 | ;; | ||
34 | *) | ||
35 | - test -f $i/libcrypto.so -a -f $i/libssl.so && break | ||
36 | - test -f $i/libcrypto.a -a -f $i/libssl.a && break | ||
37 | + test -f $i/libssl.so && break | ||
38 | + test -f $i/libssl.a && break | ||
39 | ;; | ||
40 | esac | ||
41 | done | ||
42 | diff --git a/sntp/configure b/sntp/configure | ||
43 | index 7782c29..55e82d9 100755 | ||
44 | --- a/sntp/configure | ||
45 | +++ b/sntp/configure | ||
46 | @@ -14810,8 +14810,8 @@ case "$ans" in | ||
47 | test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break | ||
48 | ;; | ||
49 | *) | ||
50 | - test -f $i/libcrypto.so -a -f $i/libssl.so && break | ||
51 | - test -f $i/libcrypto.a -a -f $i/libssl.a && break | ||
52 | + test -f $i/libssl.so && break | ||
53 | + test -f $i/libssl.a && break | ||
54 | ;; | ||
55 | esac | ||
56 | done | ||
57 | -- | ||
58 | 1.7.1 | ||
59 | |||
diff --git a/meta-networking/recipes-support/ntp/files/tickadj.c.patch b/meta-networking/recipes-support/ntp/files/tickadj.c.patch new file mode 100644 index 0000000000..9ef9de9e1f --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/tickadj.c.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Index: ntp-4.2.2p3-r0/ntp-4.2.2p3/util/tickadj.c | ||
2 | =================================================================== | ||
3 | --- ntp-4.2.2p3/util/tickadj.c 2004-02-25 06:58:33.000000000 +0100 | ||
4 | +++ ntp-4.2.2p3/util/tickadj.c 2007-07-07 01:00:54.000000000 +0200 | ||
5 | @@ -21,7 +21,8 @@ | ||
6 | # include <unistd.h> | ||
7 | #endif /* HAVE_UNISTD_H */ | ||
8 | |||
9 | -#ifdef HAVE___ADJTIMEX /* Linux */ | ||
10 | +/* proper handling here has been moved to upstream ntp bugzilla */ | ||
11 | +#ifdef linux | ||
12 | |||
13 | #include <sys/timex.h> | ||
14 | struct timex txc; | ||
15 | @@ -91,7 +92,7 @@ | ||
16 | } | ||
17 | |||
18 | if (!errflg) { | ||
19 | - if (__adjtimex(&txc) < 0) | ||
20 | + if (adjtimex(&txc) < 0) | ||
21 | perror("adjtimex"); | ||
22 | else if (!quiet) | ||
23 | printf("tick = %ld\ntick_adj = %d\n", | ||
24 | @@ -146,7 +147,7 @@ | ||
25 | #endif | ||
26 | } | ||
27 | |||
28 | - if (__adjtimex(&txc) < 0) | ||
29 | + if (adjtimex(&txc) < 0) | ||
30 | { | ||
31 | perror("adjtimex"); | ||
32 | } | ||
diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc new file mode 100644 index 0000000000..49f9901e1e --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp.inc | |||
@@ -0,0 +1,137 @@ | |||
1 | SUMMARY = "Network Time Protocol daemon and utilities" | ||
2 | DESCRIPTION = "The Network Time Protocol (NTP) is used to \ | ||
3 | synchronize the time of a computer client or server to \ | ||
4 | another server or reference time source, such as a radio \ | ||
5 | or satellite receiver or modem." | ||
6 | HOMEPAGE = "http://support.ntp.org" | ||
7 | SECTION = "console/network" | ||
8 | LICENSE = "NTP" | ||
9 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=fea4b50c33b18c2194b4b1c9ca512670" | ||
10 | |||
11 | INC_PR = "r6" | ||
12 | |||
13 | SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \ | ||
14 | file://tickadj.c.patch \ | ||
15 | file://ntp-4.2.4_p6-nano.patch \ | ||
16 | file://openssl-check.patch \ | ||
17 | file://ntpd \ | ||
18 | file://ntp.conf \ | ||
19 | file://ntpdate \ | ||
20 | file://ntpdate.default \ | ||
21 | file://ntpdate.service \ | ||
22 | file://ntpd.service \ | ||
23 | file://sntp.service \ | ||
24 | file://sntp \ | ||
25 | file://ntpd.list \ | ||
26 | " | ||
27 | |||
28 | inherit autotools update-rc.d useradd systemd | ||
29 | |||
30 | # The ac_cv_header_readline_history is to stop ntpdc depending on either | ||
31 | # readline or curses | ||
32 | EXTRA_OECONF += "--with-net-snmp-config=no --without-ntpsnmpd ac_cv_header_readline_history_h=no --with-binsubdir=sbin" | ||
33 | CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED" | ||
34 | |||
35 | USERADD_PACKAGES = "${PN}" | ||
36 | USERADD_PARAM_${PN} = "--system --home-dir /var/lib/ntp \ | ||
37 | --shell /bin/false --user-group ntp" | ||
38 | |||
39 | PACKAGECONFIG ??= "cap" | ||
40 | PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \ | ||
41 | --with-openssl-incdir=${STAGING_INCDIR} \ | ||
42 | --with-crypto, \ | ||
43 | --without-openssl --without-crypto, \ | ||
44 | openssl" | ||
45 | PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap" | ||
46 | PACKAGECONFIG[readline] = "--with-lineeditlibs,--without-lineeditlibs,readline" | ||
47 | |||
48 | do_install_append() { | ||
49 | install -d ${D}${sysconfdir}/init.d | ||
50 | install -m 644 ${WORKDIR}/ntp.conf ${D}${sysconfdir} | ||
51 | install -m 755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d | ||
52 | install -d ${D}${bindir} | ||
53 | install -m 755 ${WORKDIR}/ntpdate ${D}${bindir}/ntpdate-sync | ||
54 | |||
55 | # Fix hardcoded paths in scripts | ||
56 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
57 | sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
58 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
59 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
60 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${bindir}/ntpdate-sync | ||
61 | sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntptrace | ||
62 | sed -i '/use/i use warnings;' ${D}${sbindir}/ntptrace | ||
63 | sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntp-wait | ||
64 | sed -i '/use/i use warnings;' ${D}${sbindir}/ntp-wait | ||
65 | |||
66 | install -d ${D}/${sysconfdir}/default | ||
67 | install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate | ||
68 | install -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/ | ||
69 | |||
70 | install -d ${D}/${sysconfdir}/network/if-up.d | ||
71 | ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d | ||
72 | |||
73 | install -d ${D}${systemd_unitdir}/system | ||
74 | install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/ | ||
75 | install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/ | ||
76 | install -m 0644 ${WORKDIR}/sntp.service ${D}${systemd_unitdir}/system/ | ||
77 | |||
78 | install -d ${D}${systemd_unitdir}/ntp-units.d | ||
79 | install -m 0644 ${WORKDIR}/ntpd.list ${D}${systemd_unitdir}/ntp-units.d/60-ntpd.list | ||
80 | } | ||
81 | |||
82 | PACKAGES += "ntpdate sntp ${PN}-tickadj ${PN}-utils" | ||
83 | # NOTE: you don't need ntpdate, use "ntpd -q -g -x" | ||
84 | |||
85 | # ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms | ||
86 | # with wonky clocks (e.g. OpenSlug) | ||
87 | RDEPENDS_${PN} = "${PN}-tickadj" | ||
88 | # Handle move from bin to utils package | ||
89 | RPROVIDES_${PN}-utils = "${PN}-bin" | ||
90 | RREPLACES_${PN}-utils = "${PN}-bin" | ||
91 | RCONFLICTS_${PN}-utils = "${PN}-bin" | ||
92 | |||
93 | SYSTEMD_PACKAGES = "${PN} ntpdate sntp" | ||
94 | SYSTEMD_SERVICE_${PN} = "ntpd.service" | ||
95 | SYSTEMD_SERVICE_ntpdate = "ntpdate.service" | ||
96 | SYSTEMD_SERVICE_sntp = "sntp.service" | ||
97 | |||
98 | RPROVIDES_${PN} += "${PN}-systemd" | ||
99 | RREPLACES_${PN} += "${PN}-systemd" | ||
100 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
101 | |||
102 | RPROVIDES_ntpdate += "ntpdate-systemd" | ||
103 | RREPLACES_ntpdate += "ntpdate-systemd" | ||
104 | RCONFLICTS_ntpdate += "ntpdate-systemd" | ||
105 | |||
106 | RSUGGESTS_${PN} = "iana-etc" | ||
107 | |||
108 | FILES_${PN} = "${sbindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${libdir} \ | ||
109 | ${systemd_unitdir}/ntp-units.d/60-ntpd.list \ | ||
110 | " | ||
111 | FILES_${PN}-tickadj = "${sbindir}/tickadj" | ||
112 | FILES_${PN}-utils = "${sbindir}" | ||
113 | FILES_ntpdate = "${sbindir}/ntpdate \ | ||
114 | ${sysconfdir}/network/if-up.d/ntpdate-sync \ | ||
115 | ${bindir}/ntpdate-sync \ | ||
116 | ${sysconfdir}/default/ntpdate \ | ||
117 | ${systemd_unitdir}/system/ntpdate.service \ | ||
118 | " | ||
119 | FILES_sntp = "${sbindir}/sntp \ | ||
120 | ${sysconfdir}/default/sntp \ | ||
121 | " | ||
122 | |||
123 | CONFFILES_${PN} = "${sysconfdir}/ntp.conf" | ||
124 | CONFFILES_ntpdate = "${sysconfdir}/default/ntpdate" | ||
125 | |||
126 | INITSCRIPT_NAME = "ntpd" | ||
127 | # No dependencies, so just go in at the standard level (20) | ||
128 | INITSCRIPT_PARAMS = "defaults" | ||
129 | |||
130 | pkg_postinst_ntpdate() { | ||
131 | if ! grep -q -s ntpdate $D/var/spool/cron/root; then | ||
132 | echo "adding crontab" | ||
133 | test -d $D/var/spool/cron || mkdir -p $D/var/spool/cron | ||
134 | echo "30 * * * * ${bindir}/ntpdate-sync silent" >> $D/var/spool/cron/root | ||
135 | fi | ||
136 | } | ||
137 | |||
diff --git a/meta-networking/recipes-support/ntp/ntp/ntpd.list b/meta-networking/recipes-support/ntp/ntp/ntpd.list new file mode 100644 index 0000000000..d1fe6b7e28 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/ntpd.list | |||
@@ -0,0 +1 @@ | |||
ntpd.service | |||
diff --git a/meta-networking/recipes-support/ntp/ntp/ntpd.service b/meta-networking/recipes-support/ntp/ntp/ntpd.service new file mode 100644 index 0000000000..b7c4268646 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/ntpd.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Network Time Service | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | PIDFile=/run/ntpd.pid | ||
8 | ExecStart=/usr/sbin/ntpd -p /run/ntpd.pid -g | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-support/ntp/ntp/ntpdate.service b/meta-networking/recipes-support/ntp/ntp/ntpdate.service new file mode 100644 index 0000000000..10cbd70f99 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/ntpdate.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Network Time Service (one-shot ntpdate mode) | ||
3 | Before=ntpd.service | ||
4 | |||
5 | [Service] | ||
6 | Type=oneshot | ||
7 | ExecStart=/usr/bin/ntpdate-sync silent | ||
8 | RemainAfterExit=yes | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-support/ntp/ntp/sntp b/meta-networking/recipes-support/ntp/ntp/sntp new file mode 100644 index 0000000000..f8c5895b74 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/sntp | |||
@@ -0,0 +1 @@ | |||
NTPSERVER="ntpserver.example.org" | |||
diff --git a/meta-networking/recipes-support/ntp/ntp/sntp.service b/meta-networking/recipes-support/ntp/ntp/sntp.service new file mode 100644 index 0000000000..4898b8a709 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/sntp.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Simple Network Time Service Client | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=oneshot | ||
7 | EnvironmentFile=-/etc/default/sntp | ||
8 | ExecStart=/usr/sbin/sntp -s $NTPSERVER | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb b/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb new file mode 100644 index 0000000000..588a1b03c9 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | require ntp.inc | ||
2 | |||
3 | PR = "${INC_PR}.0" | ||
4 | |||
5 | SRC_URI[md5sum] = "00df80a84ec9528fcfb09498075525bc" | ||
6 | SRC_URI[sha256sum] = "d6ab8371f9d31e594eb6922823d5ccd03dcc4e9d84b0e23ea25ac1405432f91c" | ||