Skip to contentSkip to conversation

ntp: Create a separate package for sntp

PATCH Superseded Khem Raj 2 participants 3 messages Apr 15, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 ntp: Create a separate package for sntp

sntp provides the functionality of obsoleted ntpdate so we have option of using ntpd as well as sntp sntp does the immediate one time sync with time server and corrects the tme immediately. it replaces ntpdate nicely.

---
 meta-networking/recipes-support/ntp/ntp.inc        |    3 ++-
 .../meta-networking/recipes-support/ntp/ntp/sntp   |    1 +
 .../recipes-support/ntp/ntp/sntp.service           |   11 +++++++++++
 .../recipes-support/ntp/ntp_4.2.6p5.bbappend       |    9 ++++++++-
 4 files changed, 22 insertions(+), 2 deletions(-)
 create mode 100644 meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp
 create mode 100644 meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp.service
meta-networking/recipes-support/ntp/ntp.inc +2 -1
index d93f22d..cec0f22 100644
@@ -54,7 +54,7 @@ do_install_append() {
 	ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d
 }
 
-PACKAGES += "ntpdate ${PN}-tickadj ${PN}-utils"
+PACKAGES += "ntpdate sntp ${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
@@ -69,6 +69,7 @@ RSUGGESTS_${PN} = "iana-etc"
 
 FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${sbindir} ${libdir}"
 FILES_${PN}-tickadj = "${bindir}/tickadj"
+FILES_sntp = "${bindir}/sntp"
 FILES_${PN}-utils = "${bindir}"
 FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/network/if-up.d/ntpdate-sync ${bindir}/ntpdate-sync ${sysconfdir}/default/ntpdate"
 
meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp new file +1 -0
new file mode 100644
index 0000000..f8c5895
@@ -0,0 +1 @@
+NTPSERVER="ntpserver.example.org"
meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp.service new file +11 -0
new file mode 100644
index 0000000..0f09e43
@@ -0,0 +1,11 @@
+[Unit]
+Description=Simple Network Time Service Client
+After=network.target
+
+[Service]
+Type=oneshot
+EnvironmentFile=-/etc/default/sntp
+ExecStart=/usr/bin/sntp -s $NTPSERVER
+
+[Install]
+WantedBy=multi-user.target
meta-systemd/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bbappend +8 -1
index 7f2a796..c34bc96 100644
@@ -4,8 +4,9 @@ PRINC := "${@int(PRINC) + 2}"
 
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
-SYSTEMD_PACKAGES = "${PN} ntpdate"
+SYSTEMD_PACKAGES = "${PN} ntpdate sntp"
 SYSTEMD_SERVICE_${PN} = "ntpd.service"
+SYSTEMD_SERVICE_sntp = "sntp.service"
 SYSTEMD_SERVICE_ntpdate = "ntpdate.service"
 RPROVIDES_${PN} += "${PN}-systemd"
 RREPLACES_${PN} += "${PN}-systemd"
@@ -15,14 +16,20 @@ RREPLACES_ntpdate += "ntpdate-systemd"
 RCONFLICTS_ntpdate += "ntpdate-systemd"
 
 FILES_ntpdate += "${systemd_unitdir}/system/ntpdate.service"
+FILES_sntp += "${sysconfdir}/default/sntp"
 
 SRC_URI += " \
 	file://ntpdate.service \
         file://ntpd.service \
+        file://sntp.service \
+        file://sntp \
 "
 
 do_install_append() {
 	install -d ${D}${systemd_unitdir}/system
+	install -d ${D}${sysconfdir}/default
 	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 -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/
 }
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 7 lines · Khem Raj

sntp provides the functionality of obsoleted ntpdate so we have option of using ntpd as well as sntp sntp does the immediate one time sync with time server and corrects the tme immediately. it replaces ntpdate nicely.

Quoted 8 lines
---
 meta-networking/recipes-support/ntp/ntp.inc        |    3 ++-
 .../meta-networking/recipes-support/ntp/ntp/sntp   |    1 +
 .../recipes-support/ntp/ntp/sntp.service           |   11 +++++++++++
 .../recipes-support/ntp/ntp_4.2.6p5.bbappend       |    9 ++++++++-
 4 files changed, 22 insertions(+), 2 deletions(-)
 create mode 100644 meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp
 create mode 100644 meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp.service

It shouldn't create new .bbappends in meta-systemd.

Quoted 89 lines
meta-networking/recipes-support/ntp/ntp.inc +2 -1
index d93f22d..cec0f22 100644
@@ -54,7 +54,7 @@ do_install_append() {
 	ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d
 }
 
-PACKAGES += "ntpdate ${PN}-tickadj ${PN}-utils"
+PACKAGES += "ntpdate sntp ${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
@@ -69,6 +69,7 @@ RSUGGESTS_${PN} = "iana-etc"
 
 FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${sbindir} ${libdir}"
 FILES_${PN}-tickadj = "${bindir}/tickadj"
+FILES_sntp = "${bindir}/sntp"
 FILES_${PN}-utils = "${bindir}"
 FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/network/if-up.d/ntpdate-sync ${bindir}/ntpdate-sync ${sysconfdir}/default/ntpdate"
 
meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp new file +1 -0
new file mode 100644
index 0000000..f8c5895
@@ -0,0 +1 @@
+NTPSERVER="ntpserver.example.org"
meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp.service new file +11 -0
new file mode 100644
index 0000000..0f09e43
@@ -0,0 +1,11 @@
+[Unit]
+Description=Simple Network Time Service Client
+After=network.target
+
+[Service]
+Type=oneshot
+EnvironmentFile=-/etc/default/sntp
+ExecStart=/usr/bin/sntp -s $NTPSERVER
+
+[Install]
+WantedBy=multi-user.target
meta-systemd/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bbappend +8 -1
index 7f2a796..c34bc96 100644
@@ -4,8 +4,9 @@ PRINC := "${@int(PRINC) + 2}"
 
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
-SYSTEMD_PACKAGES = "${PN} ntpdate"
+SYSTEMD_PACKAGES = "${PN} ntpdate sntp"
 SYSTEMD_SERVICE_${PN} = "ntpd.service"
+SYSTEMD_SERVICE_sntp = "sntp.service"
 SYSTEMD_SERVICE_ntpdate = "ntpdate.service"
 RPROVIDES_${PN} += "${PN}-systemd"
 RREPLACES_${PN} += "${PN}-systemd"
@@ -15,14 +16,20 @@ RREPLACES_ntpdate += "ntpdate-systemd"
 RCONFLICTS_ntpdate += "ntpdate-systemd"
 
 FILES_ntpdate += "${systemd_unitdir}/system/ntpdate.service"
+FILES_sntp += "${sysconfdir}/default/sntp"
 
 SRC_URI += " \
 	file://ntpdate.service \
         file://ntpd.service \
+        file://sntp.service \
+        file://sntp \
 "
 
 do_install_append() {
 	install -d ${D}${systemd_unitdir}/system
+	install -d ${D}${sysconfdir}/default
 	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 -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/
 }
Signature · 7 lines
1.7.9.5


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
author
#2 lore raw
Quoted 5 lines · Martin Jansa
Quoted 3 lines
4 files changed, 22 insertions(+), 2 deletions(-)

create mode 100644 meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp create mode 100644 meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp.service

It shouldn't create new .bbappends in meta-systemd.

ah yes forgot that those changes merged in. I will send another one.