[Buildroot] [PATCH 3/7] package/bmx7: new package

Giulio Benetti giulio.benetti at benettiengineering.com
Fri Dec 10 14:52:55 UTC 2021


Hi José,

On 10/12/21 15:12, José Pekkarinen wrote:
> This patch will provide an initial package
> for bmx7 project.

Reword as previous patch

> Signed-off-by: José Pekkarinen <jose.pekkarinen at unikie.com>
> ---
>   DEVELOPERS                                    |  1 +
>   package/Config.in                             |  1 +
>   ...c-378-36-error-SIOCGSTAMP-undeclared.patch | 28 +++++++++++++++
>   package/bmx7/0002-Fix-linking-error.patch     | 29 +++++++++++++++
>   ...r-includes-to-avoid-ethhdr-collision.patch | 35 +++++++++++++++++++
>   package/bmx7/Config.in                        | 16 +++++++++
>   package/bmx7/bmx7.hash                        |  4 +++
>   package/bmx7/bmx7.mk                          | 23 ++++++++++++
>   8 files changed, 137 insertions(+)
>   create mode 100644 package/bmx7/0001-Fix-schedule.c-378-36-error-SIOCGSTAMP-undeclared.patch
>   create mode 100644 package/bmx7/0002-Fix-linking-error.patch
>   create mode 100644 package/bmx7/0003-Reorder-includes-to-avoid-ethhdr-collision.patch
>   create mode 100644 package/bmx7/Config.in
>   create mode 100644 package/bmx7/bmx7.hash
>   create mode 100644 package/bmx7/bmx7.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 65448a74c8..e3e48522aa 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1464,6 +1464,7 @@ F:	package/zfs/
>   F:	support/testing/tests/package/test_zfs.py
>   
>   N:	José Pekkarinen <jose.pekkarinen at unikie.com>
> +F:	package/bmx7/
>   F:	package/minijail/
>   F:	package/opensc/
>   F:	package/softhsm2/
> diff --git a/package/Config.in b/package/Config.in
> index aac8172fc4..55ba0ded13 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -2131,6 +2131,7 @@ menu "Networking applications"
>   	source "package/bluez-tools/Config.in"
>   	source "package/bluez5_utils/Config.in"
>   	source "package/bmon/Config.in"
> +	source "package/bmx7/Config.in"
>   	source "package/boinc/Config.in"
>   	source "package/brcm-patchram-plus/Config.in"
>   	source "package/bridge-utils/Config.in"
> diff --git a/package/bmx7/0001-Fix-schedule.c-378-36-error-SIOCGSTAMP-undeclared.patch b/package/bmx7/0001-Fix-schedule.c-378-36-error-SIOCGSTAMP-undeclared.patch
> new file mode 100644
> index 0000000000..d627cf6165
> --- /dev/null
> +++ b/package/bmx7/0001-Fix-schedule.c-378-36-error-SIOCGSTAMP-undeclared.patch
> @@ -0,0 +1,28 @@
> +From f16fa9796e05ca9ea6ee764b3c1f0b8baed535e8 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen at unikie.com>
> +Date: Fri, 10 Dec 2021 14:35:45 +0200
> +Subject: [PATCH] Fix schedule.c:378:36: error: 'SIOCGSTAMP' undeclared
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +

Add commit log

> +Signed-off-by: José Pekkarinen <jose.pekkarinen at unikie.com>
> +---
> + src/schedule.c | 1 +
> + 1 file changed, 1 insertion(+)
> +
> +diff --git a/src/schedule.c b/src/schedule.c
> +index 8868b01..09ab248 100644
> +--- a/src/schedule.c
> ++++ b/src/schedule.c
> +@@ -23,6 +23,7 @@
> + #include <fcntl.h>
> + #include <sys/ioctl.h>
> + #include <sys/socket.h>
> ++#include <linux/sockios.h>
> +
> +
> + #include "list.h"
> +--
> +2.30.2
> +
> diff --git a/package/bmx7/0002-Fix-linking-error.patch b/package/bmx7/0002-Fix-linking-error.patch
> new file mode 100644
> index 0000000000..04354c6a0a
> --- /dev/null
> +++ b/package/bmx7/0002-Fix-linking-error.patch
> @@ -0,0 +1,29 @@
> +From 974541b80bf8d7ec78ed9214a1b541957670f9cd Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen at unikie.com>
> +Date: Fri, 10 Dec 2021 14:36:55 +0200
> +Subject: [PATCH] Fix linking error
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +

Ditto

