summaryrefslogtreecommitdiffstats
path: root/meta-openembedded/meta-networking/recipes-support/lowpan-tools
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-networking/recipes-support/lowpan-tools')
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Fix-build-errors-with-clang.patch34
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Remove-newline-from-format-line.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch44
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-coordinator-Fix-strncpy-range-warning.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-src-iz.c-Undef-dprintf-before-redefining.patch27
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/no-help2man.patch41
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb36
7 files changed, 244 insertions, 0 deletions
diff --git a/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Fix-build-errors-with-clang.patch b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Fix-build-errors-with-clang.patch
new file mode 100644
index 000000000..8e906f7ce
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Fix-build-errors-with-clang.patch
@@ -0,0 +1,34 @@
+From 5f9e80acb0a1ac399839bf160e43f6120c4b5128 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 18 Oct 2016 23:49:09 +0000
+Subject: [PATCH] Fix build errors with clang
+
+| ../../../../../../../workspace/sources/lowpan-tools/src/coordinator.c:313:50: error: format specifies type 'unsigned char' but the argument has type 'int' [-Werror,-Wformat]
+| fprintf(stderr, "Opt: %c (%hhx)\n", (char)opt, opt);
+| ~~~~ ^~~
+| %x
+| 1 error generated.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/coordinator.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/coordinator.c b/src/coordinator.c
+index c139aae..f0de6d2 100644
+--- a/src/coordinator.c
++++ b/src/coordinator.c
+@@ -310,7 +310,7 @@ int main(int argc, char **argv)
+ #else
+ opt = getopt(argc, argv, "l:f:d:m:n:i:s:p:c:hv");
+ #endif
+- fprintf(stderr, "Opt: %c (%hhx)\n", opt, opt);
++ fprintf(stderr, "Opt: %c (%hhx)\n", opt, (unsigned char)opt);
+ if (opt == -1)
+ break;
+
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Remove-newline-from-format-line.patch b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Remove-newline-from-format-line.patch
new file mode 100644
index 000000000..1453b75d5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Remove-newline-from-format-line.patch
@@ -0,0 +1,32 @@
+From a36afac485745cf980fba1809526f2025cb4d101 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 23 Apr 2017 00:16:45 -0700
+Subject: [PATCH] Remove newline from format line
+
+Fixes
+
+error: '__builtin___snprintf_chk' output truncated before the last format character [-Werror=format-truncation=]
+ "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
+ ^
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ addrdb/addrdb.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/addrdb/addrdb.c b/addrdb/addrdb.c
+index 4bb7f79..05d53f3 100644
+--- a/addrdb/addrdb.c
++++ b/addrdb/addrdb.c
+@@ -178,7 +178,7 @@ int addrdb_dump_leases(const char *lease_file)
+ continue;
+ }
+ snprintf(hwaddr_buf, sizeof(hwaddr_buf),
+- "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
++ "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
+ lease->hwaddr[0], lease->hwaddr[1],
+ lease->hwaddr[2], lease->hwaddr[3],
+ lease->hwaddr[4], lease->hwaddr[5],
+--
+2.12.2
+
diff --git a/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch
new file mode 100644
index 000000000..0a81a2252
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch
@@ -0,0 +1,44 @@
+From ab725a3faaeead90ae3c63cbcd370af087c413a5 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Mon, 27 Mar 2017 17:55:06 -0700
+Subject: [PATCH] addrdb/coord-config-parse.y: add missing <time.h> include
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The %union definition uses the time_t structure. In order to use this
+structure, the <time.h> header has to be included. Otherwise, the build
+breaks with some C libraries, such as musl:
+
+In file included from coord-config-lex.l:23:0:
+coord-config-parse.y:107:2: error: unknown type name ‘time_t’
+ time_t timestamp;
+ ^
+
+This patch includes <time.h> using the '%code requires' directive of
+Yacc.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ addrdb/coord-config-parse.y | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/addrdb/coord-config-parse.y b/addrdb/coord-config-parse.y
+index 2e10a88..85ee058 100644
+--- a/addrdb/coord-config-parse.y
++++ b/addrdb/coord-config-parse.y
+@@ -102,6 +102,10 @@
+
+ %}
+
++%code requires {
++#include <time.h>
++}
++
+ %union {
+ unsigned long number;
+ time_t timestamp;
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-coordinator-Fix-strncpy-range-warning.patch b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-coordinator-Fix-strncpy-range-warning.patch
new file mode 100644
index 000000000..493832bb8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-coordinator-Fix-strncpy-range-warning.patch
@@ -0,0 +1,30 @@
+From f017353b8f3170ce79e7addc127056c0142f087b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 1 Apr 2018 14:31:05 -0700
+Subject: [PATCH] coordinator: Fix strncpy range warning
+
+Fixes
+error: 'strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/coordinator.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/coordinator.c b/src/coordinator.c
+index c139aae..ca49418 100644
+--- a/src/coordinator.c
++++ b/src/coordinator.c
+@@ -296,7 +296,8 @@ int main(int argc, char **argv)
+ if(!lease_file)
+ lease_file = LEASE_FILE;
+
+- strncpy(pname, argv[0], PATH_MAX);
++ strncpy(pname, argv[0], PATH_MAX - 1);
++ pname[PATH_MAX - 1] = '\0';
+
+ pid_file = getenv("PID_FILE");
+ if (!pid_file)
+--
+2.16.3
+
diff --git a/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-src-iz.c-Undef-dprintf-before-redefining.patch b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-src-iz.c-Undef-dprintf-before-redefining.patch
new file mode 100644
index 000000000..68393067d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-src-iz.c-Undef-dprintf-before-redefining.patch
@@ -0,0 +1,27 @@
+From ad088233608ba2205511da4f270f8ba29844b84c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 8 Apr 2017 09:02:02 -0700
+Subject: [PATCH] src/iz.c: Undef dprintf before redefining
+
+Clang is picky and warns about macros redefinition
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/iz.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/iz.c b/src/iz.c
+index 32be1a8..886f0a5 100644
+--- a/src/iz.c
++++ b/src/iz.c
+@@ -60,6 +60,7 @@ static int iz_seq = 0;
+ /* Parsed options */
+ static int iz_debug = 0;
+
++#undef dprintf
+ #define dprintf(lvl, fmt...) \
+ do { \
+ if (iz_debug >= lvl) \
+--
+2.12.2
+
diff --git a/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/no-help2man.patch b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/no-help2man.patch
new file mode 100644
index 000000000..9ecd707b4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/no-help2man.patch
@@ -0,0 +1,41 @@
+Disable building manpages so that make install doesn't fail due to lack of help2man
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 46c4017..d6ed312 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -9,11 +9,6 @@ izcoordinator_DESC = "simple coordinator for IEEE 802.15.4 network"
+ iz_DESC = "configure an IEEE 802.15.4 interface"
+ izchat_DESC = "simple chat program using IEEE 802.15.4"
+
+-if MANPAGES
+-dist_man_MANS = $(manpages)
+-endif
+-EXTRA_DIST = $(manpages)
+-
+ izattach_SOURCES = serial.c
+
+ iz_SOURCES = iz.c iz-common.c iz-mac.c iz-phy.c
+@@ -27,18 +22,6 @@ izcoordinator_LDADD = ../addrdb/libaddrdb.la $(LDADD) $(NL_LIBS) $(LEXLIB)
+ iz_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS) -D_GNU_SOURCE
+ iz_LDADD = $(LDADD) $(NL_LIBS)
+
+-izattach.8: $(izattach_SOURCES) $(top_srcdir)/configure.ac
+- -$(HELP2MAN) -o $@ -s 8 -N -n $(izattach_DESC) $(builddir)/izattach
+-
+-izcoordinator.8: $(izcoordinator_SOURCES) $(top_srcdir)/configure.ac
+- -$(HELP2MAN) -o $@ -s 8 -N -n $(izcoordinator_DESC) $(builddir)/izcoordinator
+-
+-iz.8: $(iz_SOURCES) $(top_srcdir)/configure.ac
+- -$(HELP2MAN) -o $@ -s 8 -N -n $(iz_DESC) $(builddir)/iz
+-
+-izchat.1: $(izchat_SOURCES) $(top_srcdir)/configure.ac
+- -$(HELP2MAN) -o $@ -s 1 -N -n $(izchat_DESC) $(builddir)/izchat
+-
+ install-data-hook:
+ $(mkinstalldirs) $(DESTDIR)`dirname $(leasefile)`
+ $(mkinstalldirs) $(DESTDIR)`dirname $(pidfile)`
diff --git a/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb
new file mode 100644
index 000000000..d0fe59c98
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Utilities for managing the Linux LoWPAN stack"
+DESCRIPTION = "This is a set of utils to manage the Linux LoWPAN stack. \
+The LoWPAN stack aims for IEEE 802.15.4-2003 (and for lesser extent IEEE 802.15.4-2006) compatibility."
+SECTION = "net"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+DEPENDS = "flex-native bison-native libnl python"
+
+PV = "0.3.1+git${SRCPV}"
+SRC_URI = "git://github.com/linux-wpan/lowpan-tools \
+ file://no-help2man.patch \
+ file://0001-Fix-build-errors-with-clang.patch \
+ file://0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch \
+ file://0001-src-iz.c-Undef-dprintf-before-redefining.patch \
+ file://0001-Remove-newline-from-format-line.patch \
+ file://0001-coordinator-Fix-strncpy-range-warning.patch \
+ "
+SRCREV = "1c2d8674cc6f4b1166a066e8822e295c105ae7a2"
+
+S = "${WORKDIR}/git"
+
+inherit autotools python-dir pkgconfig
+
+CACHED_CONFIGUREVARS += "am_cv_python_pythondir=${PYTHON_SITEPACKAGES_DIR}/lowpan-tools"
+
+CFLAGS += "-Wno-initializer-overrides"
+
+do_install_append() {
+ rmdir ${D}${localstatedir}/run
+}
+
+FILES_${PN}-dbg += "${libexecdir}/lowpan-tools/.debug/"
+
+PACKAGES =+ "${PN}-python"
+FILES_${PN}-python = "${libdir}/python*"
OpenPOWER on IntegriCloud