All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-networking][PATCH] ntp: allow to run pkg_postinst_ntpdate in do_rootfs
@ 2013-08-01  7:09 Martin Jansa
  2013-08-01 12:51 ` Joe MacDonald
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Jansa @ 2013-08-01  7:09 UTC (permalink / raw)
  To: openembedded-devel

* read-only rootfs cannot run postinsts on first boot and in this case
  it doesn't really have to as we can create cron task in do_rootfs

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta-networking/recipes-support/ntp/ntp.inc | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc
index 9367d41..6e8b452 100644
--- a/meta-networking/recipes-support/ntp/ntp.inc
+++ b/meta-networking/recipes-support/ntp/ntp.inc
@@ -114,14 +114,10 @@ INITSCRIPT_NAME = "ntpd"
 INITSCRIPT_PARAMS = "defaults"
 
 pkg_postinst_ntpdate() {
-if test "x$D" != "x"; then
-    exit 1
-else
-    if ! grep -q -s ntpdate /var/spool/cron/root; then
+    if ! grep -q -s ntpdate $D/var/spool/cron/root; then
         echo "adding crontab"
-        test -d /var/spool/cron || mkdir -p /var/spool/cron
-        echo "30 * * * *    ${bindir}/ntpdate-sync silent" >> /var/spool/cron/root
+        test -d $D/var/spool/cron || mkdir -p $D/var/spool/cron
+        echo "30 * * * *    ${bindir}/ntpdate-sync silent" >> $D/var/spool/cron/root
     fi
-fi
 }
 
-- 
1.8.3.2



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

* Re: [meta-networking][PATCH] ntp: allow to run pkg_postinst_ntpdate in do_rootfs
  2013-08-01  7:09 [meta-networking][PATCH] ntp: allow to run pkg_postinst_ntpdate in do_rootfs Martin Jansa
@ 2013-08-01 12:51 ` Joe MacDonald
  0 siblings, 0 replies; 2+ messages in thread
From: Joe MacDonald @ 2013-08-01 12:51 UTC (permalink / raw)
  To: openembedded-devel

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

Herged.  Thanks.
-J.

[[oe] [meta-networking][PATCH] ntp: allow to run pkg_postinst_ntpdate in do_rootfs] On 13.08.01 (Thu 09:09) Martin Jansa wrote:

> * read-only rootfs cannot run postinsts on first boot and in this case
>   it doesn't really have to as we can create cron task in do_rootfs
> 
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  meta-networking/recipes-support/ntp/ntp.inc | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc
> index 9367d41..6e8b452 100644
> --- a/meta-networking/recipes-support/ntp/ntp.inc
> +++ b/meta-networking/recipes-support/ntp/ntp.inc
> @@ -114,14 +114,10 @@ INITSCRIPT_NAME = "ntpd"
>  INITSCRIPT_PARAMS = "defaults"
>  
>  pkg_postinst_ntpdate() {
> -if test "x$D" != "x"; then
> -    exit 1
> -else
> -    if ! grep -q -s ntpdate /var/spool/cron/root; then
> +    if ! grep -q -s ntpdate $D/var/spool/cron/root; then
>          echo "adding crontab"
> -        test -d /var/spool/cron || mkdir -p /var/spool/cron
> -        echo "30 * * * *    ${bindir}/ntpdate-sync silent" >> /var/spool/cron/root
> +        test -d $D/var/spool/cron || mkdir -p $D/var/spool/cron
> +        echo "30 * * * *    ${bindir}/ntpdate-sync silent" >> $D/var/spool/cron/root
>      fi
> -fi
>  }
>  
-- 
-Joe MacDonald.
:wq

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

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

end of thread, other threads:[~2013-08-01 12:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-01  7:09 [meta-networking][PATCH] ntp: allow to run pkg_postinst_ntpdate in do_rootfs Martin Jansa
2013-08-01 12:51 ` Joe MacDonald

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.