ntp: allow to run pkg_postinst_ntpdate in do_rootfs
authorMartin Jansa <martin.jansa@gmail.com>
Thu, 1 Aug 2013 07:09:26 +0000 (09:09 +0200)
committerPatrick Ohly <patrick.ohly@intel.com>
Fri, 9 Jan 2015 16:32:01 +0000 (08:32 -0800)
* 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

(From meta-openembedded rev: 24a2c46d775b956ffdfc949834af6b43e67028c4)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
meta-openembedded/meta-networking/recipes-support/ntp/ntp.inc

index 9367d41..6e8b452 100644 (file)
@@ -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
 }