summaryrefslogtreecommitdiff
path: root/recipes-support/ntp/ntp_%.bbappend
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-support/ntp/ntp_%.bbappend')
-rw-r--r--recipes-support/ntp/ntp_%.bbappend30
1 files changed, 30 insertions, 0 deletions
diff --git a/recipes-support/ntp/ntp_%.bbappend b/recipes-support/ntp/ntp_%.bbappend
new file mode 100644
index 0000000..6546de2
--- /dev/null
+++ b/recipes-support/ntp/ntp_%.bbappend
@@ -0,0 +1,30 @@
+PR .= ".mlinux2"
+
+SRC_URI += " file://ntpd-default \
+ "
+FILESEXTRAPATHS_prepend := "${THISDIR}/files"
+
+python do_patch_prepend () {
+ import os
+}
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/default
+ install -m 0644 ${WORKDIR}/ntpd-default ${D}${sysconfdir}/default/ntpd.default
+
+ drdir=${D}${localstatedir}/lib/ntp
+ install -d -m 0755 -p ${drdir}
+ drfile="${drdir}/ntp.drift"
+ touch ${drfile}
+ chmod 664 ${drfile}
+ chown -R ntp:ntp ${drdir}
+}
+pkg_postinst_${PN}_append() {
+ update-alternatives --install ${sysconfdir}/default/ntpd ntpd-defaults ${sysconfdir}/default/ntpd.default 10
+}
+
+pkg_postrm_${PN}_append() {
+ update-alternatives --remove ntpd-defaults ${sysconfdir}/default/ntpd.default
+}
+FILES_${PN} += "${sysconfdir}/default/ntpd.default ${localstatedir}/lib/*"
+CONFFILES_${PN} += "${sysconfdir}/default/ntpd.default"