> +Signed-off-by: José Pekkarinen <jose.pekkarinen at unikie.com>
> +---
> + src/bmx.h | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/src/bmx.h b/src/bmx.h
> +index 4269903..7789f7f 100644
> +--- a/src/bmx.h
> ++++ b/src/bmx.h
> +@@ -290,7 +290,7 @@ enum ADGSN {
> + #define SUCCESS 0
> + #define FAILURE -1
> +
> +-const void* FAILURE_PTR;
> ++extern const void* FAILURE_PTR;
> +
> +
> + #define MAX_SELECT_TIMEOUT_MS 1100 /* MUST be smaller than (1000/2) to fit into max tv_usec */
> +--
> +2.30.2
> +
> diff --git a/package/bmx7/0003-Reorder-includes-to-avoid-ethhdr-collision.patch b/package/bmx7/0003-Reorder-includes-to-avoid-ethhdr-collision.patch
> new file mode 100644
> index 0000000000..75cc392513
> --- /dev/null
> +++ b/package/bmx7/0003-Reorder-includes-to-avoid-ethhdr-collision.patch
> @@ -0,0 +1,35 @@
> +From fc13da06c1de4d085e21dc2bf45e1e95eb6145d9 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen at unikie.com>
> +Date: Fri, 10 Dec 2021 14:37:37 +0200
> +Subject: [PATCH] Reorder includes to avoid ethhdr collision
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +

Ditto

> +Signed-off-by: José Pekkarinen <jose.pekkarinen at unikie.com>
> +---
> + src/ip.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/src/ip.c b/src/ip.c
> +index cd50074..4198e92 100644
> +--- a/src/ip.c
> ++++ b/src/ip.c
> +@@ -43,13 +43,13 @@
> + #include <net/if_arp.h>
> + #include <linux/if_tunnel.h>
> +
> +-#include <linux/if_tun.h> /* TUNSETPERSIST, ... */
> + #include <linux/ip6_tunnel.h>
> +
> + #ifndef BMX7_LIB_IWINFO
> + #define BMX7_LIB_IW
> + #include <iwlib.h>
> + #endif
> ++#include <linux/if_tun.h> /* TUNSETPERSIST, ... */
> + //#include <iwlib.h>
> + // apt-get install libiw-dev
> + //#include <math.h>
> +--
> +2.30.2
> +
> diff --git a/package/bmx7/Config.in b/package/bmx7/Config.in
> new file mode 100644
> index 0000000000..3c13c047e9
> --- /dev/null
> +++ b/package/bmx7/Config.in
> @@ -0,0 +1,16 @@
> +config BR2_PACKAGE_BMX7
> +	bool "bmx7"
> +	depends on !BR2_STATIC_LIBS # dlopen()
> +	select BR2_PACKAGE_ZLIB
> +	select BR2_PACKAGE_LIBZLIB

Does it specifically need libzlib? Or is it ok with zlib-ng too?
If so please remove the line above.

> +	select BR2_PACKAGE_MBEDTLS
> +	select BR2_PACKAGE_WIRELESS_TOOLS
> +	select BR2_PACKAGE_WIRELESS_TOOLS_LIB
> +	help
> +	  BMX7 is a mesh routing protocol for Linux based
> +	  operating systems.
> +
> +	  https://github.com/bmx-routing/bmx7
> +
> +comment "bmx7 needs a toolchain with dynamic library support"
> +	depends on BR2_STATIC_LIBS
> diff --git a/package/bmx7/bmx7.hash b/package/bmx7/bmx7.hash
> new file mode 100644
> index 0000000000..018de1b6ae
> --- /dev/null
> +++ b/package/bmx7/bmx7.hash
> @@ -0,0 +1,4 @@
> +# From https://github.com/bmx-routing/bmx7/archive/refs/tags
> +sha256  5f88df1c95e5cb842a6016bb1604e3e7f6097c63c5c9916edc3c84e96d4f5f65  v7.1.1.tar.gz
> +# Locally computed
> +sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  LICENSE
> diff --git a/package/bmx7/bmx7.mk b/package/bmx7/bmx7.mk
> new file mode 100644
> index 0000000000..58b0044aec
> --- /dev/null
> +++ b/package/bmx7/bmx7.mk
> @@ -0,0 +1,23 @@
> +################################################################################
> +#
> +# bmx7
> +#
> +################################################################################
> +
> +BMX7_VERSION = v7.1.1
> +BMX7_SOURCE = $(BMX7_VERSION).tar.gz
> +BMX7_SITE = https://github.com/bmx-routing/bmx7/archive/refs/tags
> +BMX7_LICENSE = GPL-2
> +BMX7_LICENSE_FILES = LICENSE
> +BMX7_DEPENDENCIES = zlib mbedtls wireless_tools
> +
> +define BMX7_BUILD_CMDS
> +	(cd $(@D); \
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/$(d)/src CC="$(TARGET_CC)")
> +endef
> +
> +define BMX7_INSTALL_TARGET_CMDS
> +	$(INSTALL) -m 0755 -D $(@D)/src/bmx7 $(TARGET_DIR)/usr/bin/bmx7
> +endef
> +
> +$(eval $(generic-package))
> 

Best regards
-- 
Giulio Benetti
Benetti Engineering sas



More information about the buildroot mailing list