summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWenzong Fan <wenzong.fan@windriver.com>2014-10-10 02:55:13 (GMT)
committerWenzong Fan <wenzong.fan@windriver.com>2014-10-10 03:09:49 (GMT)
commit8340c52b05b08faa77445dca83a15f3df0687b79 (patch)
tree9c4e0f3bfcbaf99ea04426b5f63939cd28e0861f
parent17ff23b4a4a0e5ed7efde107fb00296f1ebd5fdd (diff)
downloadpoky-contrib-wenzong/ntp.zip
poky-contrib-wenzong/ntp.tar.gz
poky-contrib-wenzong/ntp.tar.bz2
ntp: fix path to driftfilewenzong/ntp
Default path to driftfile is "/etc/ntp.drift", that doesn't work since ntp daemon is always started with "ntp" user. It should be created at the home directory of "ntp" which is "/var/lib/ntp/". Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
-rw-r--r--meta-networking/recipes-support/ntp/ntp.inc15
1 files changed, 15 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc
index f55a39a..f685274 100644
--- a/meta-networking/recipes-support/ntp/ntp.inc
+++ b/meta-networking/recipes-support/ntp/ntp.inc
@@ -53,6 +53,7 @@ PACKAGECONFIG[debug] = "--enable-debugging,--disable-debugging"
do_install_append() {
install -d ${D}${sysconfdir}/init.d
install -m 644 ${WORKDIR}/ntp.conf ${D}${sysconfdir}
+ sed -i 's!/etc/ntp.drift!/var/lib/ntp/drift!g' ${D}${sysconfdir}/ntp.conf
install -m 755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d
install -d ${D}${bindir}
install -m 755 ${WORKDIR}/ntpdate ${D}${bindir}/ntpdate-sync
@@ -72,6 +73,18 @@ do_install_append() {
install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate
install -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/
+ # Create tmpfiles
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ install -d ${D}/${sysconfdir}/default/volatiles
+ echo "d ntp ntp 0755 /var/lib/ntp none" \
+ > ${D}/${sysconfdir}/default/volatiles/99_ntpd
+ fi
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d /var/lib/ntp 0755 ntp ntp -" \
+ > ${D}${sysconfdir}/tmpfiles.d/99-ntpd.conf
+ fi
+
install -d ${D}/${sysconfdir}/network/if-up.d
ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d
@@ -112,6 +125,8 @@ RSUGGESTS_${PN} = "iana-etc"
FILES_${PN} = "${sbindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${libdir} \
${systemd_unitdir}/ntp-units.d/60-ntpd.list \
+ ${sysconfdir}/default/volatiles \
+ ${sysconfdir}/tmpfiles.d \
"
FILES_${PN}-tickadj = "${sbindir}/tickadj"
FILES_${PN}-utils = "${sbindir}"