summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-networking/recipes-support/ntp/ntp.inc13
-rw-r--r--meta-networking/recipes-support/ntp/ntp/sntp1
-rw-r--r--meta-networking/recipes-support/ntp/ntp/sntp.service11
3 files changed, 23 insertions, 2 deletions
diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc
index a604b9c53..004dc9bee 100644
--- a/meta-networking/recipes-support/ntp/ntp.inc
+++ b/meta-networking/recipes-support/ntp/ntp.inc
@@ -20,6 +20,8 @@ SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.g
20 file://ntpdate.default \ 20 file://ntpdate.default \
21 file://ntpdate.service \ 21 file://ntpdate.service \
22 file://ntpd.service \ 22 file://ntpd.service \
23 file://sntp.service \
24 file://sntp \
23" 25"
24 26
25inherit autotools update-rc.d systemd 27inherit autotools update-rc.d systemd
@@ -52,15 +54,18 @@ do_install_append() {
52 54
53 install -d ${D}/${sysconfdir}/default 55 install -d ${D}/${sysconfdir}/default
54 install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate 56 install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate
57 install -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/
58
55 install -d ${D}/${sysconfdir}/network/if-up.d 59 install -d ${D}/${sysconfdir}/network/if-up.d
56 ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d 60 ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d
57 61
58 install -d ${D}${systemd_unitdir}/system 62 install -d ${D}${systemd_unitdir}/system
59 install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/ 63 install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/
60 install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/ 64 install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/
65 install -m 0644 ${WORKDIR}/sntp.service ${D}${systemd_unitdir}/system/
61} 66}
62 67
63PACKAGES += "ntpdate ${PN}-tickadj ${PN}-utils" 68PACKAGES += "ntpdate ${PN}-tickadj ${PN}-utils sntp"
64# NOTE: you don't need ntpdate, use "ntpd -q -g -x" 69# NOTE: you don't need ntpdate, use "ntpd -q -g -x"
65 70
66# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms 71# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
@@ -71,9 +76,10 @@ RPROVIDES_${PN}-utils = "${PN}-bin"
71RREPLACES_${PN}-utils = "${PN}-bin" 76RREPLACES_${PN}-utils = "${PN}-bin"
72RCONFLICTS_${PN}-utils = "${PN}-bin" 77RCONFLICTS_${PN}-utils = "${PN}-bin"
73 78
74SYSTEMD_PACKAGES = "${PN} ntpdate" 79SYSTEMD_PACKAGES = "${PN} ntpdate sntp"
75SYSTEMD_SERVICE_${PN} = "ntpd.service" 80SYSTEMD_SERVICE_${PN} = "ntpd.service"
76SYSTEMD_SERVICE_ntpdate = "ntpdate.service" 81SYSTEMD_SERVICE_ntpdate = "ntpdate.service"
82SYSTEMD_SERVICE_sntp = "sntp.service"
77 83
78RPROVIDES_${PN} += "${PN}-systemd" 84RPROVIDES_${PN} += "${PN}-systemd"
79RREPLACES_${PN} += "${PN}-systemd" 85RREPLACES_${PN} += "${PN}-systemd"
@@ -94,6 +100,9 @@ FILES_ntpdate = "${bindir}/ntpdate \
94 ${sysconfdir}/default/ntpdate \ 100 ${sysconfdir}/default/ntpdate \
95 ${systemd_unitdir}/system/ntpdate.service \ 101 ${systemd_unitdir}/system/ntpdate.service \
96" 102"
103FILES_sntp = "${bindir}/sntp \
104 ${sysconfdir}/default/sntp \
105 "
97 106
98CONFFILES_${PN} = "${sysconfdir}/ntp.conf" 107CONFFILES_${PN} = "${sysconfdir}/ntp.conf"
99CONFFILES_ntpdate = "${sysconfdir}/default/ntpdate" 108CONFFILES_ntpdate = "${sysconfdir}/default/ntpdate"
diff --git a/meta-networking/recipes-support/ntp/ntp/sntp b/meta-networking/recipes-support/ntp/ntp/sntp
new file mode 100644
index 000000000..f8c5895b7
--- /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 000000000..0f09e4347
--- /dev/null
+++ b/meta-networking/recipes-support/ntp/ntp/sntp.service
@@ -0,0 +1,11 @@
1[Unit]
2Description=Simple Network Time Service Client
3After=network.target
4
5[Service]
6Type=oneshot
7EnvironmentFile=-/etc/default/sntp
8ExecStart=/usr/bin/sntp -s $NTPSERVER
9
10[Install]
11WantedBy=multi-user.target