Chrony time synchronization (chronyc and chronyd)
PATCH 1/1 Chrony time synchronization (chronyc and chronyd)
---
Unfortunately this package uses a hand rolled set of build scripts. The maintainers are happy to add fixes to any problems but are not keen on moving over to autotools. I don't get the impression many people cross compile this one! That is a shame because it is very useful with wireless sensor nodes.
There are a few nasty tests in the configure script that may well cause problems in cross compiles when the host is not also linux based.
I will work on getting these fixed at source, but it may take a while hence submission of this recipe in the meantime.
The reason this is the git version is recent patches to ensure that the LDPATH variable was not ignored in linking.
This recipe includes some convenient scripts and blank config files needed to get it up and running easily.
recipes/chrony/chrony.conf | 7 +++++++ recipes/chrony/chrony.keys | 1 + recipes/chrony/chrony_git.bb | 35 +++++++++++++++++++++++++++++++++++ recipes/chrony/chrony_start.sh | 20 ++++++++++++++++++++ recipes/chrony/chrony_stop.sh | 20 ++++++++++++++++++++ recipes/chrony/init | 4 ++++ 6 files changed, 87 insertions(+), 0 deletions(-)
recipes/chrony/chrony.conf new file +7 -0
@@ -0,0 +1,7 @@ +server timeserver offline minpoll 2 maxpoll 2 +keyfile /etc/chrony.keys +commandkey 1 +initstepslew 0 timeserver +driftfile /etc/chrony.drift +dumpdir /var/log/chrony +dumponexit
recipes/chrony/chrony.keys new file +1 -0
@@ -0,0 +1 @@ +1 opensesame
recipes/chrony/chrony_git.bb new file +35 -0
@@ -0,0 +1,35 @@ +DESCRIPTION = "Chrony time synchronization" +LICENSE = "GPL" +CHRONY_REV="fe2cfe1faee10b3d972f79fe30b5c8ac09469409" +DEPENDS += "readline" +REDEPENDS += "readline" + +PV = "1.23+gitr${CHRONY_REV}" + +SRC_URI = "git://git.tuxfamily.org/gitroot/chrony/chrony.git;protocol=git;rev=${CHRONY_REV} \ + file://chrony_start.sh \ + file://chrony_stop.sh \ + file://init \ + file://chrony.conf \ + file://chrony.keys \ +" +S = "${WORKDIR}/git" + +do_configure() { + ${S}/configure +} + +do_compile() { + unset CPPFLAGS + oe_runmake +} + +do_install_append() { + install -d ${D}${sysconfdir}/init.d + install -m 0644 ${WORKDIR}/chrony.conf ${D}${sysconfdir}/ + install -m 0644 ${WORKDIR}/chrony.keys ${D}${sysconfdir}/ + install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/chronyd + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/chrony_start.sh ${D}${bindir} + install -m 0755 ${WORKDIR}/chrony_stop.sh ${D}${bindir} +}
recipes/chrony/chrony_start.sh new file +20 -0
@@ -0,0 +1,20 @@ +#! /bin/bash + +PROC=`ps | grep chronyd | grep -v grep`; + +if [ -n "$PROC" ]; then + + RESULT=`chronyc << ___EOF + password opensesame + online +___EOF` + + RESULT2=`echo $RESULT | grep OK` + if [ -n "$RESULT2" ]; then + echo 1 + else + echo 0; + fi +else + echo -1; +fi
recipes/chrony/chrony_stop.sh new file +20 -0
@@ -0,0 +1,20 @@ +#! /bin/bash + +PROC=`ps | grep chronyd | grep -v grep`; + +if [ -n "$PROC" ]; then + + RESULT=`chronyc << ___EOF + password opensesame + offline +___EOF` + + RESULT2=`echo $RESULT | grep OK` + if [ -n "$RESULT2" ]; then + echo 1 + else + echo 0; + fi +else + echo -1; +fi
recipes/chrony/init new file +4 -0
@@ -0,0 +1,4 @@ +if [ -f /usr/bin/chronyd -a -f /etc/chrony.conf ]; then + /usr/bin/chronyd + echo "Started chronyd" +fi
Signature · 1 line
1.6.4.4
Hello.
Quoted 12 lines · Jonathan Cameron
Signed-off-by Jonathan Cameron <[email protected]>---
Unfortunately this package uses a hand rolled set of build scripts. The maintainers are happy to add fixes to any problems but are not keen on moving over to autotools. I don't get the impression many people cross compile this one! That is a shame because it is very useful with wireless sensor nodes.There are a few nasty tests in the configure script that may well cause problems in cross compiles when the host is not also linux based.
Quoted 8 lines
I will work on getting these fixed at source, but it may take a while hence submission of this recipe in the meantime.
The reason this is the git version is recent patches to ensure that the LDPATH variable was not ignored in linking.
This recipe includes some convenient scripts and blank config files needed to get it up and running easily.
Applied and pushed. I have rewritten the subject line to be more like what we expect in OE. If you have progress on having a saner upstream build system we would appreciate if we could make this recipe a bit cleaner. Thanks.
regards
Stefan Schmidt