All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-networking][meta-systemd][PATCH] ntp: Create a separate package for sntp
@ 2013-02-15 19:22 Khem Raj
  2013-02-16 19:44 ` Paul Eggleton
  2013-04-13 15:01 ` Martin Jansa
  0 siblings, 2 replies; 3+ messages in thread
From: Khem Raj @ 2013-02-15 19:22 UTC (permalink / raw)
  To: openembedded-devel

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.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 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

diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc
index d93f22d..cec0f22 100644
--- a/meta-networking/recipes-support/ntp/ntp.inc
+++ b/meta-networking/recipes-support/ntp/ntp.inc
@@ -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"
 
diff --git a/meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp b/meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp
new file mode 100644
index 0000000..9529cdf
--- /dev/null
+++ b/meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp
@@ -0,0 +1 @@
+NTPSERVER="pool.ntp.org"
diff --git a/meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp.service b/meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp.service
new file mode 100644
index 0000000..0f09e43
--- /dev/null
+++ b/meta-systemd/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/bin/sntp -s $NTPSERVER
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-systemd/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bbappend b/meta-systemd/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bbappend
index 4580cf7..d9715bd 100644
--- a/meta-systemd/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bbappend
+++ b/meta-systemd/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bbappend
@@ -4,19 +4,26 @@ PRINC := "${@int(PRINC) + 1}"
 
 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"
 
 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/
 }
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [meta-networking][meta-systemd][PATCH] ntp: Create a separate package for sntp
  2013-02-15 19:22 [meta-networking][meta-systemd][PATCH] ntp: Create a separate package for sntp Khem Raj
@ 2013-02-16 19:44 ` Paul Eggleton
  2013-04-13 15:01 ` Martin Jansa
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2013-02-16 19:44 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-devel

On Friday 15 February 2013 11:22:18 Khem Raj wrote:
> 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.
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  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
> 
> diff --git a/meta-networking/recipes-support/ntp/ntp.inc
> b/meta-networking/recipes-support/ntp/ntp.inc index d93f22d..cec0f22 100644
> --- a/meta-networking/recipes-support/ntp/ntp.inc
> +++ b/meta-networking/recipes-support/ntp/ntp.inc
> @@ -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"
> 
> diff --git a/meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp
> b/meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp new file mode
> 100644
> index 0000000..9529cdf
> --- /dev/null
> +++ b/meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp
> @@ -0,0 +1 @@
> +NTPSERVER="pool.ntp.org"

Argh, no, we cannot use this as a default. We discussed this at length 
earlier.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [meta-networking][meta-systemd][PATCH] ntp: Create a separate package for sntp
  2013-02-15 19:22 [meta-networking][meta-systemd][PATCH] ntp: Create a separate package for sntp Khem Raj
  2013-02-16 19:44 ` Paul Eggleton
@ 2013-04-13 15:01 ` Martin Jansa
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Jansa @ 2013-04-13 15:01 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 4577 bytes --]

On Fri, Feb 15, 2013 at 11:22:18AM -0800, Khem Raj wrote:
> 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.

Can you rebase this change on top of contrib/jansa/in-test and address
Paul's comment, when you have time?

Thanks

> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  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
> 
> diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc
> index d93f22d..cec0f22 100644
> --- a/meta-networking/recipes-support/ntp/ntp.inc
> +++ b/meta-networking/recipes-support/ntp/ntp.inc
> @@ -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"
>  
> diff --git a/meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp b/meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp
> new file mode 100644
> index 0000000..9529cdf
> --- /dev/null
> +++ b/meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp
> @@ -0,0 +1 @@
> +NTPSERVER="pool.ntp.org"
> diff --git a/meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp.service b/meta-systemd/meta-networking/recipes-support/ntp/ntp/sntp.service
> new file mode 100644
> index 0000000..0f09e43
> --- /dev/null
> +++ b/meta-systemd/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/bin/sntp -s $NTPSERVER
> +
> +[Install]
> +WantedBy=multi-user.target
> diff --git a/meta-systemd/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bbappend b/meta-systemd/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bbappend
> index 4580cf7..d9715bd 100644
> --- a/meta-systemd/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bbappend
> +++ b/meta-systemd/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bbappend
> @@ -4,19 +4,26 @@ PRINC := "${@int(PRINC) + 1}"
>  
>  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"
>  
>  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/
>  }
> -- 
> 1.7.9.5
> 
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-13 15:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-15 19:22 [meta-networking][meta-systemd][PATCH] ntp: Create a separate package for sntp Khem Raj
2013-02-16 19:44 ` Paul Eggleton
2013-04-13 15:01 ` Martin Jansa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.