| Submitter | Kelvin Lawson |
|---|---|
| Date | Feb. 15, 2012, 12:34 a.m. |
| Message ID | <CAO-TFnG+O4F8-Kiu8DK1SHR3Caz4xF-AJdHZouPrgv6fqw31NA@mail.gmail.com> |
| Download | mbox | patch |
| Permalink | /patch/21277/ |
| State | New, archived |
| Headers | show |
Comments
Dear Kelvin, thank you for the patch. Am Mittwoch, den 15.02.2012, 00:34 +0000 schrieb Kelvin Lawson: You pasted the summary line twice. Also please add the ID to the commit message. > * Also includes a Makefile fix to reorder the linker parameters. > Signed-off-by: Kelvin Lawson <kelvinl@users.sf.net> > --- > meta-oe/recipes-connectivity/ntpclient/files/init | 42 +++++++++++++++++ > .../ntpclient/files/ntpclient-link.patch | 12 +++++ > .../ntpclient/ntpclient_2010_365.bb | 47 ++++++++++++++++++++ > 3 files changed, 101 insertions(+), 0 deletions(-) > create mode 100644 meta-oe/recipes-connectivity/ntpclient/files/init > create mode 100644 > meta-oe/recipes-connectivity/ntpclient/files/ntpclient-link.patch The patch is mangled. > create mode 100644 meta-oe/recipes-connectivity/ntpclient/ntpclient_2010_365.bb > > diff --git a/meta-oe/recipes-connectivity/ntpclient/files/init > b/meta-oe/recipes-connectivity/ntpclient/files/init > new file mode 100644 > index 0000000..7b85902 > --- /dev/null > +++ b/meta-oe/recipes-connectivity/ntpclient/files/init > @@ -0,0 +1,42 @@ > +#! /bin/sh > +# > +# This is an init script for openembedded > +# Copy it to /etc/init.d/ntpclient and type > +# > update-rc.d ntpclient defaults 60 > +# > +ntpclient=/sbin/ntpclient > +test -x "$ntpclient" || exit 0 > +# Seconds Between Time Checks > +ntpinterval=600 > +# Upstream NTP Server Name > +ntpserver=pool.ntp.org > + > +case "$1" in > + start) > + echo -n "Starting NTP Client" > + start-stop-daemon --start --quiet --background --make-pidfile > --pidfile /var/run/ntpclient.pid --exec $ntpclient -- -l -i > $ntpinterval -h $ntpserver > + echo "." > + ;; > + stop) > + echo -n "Stopping NTP Client" > + start-stop-daemon --stop --quiet --pidfile /var/run/ntpclient.pid > + echo "." > + ;; > + reload|force-reload) > + start-stop-daemon --stop --quiet --signal 1 --exec $ntpclient > + ;; > + restart) > + echo -n "Stopping NTP Client" > + start-stop-daemon --stop --quiet --pidfile /var/run/ntpclient.pid > + echo "." > + sleep 1 > + echo -n "Starting NTP Client" > + start-stop-daemon --start --quiet --background --make-pidfile > --pidfile /var/run/ntpclient.pid --exec $ntpclient -- -l -i > $ntpinterval -h $ntpserver > + echo "." > + ;; > + *) > + echo "Usage: /etc/init.d/ntpclient > {start|stop|reload|restart|force-reload}" > + exit 1 > +esac > + > +exit 0 > diff --git a/meta-oe/recipes-connectivity/ntpclient/files/ntpclient-link.patch > b/meta-oe/recipes-connectivity/ntpclient/files/ntpclient-link.patch > new file mode 100644 > index 0000000..b95fc24 > --- /dev/null > +++ b/meta-oe/recipes-connectivity/ntpclient/files/ntpclient-link.patch > @@ -0,0 +1,12 @@ Please add a patch header as demanded in the commit and patch message guide lines. Also add what the error is please and describe the fix. > +diff -Naur ntpclient-2010/Makefile ntpclient-2010-patched/Makefile > +--- ntpclient-2010/Makefile 2010-12-28 06:26:36.000000000 +0000 > ++++ ntpclient-2010-patched/Makefile 2012-01-31 00:55:36.000000000 +0000 > +@@ -19,7 +19,7 @@ > + CFLAGS += -DENABLE_REPLAY > + # CFLAGS += -DUSE_OBSOLETE_GETTIMEOFDAY > + > +-LDFLAGS += -lrt > ++LDLIBS += -lrt > + > + all: ntpclient > + > diff --git a/meta-oe/recipes-connectivity/ntpclient/ntpclient_2010_365.bb > b/meta-oe/recipes-connectivity/ntpclient/ntpclient_2010_365.bb > new file mode 100644 > index 0000000..0ee7230 > --- /dev/null > +++ b/meta-oe/recipes-connectivity/ntpclient/ntpclient_2010_365.bb > @@ -0,0 +1,47 @@ > +DESCRIPTION = "NTP (RFC-1305) client for unix-alike computers" > +HOMEPAGE = "http://doolittle.icarus.com/ntpclient" That URL does not work for me. Please fix this up in a follow up patch. > +AUTHOR = "Larry Doolittle <larry@doolittle.boa.org>" > +RDEPENDS_${PN} = "busybox" > +SECTION = "admin" > +LICENSE = "GPLv2" > +LIC_FILES_CHKSUM = > "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" > +PR = "r0" > +# The ntpclient package uses version numbers that include an underscore :( > +PV = "2010_365" > +# ntpclient unpacks into a directory that doesn't include version info :( > +S = "${WORKDIR}/${PN}-2010" > + > +SRC_URI = "http://doolittle.icarus.com/ntpclient/ntpclient_${PV}.tar.gz \ > + file://ntpclient-link.patch \ > + file://init \ > + " > + > +INITSCRIPT_NAME = "ntpclient" > +INITSCRIPT_PARAMS = "defaults 65" > +inherit update-rc.d > + > +LDFLAGS += " -lrt " I guess your patch makes that obsolete? > + > +do_compile() { > + oe_runmake ntpclient > + oe_runmake adjtimex > +} > + > +do_install () { > + # Install the binary and tools > + install -D -m 0755 ${S}/ntpclient ${D}${base_sbindir}/ntpclient > + install -D -m 0755 ${S}/adjtimex ${D}${base_sbindir}/adjtimex.${PN} > + install -D -m 0755 ${S}/rate.awk ${D}${sbindir}/ntpclient-drift-rate.awk > + install -D -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/ntpclient > +} > + > +pkg_postinst_${PN} () { > + update-alternatives --install ${base_sbindir}/adjtimex adjtimex > adjtimex.${PN} 100 > +} > + > +pkg_prerm_${PN} () { > + update-alternatives --remove adjtimex adjtimex.${PN} > +} > + > +SRC_URI[md5sum] = "a64689398f2df8933ee0d8da246e9eaa" > +SRC_URI[sha256sum] = > "9ad9b028385082fb804167f464e2db0a0b3d33780acd399327e64898b8fcfddd" It would be great if you could send to patches. One which imports it and another one fixing up the errors. Thanks, Paul
Patch
diff --git a/meta-oe/recipes-connectivity/ntpclient/files/init b/meta-oe/recipes-connectivity/ntpclient/files/init new file mode 100644 index 0000000..7b85902 --- /dev/null +++ b/meta-oe/recipes-connectivity/ntpclient/files/init @@ -0,0 +1,42 @@ +#! /bin/sh +# +# This is an init script for openembedded +# Copy it to /etc/init.d/ntpclient and type +# > update-rc.d ntpclient defaults 60 +# +ntpclient=/sbin/ntpclient +test -x "$ntpclient" || exit 0 +# Seconds Between Time Checks +ntpinterval=600 +# Upstream NTP Server Name +ntpserver=pool.ntp.org + +case "$1" in + start) + echo -n "Starting NTP Client" + start-stop-daemon --start --quiet --background --make-pidfile --pidfile /var/run/ntpclient.pid --exec $ntpclient -- -l -i $ntpinterval -h $ntpserver + echo "." + ;; + stop) + echo -n "Stopping NTP Client" + start-stop-daemon --stop --quiet --pidfile /var/run/ntpclient.pid + echo "." + ;; + reload|force-reload) + start-stop-daemon --stop --quiet --signal 1 --exec $ntpclient + ;; + restart) + echo -n "Stopping NTP Client" + start-stop-daemon --stop --quiet --pidfile /var/run/ntpclient.pid + echo "." + sleep 1 + echo -n "Starting NTP Client" + start-stop-daemon --start --quiet --background --make-pidfile --pidfile /var/run/ntpclient.pid --exec $ntpclient -- -l -i $ntpinterval -h $ntpserver + echo "." + ;; + *) + echo "Usage: /etc/init.d/ntpclient {start|stop|reload|restart|force-reload}" + exit 1 +esac + +exit 0 diff --git a/meta-oe/recipes-connectivity/ntpclient/files/ntpclient-link.patch b/meta-oe/recipes-connectivity/ntpclient/files/ntpclient-link.patch new file mode 100644 index 0000000..b95fc24 --- /dev/null +++ b/meta-oe/recipes-connectivity/ntpclient/files/ntpclient-link.patch @@ -0,0 +1,12 @@ +diff -Naur ntpclient-2010/Makefile ntpclient-2010-patched/Makefile +--- ntpclient-2010/Makefile 2010-12-28 06:26:36.000000000 +0000 ++++ ntpclient-2010-patched/Makefile 2012-01-31 00:55:36.000000000 +0000 +@@ -19,7 +19,7 @@ + CFLAGS += -DENABLE_REPLAY + # CFLAGS += -DUSE_OBSOLETE_GETTIMEOFDAY + +-LDFLAGS += -lrt ++LDLIBS += -lrt + + all: ntpclient + diff --git a/meta-oe/recipes-connectivity/ntpclient/ntpclient_2010_365.bb b/meta-oe/recipes-connectivity/ntpclient/ntpclient_2010_365.bb new file mode 100644 index 0000000..0ee7230 --- /dev/null +++ b/meta-oe/recipes-connectivity/ntpclient/ntpclient_2010_365.bb @@ -0,0 +1,47 @@ +DESCRIPTION = "NTP (RFC-1305) client for unix-alike computers" +HOMEPAGE = "http://doolittle.icarus.com/ntpclient" +AUTHOR = "Larry Doolittle <larry@doolittle.boa.org>" +RDEPENDS_${PN} = "busybox" +SECTION = "admin" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" +PR = "r0" +# The ntpclient package uses version numbers that include an underscore :( +PV = "2010_365" +# ntpclient unpacks into a directory that doesn't include version info :( +S = "${WORKDIR}/${PN}-2010" + +SRC_URI = "http://doolittle.icarus.com/ntpclient/ntpclient_${PV}.tar.gz \ + file://ntpclient-link.patch \ + file://init \ + " + +INITSCRIPT_NAME = "ntpclient" +INITSCRIPT_PARAMS = "defaults 65" +inherit update-rc.d + +LDFLAGS += " -lrt " + +do_compile() { + oe_runmake ntpclient + oe_runmake adjtimex +} + +do_install () { + # Install the binary and tools + install -D -m 0755 ${S}/ntpclient ${D}${base_sbindir}/ntpclient + install -D -m 0755 ${S}/adjtimex ${D}${base_sbindir}/adjtimex.${PN} + install -D -m 0755 ${S}/rate.awk ${D}${sbindir}/ntpclient-drift-rate.awk + install -D -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/ntpclient +} + +pkg_postinst_${PN} () { + update-alternatives --install ${base_sbindir}/adjtimex adjtimex adjtimex.${PN} 100 +} + +pkg_prerm_${PN} () { + update-alternatives --remove adjtimex adjtimex.${PN} +} +
* Also includes a Makefile fix to reorder the linker parameters. Signed-off-by: Kelvin Lawson <kelvinl@users.sf.net> --- meta-oe/recipes-connectivity/ntpclient/files/init | 42 +++++++++++++++++ .../ntpclient/files/ntpclient-link.patch | 12 +++++ .../ntpclient/ntpclient_2010_365.bb | 47 ++++++++++++++++++++ 3 files changed, 101 insertions(+), 0 deletions(-) create mode 100644 meta-oe/recipes-connectivity/ntpclient/files/init create mode 100644 meta-oe/recipes-connectivity/ntpclient/files/ntpclient-link.patch create mode 100644 meta-oe/recipes-connectivity/ntpclient/ntpclient_2010_365.bb +SRC_URI[md5sum] = "a64689398f2df8933ee0d8da246e9eaa" +SRC_URI[sha256sum] = "9ad9b028385082fb804167f464e2db0a0b3d33780acd399327e64898b8fcfddd"