Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | SUMMARY = "Versatile implementation of the Network Time Protocol" |
| 2 | DESCRIPTION = "Chrony can synchronize the system clock with NTP \ |
| 3 | servers, reference clocks (e.g. GPS receiver), and manual input using \ |
| 4 | wristwatch and keyboard. It can also operate as an NTPv4 (RFC 5905) \ |
| 5 | server and peer to provide a time service to other computers in the \ |
| 6 | network. \ |
| 7 | \ |
| 8 | It is designed to perform well in a wide range of conditions, \ |
| 9 | including intermittent network connections, heavily congested \ |
| 10 | networks, changing temperatures (ordinary computer clocks are \ |
| 11 | sensitive to temperature), and systems that do not run continuously, or \ |
| 12 | run on a virtual machine. \ |
| 13 | \ |
| 14 | Typical accuracy between two machines on a LAN is in tens, or a few \ |
| 15 | hundreds, of microseconds; over the Internet, accuracy is typically \ |
| 16 | within a few milliseconds. With a good hardware reference clock \ |
| 17 | sub-microsecond accuracy is possible. \ |
| 18 | \ |
| 19 | Two programs are included in chrony: chronyd is a daemon that can be \ |
| 20 | started at boot time and chronyc is a command-line interface program \ |
| 21 | which can be used to monitor chronyd's performance and to change \ |
| 22 | various operating parameters whilst it is running. \ |
| 23 | \ |
| 24 | This recipe produces two binary packages: 'chrony' which contains chronyd, \ |
| 25 | the configuration file and the init script, and 'chronyc' which contains \ |
| 26 | the client program only." |
| 27 | |
| 28 | HOMEPAGE = "https://chrony.tuxfamily.org/" |
| 29 | SECTION = "net" |
| 30 | LICENSE = "GPLv2" |
| 31 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" |
| 32 | |
| 33 | SRC_URI = "https://download.tuxfamily.org/chrony/chrony-${PV}.tar.gz \ |
| 34 | file://chrony.conf \ |
| 35 | file://chronyd \ |
| 36 | file://arm_eabi.patch \ |
| 37 | " |
| 38 | |
| 39 | SRC_URI_append_libc-musl = " \ |
| 40 | file://0001-Fix-compilation-with-musl.patch \ |
| 41 | " |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 42 | SRC_URI[md5sum] = "5f66338bc940a9b51eede8f391e7bed3" |
| 43 | SRC_URI[sha256sum] = "4e02795b1260a4ec51e6ace84149036305cc9fc340e65edb9f8452aa611339b5" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 44 | |
| 45 | DEPENDS = "pps-tools" |
| 46 | |
| 47 | # Note: Despite being built via './configure; make; make install', |
| 48 | # chrony does not use GNU Autotools. |
| 49 | inherit update-rc.d systemd |
| 50 | |
| 51 | # Configuration options: |
| 52 | # - For command line editing support in chronyc, you may specify either |
| 53 | # 'editline' or 'readline' but not both. editline is smaller, but |
| 54 | # many systems already have readline for other purposes so you might want |
| 55 | # to choose that instead. However, beware license incompatibility |
| 56 | # since chrony is GPLv2 and readline versions after 6.0 are GPLv3+. |
| 57 | # You can of course choose neither, but if you're that tight on space |
| 58 | # consider dropping chronyc entirely (you can use it remotely with |
| 59 | # appropriate chrony.conf options). |
| 60 | # - Security-related: |
| 61 | # - 'sechash' is omitted by default because it pulls in nss which is huge. |
| 62 | # - 'privdrop' allows chronyd to run as non-root; would need changes to |
| 63 | # chrony.conf and init script. |
| 64 | # - 'scfilter' enables support for system call filtering, but requires the |
| 65 | # kernel to have CONFIG_SECCOMP enabled. |
| 66 | PACKAGECONFIG ??= "editline \ |
| 67 | ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ |
| 68 | " |
| 69 | PACKAGECONFIG[readline] = "--without-editline,--without-readline,readline" |
| 70 | PACKAGECONFIG[editline] = ",--without-editline,libedit" |
| 71 | PACKAGECONFIG[sechash] = "--without-tomcrypt,--disable-sechash,nss" |
| 72 | PACKAGECONFIG[privdrop] = ",--disable-privdrop,libcap" |
| 73 | PACKAGECONFIG[scfilter] = "--enable-scfilter,--without-seccomp,libseccomp" |
| 74 | PACKAGECONFIG[ipv6] = ",--disable-ipv6," |
| 75 | PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss" |
| 76 | PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap" |
| 77 | |
| 78 | # --disable-static isn't supported by chrony's configure script. |
| 79 | DISABLE_STATIC = "" |
| 80 | |
| 81 | do_configure() { |
| 82 | ./configure --sysconfdir=${sysconfdir} --bindir=${bindir} --sbindir=${sbindir} \ |
| 83 | --localstatedir=${localstatedir} --datarootdir=${datadir} \ |
| 84 | ${PACKAGECONFIG_CONFARGS} |
| 85 | } |
| 86 | |
| 87 | do_install() { |
| 88 | # Binaries |
| 89 | install -d ${D}${bindir} |
| 90 | install -m 0755 ${S}/chronyc ${D}${bindir} |
| 91 | install -d ${D}${sbindir} |
| 92 | install -m 0755 ${S}/chronyd ${D}${sbindir} |
| 93 | |
| 94 | # Config file |
| 95 | install -d ${D}${sysconfdir} |
| 96 | install -m 644 ${WORKDIR}/chrony.conf ${D}${sysconfdir} |
| 97 | |
| 98 | # System V init script |
| 99 | install -d ${D}${sysconfdir}/init.d |
| 100 | install -m 755 ${WORKDIR}/chronyd ${D}${sysconfdir}/init.d |
| 101 | |
| 102 | # systemd unit configuration file |
| 103 | install -d ${D}${systemd_unitdir}/system |
| 104 | install -m 0644 ${S}/examples/chronyd.service ${D}${systemd_unitdir}/system/ |
| 105 | |
| 106 | # Variable data (for drift and/or rtc file) |
| 107 | install -d ${D}${localstatedir}/lib/chrony |
| 108 | |
| 109 | # Log files |
| 110 | install -d ${D}${localstatedir}/log/chrony |
| 111 | |
| 112 | # Fix hard-coded paths in config files and init scripts |
| 113 | sed -i -e 's!/var/!${localstatedir}/!g' -e 's!/etc/!${sysconfdir}/!g' \ |
| 114 | -e 's!/usr/sbin/!${sbindir}/!g' -e 's!/usr/bin/!${bindir}/!g' \ |
| 115 | ${D}${sysconfdir}/chrony.conf \ |
| 116 | ${D}${sysconfdir}/init.d/chronyd \ |
| 117 | ${D}${systemd_unitdir}/system/chronyd.service |
| 118 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/chronyd |
| 119 | sed -i 's!^EnvironmentFile=.*!EnvironmentFile=-${sysconfdir}/default/chronyd!' ${D}${systemd_unitdir}/system/chronyd.service |
| 120 | } |
| 121 | |
| 122 | FILES_${PN} = "${sbindir}/chronyd ${sysconfdir} ${localstatedir}" |
| 123 | CONFFILES_${PN} = "${sysconfdir}/chrony.conf" |
| 124 | INITSCRIPT_NAME = "chronyd" |
| 125 | INITSCRIPT_PARAMS = "defaults" |
| 126 | SYSTEMD_PACKAGES = "${PN}" |
| 127 | SYSTEMD_SERVICE_${PN} = "chronyd.service" |
| 128 | |
| 129 | # It's probably a bad idea to run chrony and another time daemon on |
| 130 | # the same system. systemd includes the SNTP client 'timesyncd', which |
| 131 | # will be disabled by chronyd.service, however it will remain on the rootfs |
| 132 | # wasting 150 kB unless you put 'PACKAGECONFIG_remove_pn-systemd = "timesyncd"' |
| 133 | # in a conf file or bbappend somewhere. |
| 134 | RCONFLICTS_${PN} = "ntp ntimed" |
| 135 | |
| 136 | # Separate the client program into its own package |
| 137 | PACKAGES =+ "chronyc" |
| 138 | FILES_chronyc = "${bindir}/chronyc" |