Skip to contentSkip to conversation

ntp: allow to run pkg_postinst_ntpdate in do_rootfs

PATCH In review Martin Jansa 2 participants 2 messages Aug 1, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ntp: allow to run pkg_postinst_ntpdate in do_rootfs

* 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

---
 meta-networking/recipes-support/ntp/ntp.inc | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
meta-networking/recipes-support/ntp/ntp.inc +3 -7
index 9367d41..6e8b452 100644
@@ -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
 }
 
Signature · 1 line
1.8.3.2
#1 lore raw

Herged. Thanks.
-J.

Quoted 30 lines · [[oe] [meta-networking][PATCH] ntp: allow to run pkg_postinst_ntpdate in…

* 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

---
 meta-networking/recipes-support/ntp/ntp.inc | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
meta-networking/recipes-support/ntp/ntp.inc +3 -7
index 9367d41..6e8b452 100644
@@ -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
 }
 
Signature · 2 lines
-Joe MacDonald.
:wq