diff options
| -rw-r--r-- | meta-networking/recipes-support/ntp/ntp.inc | 13 | ||||
| -rw-r--r-- | meta-networking/recipes-support/ntp/ntp/sntp | 1 | ||||
| -rw-r--r-- | meta-networking/recipes-support/ntp/ntp/sntp.service | 11 |
3 files changed, 23 insertions, 2 deletions
diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc index a604b9c53e..004dc9beed 100644 --- a/meta-networking/recipes-support/ntp/ntp.inc +++ b/meta-networking/recipes-support/ntp/ntp.inc | |||
| @@ -20,6 +20,8 @@ SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.g | |||
| 20 | file://ntpdate.default \ | 20 | file://ntpdate.default \ |
| 21 | file://ntpdate.service \ | 21 | file://ntpdate.service \ |
| 22 | file://ntpd.service \ | 22 | file://ntpd.service \ |
| 23 | file://sntp.service \ | ||
| 24 | file://sntp \ | ||
| 23 | " | 25 | " |
| 24 | 26 | ||
| 25 | inherit autotools update-rc.d systemd | 27 | inherit autotools update-rc.d systemd |
| @@ -52,15 +54,18 @@ do_install_append() { | |||
| 52 | 54 | ||
| 53 | install -d ${D}/${sysconfdir}/default | 55 | install -d ${D}/${sysconfdir}/default |
| 54 | install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate | 56 | install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate |
| 57 | install -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/ | ||
| 58 | |||
| 55 | install -d ${D}/${sysconfdir}/network/if-up.d | 59 | install -d ${D}/${sysconfdir}/network/if-up.d |
| 56 | ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d | 60 | ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d |
| 57 | 61 | ||
| 58 | install -d ${D}${systemd_unitdir}/system | 62 | install -d ${D}${systemd_unitdir}/system |
| 59 | install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/ | 63 | install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/ |
| 60 | install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/ | 64 | install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/ |
| 65 | install -m 0644 ${WORKDIR}/sntp.service ${D}${systemd_unitdir}/system/ | ||
| 61 | } | 66 | } |
| 62 | 67 | ||
| 63 | PACKAGES += "ntpdate ${PN}-tickadj ${PN}-utils" | 68 | PACKAGES += "ntpdate ${PN}-tickadj ${PN}-utils sntp" |
| 64 | # NOTE: you don't need ntpdate, use "ntpd -q -g -x" | 69 | # NOTE: you don't need ntpdate, use "ntpd -q -g -x" |
| 65 | 70 | ||
| 66 | # ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms | 71 | # ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms |
| @@ -71,9 +76,10 @@ RPROVIDES_${PN}-utils = "${PN}-bin" | |||
| 71 | RREPLACES_${PN}-utils = "${PN}-bin" | 76 | RREPLACES_${PN}-utils = "${PN}-bin" |
| 72 | RCONFLICTS_${PN}-utils = "${PN}-bin" | 77 | RCONFLICTS_${PN}-utils = "${PN}-bin" |
| 73 | 78 | ||
| 74 | SYSTEMD_PACKAGES = "${PN} ntpdate" | 79 | SYSTEMD_PACKAGES = "${PN} ntpdate sntp" |
| 75 | SYSTEMD_SERVICE_${PN} = "ntpd.service" | 80 | SYSTEMD_SERVICE_${PN} = "ntpd.service" |
| 76 | SYSTEMD_SERVICE_ntpdate = "ntpdate.service" | 81 | SYSTEMD_SERVICE_ntpdate = "ntpdate.service" |
| 82 | SYSTEMD_SERVICE_sntp = "sntp.service" | ||
| 77 | 83 | ||
| 78 | RPROVIDES_${PN} += "${PN}-systemd" | 84 | RPROVIDES_${PN} += "${PN}-systemd" |
| 79 | RREPLACES_${PN} += "${PN}-systemd" | 85 | RREPLACES_${PN} += "${PN}-systemd" |
| @@ -94,6 +100,9 @@ FILES_ntpdate = "${bindir}/ntpdate \ | |||
| 94 | ${sysconfdir}/default/ntpdate \ | 100 | ${sysconfdir}/default/ntpdate \ |
| 95 | ${systemd_unitdir}/system/ntpdate.service \ | 101 | ${systemd_unitdir}/system/ntpdate.service \ |
| 96 | " | 102 | " |
| 103 | FILES_sntp = "${bindir}/sntp \ | ||
| 104 | ${sysconfdir}/default/sntp \ | ||
| 105 | " | ||
| 97 | 106 | ||
| 98 | CONFFILES_${PN} = "${sysconfdir}/ntp.conf" | 107 | CONFFILES_${PN} = "${sysconfdir}/ntp.conf" |
| 99 | CONFFILES_ntpdate = "${sysconfdir}/default/ntpdate" | 108 | CONFFILES_ntpdate = "${sysconfdir}/default/ntpdate" |
diff --git a/meta-networking/recipes-support/ntp/ntp/sntp b/meta-networking/recipes-support/ntp/ntp/sntp new file mode 100644 index 0000000000..f8c5895b74 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/sntp | |||
| @@ -0,0 +1 @@ | |||
| NTPSERVER="ntpserver.example.org" | |||
diff --git a/meta-networking/recipes-support/ntp/ntp/sntp.service b/meta-networking/recipes-support/ntp/ntp/sntp.service new file mode 100644 index 0000000000..0f09e43474 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/sntp.service | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=Simple Network Time Service Client | ||
| 3 | After=network.target | ||
| 4 | |||
| 5 | [Service] | ||
| 6 | Type=oneshot | ||
| 7 | EnvironmentFile=-/etc/default/sntp | ||
| 8 | ExecStart=/usr/bin/sntp -s $NTPSERVER | ||
| 9 | |||
| 10 | [Install] | ||
| 11 | WantedBy=multi-user.target | ||
