All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/7] package/opensc: new package
@ 2021-12-10 14:12 José Pekkarinen
  2021-12-10 14:12 ` [Buildroot] [PATCH 2/7] package/minijail: " José Pekkarinen
                   ` (7 more replies)
  0 siblings, 8 replies; 39+ messages in thread
From: José Pekkarinen @ 2021-12-10 14:12 UTC (permalink / raw)
  To: buildroot; +Cc: José Pekkarinen

The patch will add a basic opensc package to build
on buildroot.

Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
---
 DEVELOPERS                                    |   1 +
 package/Config.in                             |   1 +
 .../0001-Fix-maybe-uninitialized-errors.patch |  81 ++++++++++
 ...x-strict-aliasing-warnings-as-errors.patch | 150 ++++++++++++++++++
 package/opensc/Config.in                      |  11 ++
 package/opensc/opensc.hash                    |   5 +
 package/opensc/opensc.mk                      |  14 ++
 7 files changed, 263 insertions(+)
 create mode 100644 package/opensc/0001-Fix-maybe-uninitialized-errors.patch
 create mode 100644 package/opensc/0002-Fix-strict-aliasing-warnings-as-errors.patch
 create mode 100644 package/opensc/Config.in
 create mode 100644 package/opensc/opensc.hash
 create mode 100644 package/opensc/opensc.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 3023526427..854f6f2084 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@unikie.com>
+F:	package/opensc/
 F:	package/softhsm2/
 
 N:	Joseph Kogut <joseph.kogut@gmail.com>
diff --git a/package/Config.in b/package/Config.in
index 57208309c4..b5907d7fa3 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1620,6 +1620,7 @@ menu "Hardware handling"
 	source "package/mtdev/Config.in"
 	source "package/ne10/Config.in"
 	source "package/neardal/Config.in"
+	source "package/opensc/Config.in"
 	source "package/owfs/Config.in"
 	source "package/pcsc-lite/Config.in"
 	source "package/rpi-rgb-led-matrix/Config.in"
diff --git a/package/opensc/0001-Fix-maybe-uninitialized-errors.patch b/package/opensc/0001-Fix-maybe-uninitialized-errors.patch
new file mode 100644
index 0000000000..17ef43a984
--- /dev/null
+++ b/package/opensc/0001-Fix-maybe-uninitialized-errors.patch
@@ -0,0 +1,81 @@
+From b74a624f21db3bfd45e0cb6ed017ceda9f29adfc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen@unikie.com>
+Date: Fri, 10 Dec 2021 13:54:26 +0200
+Subject: [PATCH] Fix maybe uninitialized errors
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
+---
+ src/libopensc/pkcs15-coolkey.c  | 12 ++++++------
+ src/pkcs15init/pkcs15-asepcos.c |  2 +-
+ src/tools/opensc-explorer.c     |  2 +-
+ 3 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/src/libopensc/pkcs15-coolkey.c b/src/libopensc/pkcs15-coolkey.c
+index 586475d..32a7674 100644
+--- a/src/libopensc/pkcs15-coolkey.c
++++ b/src/libopensc/pkcs15-coolkey.c
+@@ -147,9 +147,9 @@ coolkey_find_matching_cert(sc_card_t *card, sc_cardctl_coolkey_object_t *in_obj,
+ static int
+ coolkey_get_attribute_ulong(sc_card_t *card, sc_cardctl_coolkey_object_t *obj, CK_ATTRIBUTE_TYPE type, CK_ULONG *value)
+ {
+-	const u8 *val;
+-	size_t val_len;
+-	u8 data_type;
++	const u8 *val = malloc(sizeof(u8));
++	size_t val_len = 0;
++	u8 data_type = 0;
+ 	int r;
+ 
+ 	r  = coolkey_get_attribute(card, obj, type, &val, &val_len, &data_type);
+@@ -168,8 +168,8 @@ static int
+ coolkey_get_attribute_boolean(sc_card_t *card, sc_cardctl_coolkey_object_t *obj, CK_ATTRIBUTE_TYPE attr_type)
+ {
+ 	int r;
+-	const u8 *val;
+-	size_t val_len;
++	const u8 *val = malloc(sizeof(u8));
++	size_t val_len = 0;
+ 
+ 	r = coolkey_get_attribute(card, obj, attr_type, &val, &val_len, NULL);
+ 	if (r < 0) {
+@@ -186,7 +186,7 @@ static int
+ coolkey_get_attribute_bytes(sc_card_t *card, sc_cardctl_coolkey_object_t *obj, CK_ATTRIBUTE_TYPE type, u8 *data, size_t *data_len, size_t max_data_len)
+ {
+ 	const u8 *val;
+-	size_t val_len;
++	size_t val_len = 0;
+ 	int r;
+ 
+ 	r = coolkey_get_attribute(card, obj, type, &val, &val_len, NULL);
+diff --git a/src/pkcs15init/pkcs15-asepcos.c b/src/pkcs15init/pkcs15-asepcos.c
+index d712201..bc0efb5 100644
+--- a/src/pkcs15init/pkcs15-asepcos.c
++++ b/src/pkcs15init/pkcs15-asepcos.c
+@@ -221,7 +221,7 @@ static int asepcos_do_store_pin(sc_profile_t *profile, sc_card_t *card,
+ {
+ 	sc_file_t *nfile = NULL;
+ 	u8  buf[64], sbuf[64], *p = buf, *q = sbuf;
+-	int r, akn;
++	int r, akn = 0;
+ 
+ 	if (auth_info->auth_type != SC_PKCS15_PIN_AUTH_TYPE_PIN)
+ 		return SC_ERROR_OBJECT_NOT_VALID;
+diff --git a/src/tools/opensc-explorer.c b/src/tools/opensc-explorer.c
+index d251495..749b163 100644
+--- a/src/tools/opensc-explorer.c
++++ b/src/tools/opensc-explorer.c
+@@ -2472,7 +2472,7 @@ int main(int argc, char *argv[])
+ 		char *line;
+ 		int cargc;
+ 		char *cargv[260];
+-		int multiple;
++		int multiple = 0;
+ 		struct command *cmd;
+ 		char prompt[3*SC_MAX_PATH_STRING_SIZE];
+ 
+-- 
+2.30.2
+
diff --git a/package/opensc/0002-Fix-strict-aliasing-warnings-as-errors.patch b/package/opensc/0002-Fix-strict-aliasing-warnings-as-errors.patch
new file mode 100644
index 0000000000..24cd1ff137
--- /dev/null
+++ b/package/opensc/0002-Fix-strict-aliasing-warnings-as-errors.patch
@@ -0,0 +1,150 @@
+From 5bb64ae9305bbe20bbf2f95dfdddb0966d7c9a50 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen@unikie.com>
+Date: Fri, 10 Dec 2021 13:56:22 +0200
+Subject: [PATCH] Fix strict aliasing warnings as errors
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
+---
+ src/libopensc/card-gids.c | 20 ++++++++++++--------
+ src/libopensc/card-gpk.c  | 11 ++++++-----
+ src/tools/gids-tool.c     |  3 ++-
+ 3 files changed, 20 insertions(+), 14 deletions(-)
+
+diff --git a/src/libopensc/card-gids.c b/src/libopensc/card-gids.c
+index f25e37d..17901cd 100644
+--- a/src/libopensc/card-gids.c
++++ b/src/libopensc/card-gids.c
+@@ -691,7 +691,8 @@ static int gids_finish(sc_card_t *card)
+ // the cmap file is used to detect the key algorithm / size
+ static int gids_get_crypto_identifier_from_key_ref(sc_card_t *card, const unsigned char keyref, unsigned char *cryptoidentifier) {
+ 	struct gids_private_data *data = (struct gids_private_data *) card->drv_data;
+-	PCONTAINER_MAP_RECORD records = (PCONTAINER_MAP_RECORD) data->cmapfile;
++	PCONTAINER_MAP_RECORD records = malloc(sizeof(CONTAINER_MAP_RECORD));
++	memcpy(records, data->cmapfile, sizeof(CONTAINER_MAP_RECORD));
+ 	int recordsnum = (int) (data->cmapfilesize / sizeof(CONTAINER_MAP_RECORD));
+ 	int index = keyref - GIDS_FIRST_KEY_IDENTIFIER;
+ 	if (index >= recordsnum) {
+@@ -1112,10 +1113,10 @@ gids_get_all_containers(sc_card_t* card, size_t *recordsnum) {
+ // return the detail about a container to emulate a pkcs15 card
+ static int
+ gids_get_container_detail(sc_card_t* card, sc_cardctl_gids_get_container_t* container) {
+-	PCONTAINER_MAP_RECORD records = NULL;
++	PCONTAINER_MAP_RECORD records = malloc(sizeof(CONTAINER_MAP_RECORD));
+ 	struct gids_private_data *privatedata = (struct gids_private_data *) card->drv_data;
+ 	size_t recordsnum, num, i;
+-	records = (PCONTAINER_MAP_RECORD) privatedata ->cmapfile;
++	memcpy(records, privatedata->cmapfile, sizeof(CONTAINER_MAP_RECORD));
+ 	recordsnum = (privatedata ->cmapfilesize / sizeof(CONTAINER_MAP_RECORD));
+ 
+ 	num = container->containernum ;
+@@ -1158,7 +1159,8 @@ gids_get_container_detail(sc_card_t* card, sc_cardctl_gids_get_container_t* cont
+ static int
+ gids_select_key_reference(sc_card_t *card, sc_pkcs15_prkey_info_t* key_info) {
+ 	struct gids_private_data *data = (struct gids_private_data *) card->drv_data;
+-	PCONTAINER_MAP_RECORD records = (PCONTAINER_MAP_RECORD) data->cmapfile;
++	PCONTAINER_MAP_RECORD records = malloc(sizeof(CONTAINER_MAP_RECORD));
++	memcpy(records, data->cmapfile, sizeof(CONTAINER_MAP_RECORD));
+ 	size_t recordsnum;
+ 	int r;
+ 	char ch_tmp[10];
+@@ -1302,7 +1304,8 @@ static int gids_create_keyfile(sc_card_t *card, sc_pkcs15_object_t *object) {
+ 	struct gids_private_data *data = (struct gids_private_data *) card->drv_data;
+ 	size_t recordnum;
+ 	size_t containernum = key_info->key_reference - GIDS_FIRST_KEY_IDENTIFIER;
+-	PCONTAINER_MAP_RECORD records = ((PCONTAINER_MAP_RECORD) cmapbuffer) + containernum;
++	PCONTAINER_MAP_RECORD records = malloc(sizeof(CONTAINER_MAP_RECORD));
++	memcpy(records, cmapbuffer + containernum, sizeof(CONTAINER_MAP_RECORD));
+ 	struct gids_keymap_record* keymaprecord = NULL;
+ 	int i;
+ 
+@@ -1390,12 +1393,12 @@ static int gids_create_keyfile(sc_card_t *card, sc_pkcs15_object_t *object) {
+ 
+ 	// convert char to wchar
+ 	for(i = 0; i < MAX_CONTAINER_NAME_LEN && object->label[i]; i++) {
+-		records->wszGuid[i] = object->label[i];
++		records->wszGuid[i] = (unsigned short) object->label[i];
+ 	}
+ 
+ 	// TODO: check if a container with the same name already exists and prevent is creation or change its name
+ 
+-	records->bFlags = CONTAINER_MAP_VALID_CONTAINER;
++	records->bFlags = (unsigned char) CONTAINER_MAP_VALID_CONTAINER;
+ 	if (recordnum == 0) {
+ 		records->bFlags |= CONTAINER_MAP_DEFAULT_CONTAINER;
+ 	}
+@@ -1638,7 +1641,8 @@ static int gids_delete_container_num(sc_card_t *card, size_t containernum) {
+ 	size_t keymaprecordnum = 0;
+ 	struct gids_private_data *data = (struct gids_private_data *) card->drv_data;
+ 	size_t recordnum;
+-	PCONTAINER_MAP_RECORD records = ((PCONTAINER_MAP_RECORD) cmapbuffer) + containernum;
++	PCONTAINER_MAP_RECORD records = malloc(sizeof(CONTAINER_MAP_RECORD));
++	memcpy(records, cmapbuffer + containernum, sizeof(CONTAINER_MAP_RECORD));
+ 	struct gids_keymap_record* keymaprecord = NULL;
+ 
+ 	SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
+diff --git a/src/libopensc/card-gpk.c b/src/libopensc/card-gpk.c
+index 983ab5b..8afb0ee 100644
+--- a/src/libopensc/card-gpk.c
++++ b/src/libopensc/card-gpk.c
+@@ -228,11 +228,12 @@ static int
+ match_path(sc_card_t *card, unsigned short int **pathptr, size_t *pathlen,
+ 		int need_info)
+ {
+-	unsigned short int	*curptr, *ptr;
++	u8			*curptr;
++	unsigned short int	*ptr;
+ 	size_t		curlen, len;
+ 	size_t		i;
+ 
+-	curptr = (unsigned short int *) card->cache.current_path.value;
++	curptr = (u8 *) card->cache.current_path.value;
+ 	curlen = card->cache.current_path.len;
+ 	ptr    = *pathptr;
+ 	len    = *pathlen;
+@@ -242,7 +243,7 @@ match_path(sc_card_t *card, unsigned short int **pathptr, size_t *pathlen,
+ 
+ 	/* Make sure path starts with MF.
+ 	 * Note the cached path should always begin with MF. */
+-	if (ptr[0] != GPK_FID_MF || curptr[0] != GPK_FID_MF)
++	if (ptr[0] != (GPK_FID_MF >> 8) || curptr[0] != (GPK_FID_MF >> 8))
+ 		return 0;
+ 
+ 	for (i = 1; i < len && i < curlen; i++) {
+@@ -545,7 +546,7 @@ gpk_select_id(sc_card_t *card, int kind, unsigned int fid,
+ 	/* Fix up the path cache.
+ 	 * NB we never cache the ID of an EF, just the DF path */
+ 	if (r == 0) {
+-		unsigned short int	*path;
++		u8	*path;
+ 
+ 		switch (kind) {
+ 		case GPK_SEL_MF:
+@@ -555,7 +556,7 @@ gpk_select_id(sc_card_t *card, int kind, unsigned int fid,
+ 			if (cp->len + 1 > SC_MAX_PATH_SIZE / 2) {
+ 				return SC_ERROR_INTERNAL;
+ 			}
+-			path = (unsigned short int *) cp->value;
++			path = (u8 *) cp->value;
+ 			path[cp->len++] = fid;
+ 		}
+ 	} else {
+diff --git a/src/tools/gids-tool.c b/src/tools/gids-tool.c
+index 1c9602b..eed4296 100644
+--- a/src/tools/gids-tool.c
++++ b/src/tools/gids-tool.c
+@@ -401,7 +401,8 @@ static int print_info(sc_card_t *card) {
+ 		if (cmapfilesize == sizeof(cmapfile)) {
+ 			printf("Unable to find the container file (mscp\\cmapfile)\n");
+ 		} else {
+-			PCONTAINER_MAP_RECORD cmaprecords = (PCONTAINER_MAP_RECORD) cmapfile;
++			PCONTAINER_MAP_RECORD cmaprecords = malloc(sizeof(CONTAINER_MAP_RECORD));
++			memcpy(cmaprecords, cmapfile, sizeof(CONTAINER_MAP_RECORD));
+ 			int cmaprecordnum = (cmapfilesize / sizeof(CONTAINER_MAP_RECORD));
+ 			int keymaprecordnum = -1;
+ 			struct gids_keymap_record* keymaprecord = ((struct gids_keymap_record*)(keymap +1));
+-- 
+2.30.2
+
diff --git a/package/opensc/Config.in b/package/opensc/Config.in
new file mode 100644
index 0000000000..d6b137a87f
--- /dev/null
+++ b/package/opensc/Config.in
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_OPENSC
+	bool "opensc"
+	depends on !BR2_STATIC_LIBS # dlopen()
+	select BR2_PACKAGE_PCSC_LITE
+	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL
+	help
+	  OpenSC provides a set of libraries and utilities to work
+	  with smart cards.
+
+	  https://github.com/OpenSC/OpenSC/wiki
diff --git a/package/opensc/opensc.hash b/package/opensc/opensc.hash
new file mode 100644
index 0000000000..1e3472ba2a
--- /dev/null
+++ b/package/opensc/opensc.hash
@@ -0,0 +1,5 @@
+# From https://https://github.com/OpenSC/OpenSC/releases/
+sha256  8d4e5347195ebea332be585df61dcc470331c26969e4b0447c851fb0844c7186  opensc-0.22.0.tar.gz
+
+# Computed locally
+sha256  376b54d4c5f4aa99421823fa4da93e3ab73096fce2400e89858632aa7da24a14  COPYING
diff --git a/package/opensc/opensc.mk b/package/opensc/opensc.mk
new file mode 100644
index 0000000000..7221eee944
--- /dev/null
+++ b/package/opensc/opensc.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# opensc
+#
+################################################################################
+
+OPENSC_VERSION = 0.22.0
+OPENSC_SITE = https://github.com/OpenSC/OpenSC/releases/download/$(OPENSC_VERSION)
+OPENSC_LICENSE = LGPL-2.1+
+OPENSC_LICENSE_FILES = COPYING
+OPENSC_DEPENDENCIES = openssl pcsc-lite
+OPENSC_INSTALL_STAGING = YES
+
+$(eval $(autotools-package))
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCH 2/7] package/minijail: new package
  2021-12-10 14:12 [Buildroot] [PATCH 1/7] package/opensc: new package José Pekkarinen
@ 2021-12-10 14:12 ` José Pekkarinen
  2021-12-10 14:48   ` Giulio Benetti
                     ` (2 more replies)
  2021-12-10 14:12 ` [Buildroot] [PATCH 3/7] package/bmx7: " José Pekkarinen
                   ` (6 subsequent siblings)
  7 siblings, 3 replies; 39+ messages in thread
From: José Pekkarinen @ 2021-12-10 14:12 UTC (permalink / raw)
  To: buildroot; +Cc: José Pekkarinen

This patch adds a new package for minijail.

Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 package/minijail/0001-Fix-prlimit-call.patch  | 29 ++++++++++++++++++
 package/minijail/0002-Fix-static-assert.patch | 30 +++++++++++++++++++
 package/minijail/Config.in                    | 12 ++++++++
 package/minijail/minijail.hash                |  5 ++++
 package/minijail/minijail.mk                  | 28 +++++++++++++++++
 7 files changed, 106 insertions(+)
 create mode 100644 package/minijail/0001-Fix-prlimit-call.patch
 create mode 100644 package/minijail/0002-Fix-static-assert.patch
 create mode 100644 package/minijail/Config.in
 create mode 100644 package/minijail/minijail.hash
 create mode 100644 package/minijail/minijail.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 854f6f2084..65448a74c8 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@unikie.com>
+F:	package/minijail/
 F:	package/opensc/
 F:	package/softhsm2/
 
diff --git a/package/Config.in b/package/Config.in
index b5907d7fa3..aac8172fc4 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2516,6 +2516,7 @@ menu "System tools"
 	source "package/mender/Config.in"
 	source "package/mender-grubenv/Config.in"
 	source "package/mfoc/Config.in"
+	source "package/minijail/Config.in"
 	source "package/monit/Config.in"
 	source "package/multipath-tools/Config.in"
 	source "package/ncdu/Config.in"
diff --git a/package/minijail/0001-Fix-prlimit-call.patch b/package/minijail/0001-Fix-prlimit-call.patch
new file mode 100644
index 0000000000..9f6902ed43
--- /dev/null
+++ b/package/minijail/0001-Fix-prlimit-call.patch
@@ -0,0 +1,29 @@
+From 09348f06104bf8101a24a0bce235a75a214e1380 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen@unikie.com>
+Date: Fri, 10 Dec 2021 14:20:30 +0200
+Subject: [PATCH] Fix prlimit call
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
+---
+ libminijail.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libminijail.c b/libminijail.c
+index b935dfd..45f133e 100644
+--- a/libminijail.c
++++ b/libminijail.c
+@@ -1908,7 +1908,7 @@ static void set_rlimits_or_die(const struct minijail *j)
+ 		struct rlimit limit;
+ 		limit.rlim_cur = j->rlimits[i].cur;
+ 		limit.rlim_max = j->rlimits[i].max;
+-		if (prlimit(j->initpid, j->rlimits[i].type, &limit, NULL))
++		if (setrlimit(j->rlimits[i].type, &limit))
+ 			kill_child_and_die(j, "failed to set rlimit");
+ 	}
+ }
+-- 
+2.30.2
+
diff --git a/package/minijail/0002-Fix-static-assert.patch b/package/minijail/0002-Fix-static-assert.patch
new file mode 100644
index 0000000000..48139e8baa
--- /dev/null
+++ b/package/minijail/0002-Fix-static-assert.patch
@@ -0,0 +1,30 @@
+From b5d91b793942747e5126e75abca2eebad60ab478 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen@unikie.com>
+Date: Fri, 10 Dec 2021 14:21:38 +0200
+Subject: [PATCH] Fix static assert
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
+---
+ libminijail.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/libminijail.c b/libminijail.c
+index 45f133e..8323742 100644
+--- a/libminijail.c
++++ b/libminijail.c
+@@ -2620,9 +2620,6 @@ static int fd_is_open(int fd)
+ 	return fcntl(fd, F_GETFD) != -1 || errno != EBADF;
+ }
+ 
+-static_assert(FD_SETSIZE >= MAX_PRESERVED_FDS * 2 - 1,
+-	      "If true, ensure_no_fd_conflict will always find an unused fd.");
+-
+ /* If parent_fd will be used by a child fd, move it to an unused fd. */
+ static int ensure_no_fd_conflict(const fd_set *child_fds,
+ 				 int child_fd, int *parent_fd)
+-- 
+2.30.2
+
diff --git a/package/minijail/Config.in b/package/minijail/Config.in
new file mode 100644
index 0000000000..02868ef09c
--- /dev/null
+++ b/package/minijail/Config.in
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_MINIJAIL
+	bool "minijail"
+	depends on !BR2_STATIC_LIBS # dlopen()
+	select BR2_PACKAGE_HOST_LIBCAP
+	select BR2_PACKAGE_LIBCAP
+	help
+	  Minijail is a sandboxing tool maintained by google.
+
+	  https://google.github.io/minijail/
+
+comment "minijail needs a toolchain with dynamic library support"
+	depends on BR2_STATIC_LIBS
diff --git a/package/minijail/minijail.hash b/package/minijail/minijail.hash
new file mode 100644
index 0000000000..227a77fcf5
--- /dev/null
+++ b/package/minijail/minijail.hash
@@ -0,0 +1,5 @@
+# From https://github.com/google/minijail/releases/
+sha256  1ee5a5916491a32c121c7422b4d8c16481c0396a3acab34bf1c44589dcf810ae  linux-v17.tar.gz
+
+# Locally computed
+sha256  c6f439c5cf07263f71f01d29b79c79172ee529088e51ab434b22baad0988fe57  LICENSE
diff --git a/package/minijail/minijail.mk b/package/minijail/minijail.mk
new file mode 100644
index 0000000000..bc72421b0c
--- /dev/null
+++ b/package/minijail/minijail.mk
@@ -0,0 +1,28 @@
+################################################################################
+#
+# minijail
+#
+################################################################################
+
+MINIJAIL_VERSION = linux-v17
+MINIJAIL_SOURCE = $(MINIJAIL_VERSION).tar.gz
+MINIJAIL_SITE = "https://github.com/google/minijail/archive/refs/tags"
+MINIJAIL_LICENSE = BSD-Style
+MINIJAIL_LICENSE_FILES = LICENSE
+MINIJAIL_DEPENDENCIES=libcap host-libcap
+
+define MINIJAIL_BUILD_CMDS
+	(cd $(@D); \
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/$(d) CC="$(TARGET_CC)")
+endef
+
+define MINIJAIL_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/minijail0 \
+		$(TARGET_DIR)/usr/bin/minijail0
+	$(INSTALL) -m 0755 -D $(@D)/libminijailpreload.so \
+		$(TARGET_DIR)/lib/libminijailpreload.so
+	$(INSTALL) -m 0755 -D $(@D)/libminijail.so \
+		$(TARGET_DIR)/lib/libminijail.so
+endef
+
+$(eval $(generic-package))
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCH 3/7] package/bmx7: new package
  2021-12-10 14:12 [Buildroot] [PATCH 1/7] package/opensc: new package José Pekkarinen
  2021-12-10 14:12 ` [Buildroot] [PATCH 2/7] package/minijail: " José Pekkarinen
@ 2021-12-10 14:12 ` José Pekkarinen
  2021-12-10 14:52   ` Giulio Benetti
                     ` (2 more replies)
  2021-12-10 14:12 ` [Buildroot] [PATCH 4/7] package/alfred: " José Pekkarinen
                   ` (5 subsequent siblings)
  7 siblings, 3 replies; 39+ messages in thread
From: José Pekkarinen @ 2021-12-10 14:12 UTC (permalink / raw)
  To: buildroot; +Cc: José Pekkarinen

This patch will provide an initial package
for bmx7 project.

Signed-off-by: José Pekkarinen <jose.pekkarinen@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@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@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
+
+Signed-off-by: José Pekkarinen <jose.pekkarinen@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@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
+
+Signed-off-by: José Pekkarinen <jose.pekkarinen@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@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
+
+Signed-off-by: José Pekkarinen <jose.pekkarinen@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
+	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))
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCH 4/7] package/alfred: new package
  2021-12-10 14:12 [Buildroot] [PATCH 1/7] package/opensc: new package José Pekkarinen
  2021-12-10 14:12 ` [Buildroot] [PATCH 2/7] package/minijail: " José Pekkarinen
  2021-12-10 14:12 ` [Buildroot] [PATCH 3/7] package/bmx7: " José Pekkarinen
@ 2021-12-10 14:12 ` José Pekkarinen
  2021-12-10 14:54   ` Giulio Benetti
  2022-01-05 22:43   ` Thomas Petazzoni
  2021-12-10 14:12 ` [Buildroot] [PATCH 5/7] package/aexpect: " José Pekkarinen
                   ` (4 subsequent siblings)
  7 siblings, 2 replies; 39+ messages in thread
From: José Pekkarinen @ 2021-12-10 14:12 UTC (permalink / raw)
  To: buildroot; +Cc: José Pekkarinen

This  patch will provide the initial
package for alfred project.

Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
---
 DEVELOPERS                 |  1 +
 package/Config.in          |  1 +
 package/alfred/Config.in   | 20 ++++++++++++++++++++
 package/alfred/alfred.hash |  4 ++++
 package/alfred/alfred.mk   | 25 +++++++++++++++++++++++++
 5 files changed, 51 insertions(+)
 create mode 100644 package/alfred/Config.in
 create mode 100644 package/alfred/alfred.hash
 create mode 100644 package/alfred/alfred.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index e3e48522aa..0e4db835d3 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@unikie.com>
+F:	package/alfred/
 F:	package/bmx7/
 F:	package/minijail/
 F:	package/opensc/
diff --git a/package/Config.in b/package/Config.in
index 55ba0ded13..b857e18976 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2112,6 +2112,7 @@ endmenu
 
 menu "Networking applications"
 	source "package/aircrack-ng/Config.in"
+	source "package/alfred/Config.in"
 	source "package/aoetools/Config.in"
 	source "package/apache/Config.in"
 	source "package/argus/Config.in"
diff --git a/package/alfred/Config.in b/package/alfred/Config.in
new file mode 100644
index 0000000000..5f9c6f2a6e
--- /dev/null
+++ b/package/alfred/Config.in
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_ALFRED
+	bool "alfred"
+	depends on !BR2_STATIC_LIBS # dlopen()
+	select BR2_PACKAGE_LIBNL
+	select BR2_PACKAGE_LIBCAP
+	select BR2_PACKAGE_GPSD
+	help
+	  Alfred is a user space daemon for distributing
+	  arbitrary local information over the mesh/network in
+	  a decentralized fashion.
+	  This data can be anything which appears to be useful
+	  - originally designed to replace the batman-adv
+	  visualization (vis), you may distribute hostnames,
+	  phone books, administration information, DNS
+	  information, the local weather forecast ...
+
+	  https://www.open-mesh.org/projects/alfred/wiki
+
+comment "alfred needs a toolchain with dynamic library support"
+	depends on BR2_STATIC_LIBS
diff --git a/package/alfred/alfred.hash b/package/alfred/alfred.hash
new file mode 100644
index 0000000000..a2dd0116d7
--- /dev/null
+++ b/package/alfred/alfred.hash
@@ -0,0 +1,4 @@
+# From https://downloads.open-mesh.org/batman/stable/sources/alfred
+sha256  4c79b6c45de4bcc8cbfe64cba9a0f8b4ef304ca84c194622f2bfa41e01e2cb95  alfred-2021.4.tar.gz
+# Locally computed
+sha256  cecbf53d1148e13256ac29f8b900655b7fc8dc12d59939a95bc2323ea1747025  LICENSES/preferred/GPL-2.0
diff --git a/package/alfred/alfred.mk b/package/alfred/alfred.mk
new file mode 100644
index 0000000000..4e38ddad92
--- /dev/null
+++ b/package/alfred/alfred.mk
@@ -0,0 +1,25 @@
+################################################################################
+#
+# alfred
+#
+################################################################################
+
+ALFRED_VERSION = 2021.4
+ALFRED_SITE = https://downloads.open-mesh.org/batman/stable/sources/alfred
+ALFRED_LICENSE = GPL-2
+ALFRED_LICENSE_FILES = LICENSES/preferred/GPL-2.0
+ALFRED_DEPENDENCIES = libnl libcap gpsd
+
+define ALFRED_BUILD_CMDS
+	(cd $(@D); \
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/$(d) CC="$(TARGET_CC)")
+endef
+
+define ALFRED_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/alfred \
+		$(TARGET_DIR)/usr/bin/alfred
+	$(INSTALL) -m 0755 -D $(@D)/vis/batadv-vis \
+		$(TARGET_DIR)/usr/bin/batadv-vis
+endef
+
+$(eval $(generic-package))
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCH 5/7] package/aexpect: new package
  2021-12-10 14:12 [Buildroot] [PATCH 1/7] package/opensc: new package José Pekkarinen
                   ` (2 preceding siblings ...)
  2021-12-10 14:12 ` [Buildroot] [PATCH 4/7] package/alfred: " José Pekkarinen
@ 2021-12-10 14:12 ` José Pekkarinen
  2021-12-10 14:56   ` Giulio Benetti
                     ` (2 more replies)
  2021-12-10 14:12 ` [Buildroot] [PATCH 6/7] package/avocado: " José Pekkarinen
                   ` (3 subsequent siblings)
  7 siblings, 3 replies; 39+ messages in thread
From: José Pekkarinen @ 2021-12-10 14:12 UTC (permalink / raw)
  To: buildroot; +Cc: José Pekkarinen

Add package to avocado framework's aexpect.

Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
---
 DEVELOPERS                   |  1 +
 package/Config.in            |  1 +
 package/aexpect/Config.in    | 12 ++++++++++++
 package/aexpect/aexpect.hash |  4 ++++
 package/aexpect/aexpect.mk   | 13 +++++++++++++
 5 files changed, 31 insertions(+)
 create mode 100644 package/aexpect/Config.in
 create mode 100644 package/aexpect/aexpect.hash
 create mode 100644 package/aexpect/aexpect.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 0e4db835d3..b8097556f8 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@unikie.com>
+F:	package/aexpect/
 F:	package/alfred/
 F:	package/bmx7/
 F:	package/minijail/
diff --git a/package/Config.in b/package/Config.in
index b857e18976..5395d8dd49 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -154,6 +154,7 @@ menu "Debugging, profiling and benchmark"
 endmenu
 
 menu "Development tools"
+	source "package/aexpect/Config.in"
 	source "package/bats-core/Config.in"
 	source "package/binutils/Config.in"
 	source "package/bitwise/Config.in"
diff --git a/package/aexpect/Config.in b/package/aexpect/Config.in
new file mode 100644
index 0000000000..efa2be8b91
--- /dev/null
+++ b/package/aexpect/Config.in
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_AEXPECT
+	bool "aexpect"
+	depends on !BR2_STATIC_LIBS # dlopen()
+	select BR2_PACKAGE_PYTHON
+	help
+	  This module provides services similar to
+	  the pexpect python library, so to speak,
+	  spawn and control interactive applications,
+	  such as ssh, sftp and others.
+
+comment "aexpect needs a toolchain with dynamic library support"
+	depends on BR2_STATIC_LIBS
diff --git a/package/aexpect/aexpect.hash b/package/aexpect/aexpect.hash
new file mode 100644
index 0000000000..4a47da4121
--- /dev/null
+++ b/package/aexpect/aexpect.hash
@@ -0,0 +1,4 @@
+# From https://files.pythonhosted.org/packages/d0/fa/5ba16ca17a70980c7c09ea1c8d748aace1ee8772d032c483add0e17d0cf6
+sha256  54abae31e7d3b7afbfb7a019756907a81d40be4422788bccf20d2e82ad6ef8c8  aexpect-1.6.3.tar.gz
+# Locally computed
+sha256  7be26abf35e531a226dc742d2379d42d372cb61f027a6e26477c0e2f1a03bfcb  LICENSE
diff --git a/package/aexpect/aexpect.mk b/package/aexpect/aexpect.mk
new file mode 100644
index 0000000000..ca2097328a
--- /dev/null
+++ b/package/aexpect/aexpect.mk
@@ -0,0 +1,13 @@
+################################################################################
+#
+# aexpect
+#
+################################################################################
+
+AEXPECT_VERSION = 1.6.3
+AEXPECT_SITE = https://files.pythonhosted.org/packages/d0/fa/5ba16ca17a70980c7c09ea1c8d748aace1ee8772d032c483add0e17d0cf6
+AEXPECT_SETUP_TYPE = setuptools
+AEXPECT_LICENSE = GPL-2.0
+AEXPECT_LICENSE_FILES = LICENSE
+
+$(eval $(python-package))
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCH 6/7] package/avocado: new package
  2021-12-10 14:12 [Buildroot] [PATCH 1/7] package/opensc: new package José Pekkarinen
                   ` (3 preceding siblings ...)
  2021-12-10 14:12 ` [Buildroot] [PATCH 5/7] package/aexpect: " José Pekkarinen
@ 2021-12-10 14:12 ` José Pekkarinen
  2021-12-10 14:57   ` Giulio Benetti
  2022-07-26  8:13   ` Thomas Petazzoni via buildroot
  2021-12-10 14:12 ` [Buildroot] [PATCH 7/7] package/avocado-vt: " José Pekkarinen
                   ` (2 subsequent siblings)
  7 siblings, 2 replies; 39+ messages in thread
From: José Pekkarinen @ 2021-12-10 14:12 UTC (permalink / raw)
  To: buildroot; +Cc: José Pekkarinen

This patch adds a basic package for
avocado framework.

Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
---
 DEVELOPERS                   |  1 +
 package/Config.in            |  1 +
 package/avocado/Config.in    | 13 +++++++++++++
 package/avocado/avocado.hash |  4 ++++
 package/avocado/avocado.mk   | 14 ++++++++++++++
 5 files changed, 33 insertions(+)
 create mode 100644 package/avocado/Config.in
 create mode 100644 package/avocado/avocado.hash
 create mode 100644 package/avocado/avocado.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index b8097556f8..3ff6abb2af 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1466,6 +1466,7 @@ F:	support/testing/tests/package/test_zfs.py
 N:	José Pekkarinen <jose.pekkarinen@unikie.com>
 F:	package/aexpect/
 F:	package/alfred/
+F:	package/avocado/
 F:	package/bmx7/
 F:	package/minijail/
 F:	package/opensc/
diff --git a/package/Config.in b/package/Config.in
index 5395d8dd49..c5d270a7fd 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -155,6 +155,7 @@ endmenu
 
 menu "Development tools"
 	source "package/aexpect/Config.in"
+	source "package/avocado/Config.in"
 	source "package/bats-core/Config.in"
 	source "package/binutils/Config.in"
 	source "package/bitwise/Config.in"
diff --git a/package/avocado/Config.in b/package/avocado/Config.in
new file mode 100644
index 0000000000..402a639969
--- /dev/null
+++ b/package/avocado/Config.in
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_AVOCADO
+	bool "avocado"
+	depends on !BR2_STATIC_LIBS # dlopen()
+	select BR2_PACKAGE_LIBFFI
+	select BR2_PACKAGE_PYTHON3
+	help
+	  Avocado is an automated testing suite containing
+	  tests for various subsystems.
+
+	  https://avocado-framework.readthedocs.io/
+
+comment "avocado needs a toolchain with dynamic library support"
+	depends on BR2_STATIC_LIBS
diff --git a/package/avocado/avocado.hash b/package/avocado/avocado.hash
new file mode 100644
index 0000000000..257ee5d5ae
--- /dev/null
+++ b/package/avocado/avocado.hash
@@ -0,0 +1,4 @@
+# From https://github.com/avocado-framework/avocado/archive/refs/tags
+sha256  b7a35552cd0f0d8e4b3aa4bb7009ce9e474a40c1cd111698ed03da90d71a2f4b  93.0.tar.gz
+# Locally computed
+sha256  680ce56e9c4043826f0f1420935d2453ea3ddacd1582cb6f1cef26c1077fcc93  LICENSE
diff --git a/package/avocado/avocado.mk b/package/avocado/avocado.mk
new file mode 100644
index 0000000000..8474fa48c8
--- /dev/null
+++ b/package/avocado/avocado.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# avocado-framework
+#
+################################################################################
+
+AVOCADO_VERSION = 93.0
+AVOCADO_SOURCE = $(AVOCADO_VERSION).tar.gz
+AVOCADO_SITE = https://github.com/avocado-framework/avocado/archive/refs/tags
+AVOCADO_SETUP_TYPE = setuptools
+AVOCADO_LICENSE = Apache-2.0
+AVOCADO_LICENSE_FILES = LICENSE
+
+$(eval $(python-package))
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCH 7/7] package/avocado-vt: new package
  2021-12-10 14:12 [Buildroot] [PATCH 1/7] package/opensc: new package José Pekkarinen
                   ` (4 preceding siblings ...)
  2021-12-10 14:12 ` [Buildroot] [PATCH 6/7] package/avocado: " José Pekkarinen
@ 2021-12-10 14:12 ` José Pekkarinen
  2021-12-10 15:00   ` Giulio Benetti
  2022-07-26  8:21   ` Thomas Petazzoni via buildroot
  2021-12-10 14:32 ` [Buildroot] [PATCH 1/7] package/opensc: " Giulio Benetti
  2021-12-10 14:49 ` Giulio Benetti
  7 siblings, 2 replies; 39+ messages in thread
From: José Pekkarinen @ 2021-12-10 14:12 UTC (permalink / raw)
  To: buildroot; +Cc: José Pekkarinen

This patch adds a basic package for avocado-vt
plugin.

Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
---
 DEVELOPERS                         |  1 +
 package/Config.in                  |  1 +
 package/avocado-vt/Config.in       | 13 +++++++++++++
 package/avocado-vt/avocado-vt.hash |  4 ++++
 package/avocado-vt/avocado-vt.mk   | 14 ++++++++++++++
 5 files changed, 33 insertions(+)
 create mode 100644 package/avocado-vt/Config.in
 create mode 100644 package/avocado-vt/avocado-vt.hash
 create mode 100644 package/avocado-vt/avocado-vt.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 3ff6abb2af..d258b46117 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1467,6 +1467,7 @@ N:	José Pekkarinen <jose.pekkarinen@unikie.com>
 F:	package/aexpect/
 F:	package/alfred/
 F:	package/avocado/
+F:	package/avocado-vt/
 F:	package/bmx7/
 F:	package/minijail/
 F:	package/opensc/
diff --git a/package/Config.in b/package/Config.in
index c5d270a7fd..cdc0b437b3 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -156,6 +156,7 @@ endmenu
 menu "Development tools"
 	source "package/aexpect/Config.in"
 	source "package/avocado/Config.in"
+	source "package/avocado-vt/Config.in"
 	source "package/bats-core/Config.in"
 	source "package/binutils/Config.in"
 	source "package/bitwise/Config.in"
diff --git a/package/avocado-vt/Config.in b/package/avocado-vt/Config.in
new file mode 100644
index 0000000000..5fbfd278cd
--- /dev/null
+++ b/package/avocado-vt/Config.in
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_AVOCADO_VT
+	bool "avocado-vt"
+	depends on !BR2_STATIC_LIBS # dlopen()
+	select BR2_PACKAGE_LIBFFI
+	select BR2_PACKAGE_PYTHON3
+	help
+	  Avocado VT is a virtualization test plugin for avocado test
+	  framework.
+
+	  https://avocado-vt.readthedocs.io/
+
+comment "avocado-vt needs a toolchain with dynamic library support"
+	depends on BR2_STATIC_LIBS
diff --git a/package/avocado-vt/avocado-vt.hash b/package/avocado-vt/avocado-vt.hash
new file mode 100644
index 0000000000..f5b8a22f08
--- /dev/null
+++ b/package/avocado-vt/avocado-vt.hash
@@ -0,0 +1,4 @@
+# From https://github.com/avocado-framework/avocado-vt/archive/refs/tags
+sha256  50b5735a9b445cea64ffa7929ca990b63a55976412a9456e65cb2d365e0177fc  93.0.tar.gz
+# Locally computed
+sha256  17be6b5c4a7ec639ae3ce1a5c0a5a61d602365e3c4bb3568493948392053b70c  LICENSE
diff --git a/package/avocado-vt/avocado-vt.mk b/package/avocado-vt/avocado-vt.mk
new file mode 100644
index 0000000000..d54a207da0
--- /dev/null
+++ b/package/avocado-vt/avocado-vt.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# avocado-vt
+#
+################################################################################
+
+AVOCADO_VT_VERSION = 93.0
+AVOCADO_VT_SOURCE = $(AVOCADO_VT_VERSION).tar.gz
+AVOCADO_VT_SITE = https://github.com/avocado-framework/avocado-vt/archive/refs/tags
+AVOCADO_VT_SETUP_TYPE = setuptools
+AVOCADO_VT_LICENSE = Apache-2.0
+AVOCADO_VT_LICENSE_FILES = LICENSE
+
+$(eval $(python-package))
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 1/7] package/opensc: new package
  2021-12-10 14:12 [Buildroot] [PATCH 1/7] package/opensc: new package José Pekkarinen
                   ` (5 preceding siblings ...)
  2021-12-10 14:12 ` [Buildroot] [PATCH 7/7] package/avocado-vt: " José Pekkarinen
@ 2021-12-10 14:32 ` Giulio Benetti
  2021-12-10 17:34   ` Yann E. MORIN
  2021-12-10 14:49 ` Giulio Benetti
  7 siblings, 1 reply; 39+ messages in thread
From: Giulio Benetti @ 2021-12-10 14:32 UTC (permalink / raw)
  To: José Pekkarinen; +Cc: buildroot

Hi José,

this patchset deserves a cover letter and also you need to send patchsets with V2 tag and indicate the changes in every patch you’ve changed.
Try to pick one V2 patchset from patchwork and try to imitate.

See below for comments

> Il giorno 10 dic 2021, alle ore 15:12, José Pekkarinen <jose.pekkarinen@unikie.com> ha scritto:
> 
> The patch will add a basic opensc package to build
> on buildroot.

Please as pointed previously reword like this:
“This patch adds opensc package”

> 
> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> ---
> DEVELOPERS                                    |   1 +
> package/Config.in                             |   1 +
> .../0001-Fix-maybe-uninitialized-errors.patch |  81 ++++++++++
> ...x-strict-aliasing-warnings-as-errors.patch | 150 ++++++++++++++++++
> package/opensc/Config.in                      |  11 ++
> package/opensc/opensc.hash                    |   5 +
> package/opensc/opensc.mk                      |  14 ++
> 7 files changed, 263 insertions(+)
> create mode 100644 package/opensc/0001-Fix-maybe-uninitialized-errors.patch
> create mode 100644 package/opensc/0002-Fix-strict-aliasing-warnings-as-errors.patch
> create mode 100644 package/opensc/Config.in
> create mode 100644 package/opensc/opensc.hash
> create mode 100644 package/opensc/opensc.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 3023526427..854f6f2084 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@unikie.com>
> +F:    package/opensc/
> F:    package/softhsm2/
> 
> N:    Joseph Kogut <joseph.kogut@gmail.com>
> diff --git a/package/Config.in b/package/Config.in
> index 57208309c4..b5907d7fa3 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1620,6 +1620,7 @@ menu "Hardware handling"
>    source "package/mtdev/Config.in"
>    source "package/ne10/Config.in"
>    source "package/neardal/Config.in"
> +    source "package/opensc/Config.in"
>    source "package/owfs/Config.in"
>    source "package/pcsc-lite/Config.in"
>    source "package/rpi-rgb-led-matrix/Config.in"
> diff --git a/package/opensc/0001-Fix-maybe-uninitialized-errors.patch b/package/opensc/0001-Fix-maybe-uninitialized-errors.patch
> new file mode 100644
> index 0000000000..17ef43a984
> --- /dev/null
> +++ b/package/opensc/0001-Fix-maybe-uninitialized-errors.patch
> @@ -0,0 +1,81 @@
> +From b74a624f21db3bfd45e0cb6ed017ceda9f29adfc Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen@unikie.com>
> +Date: Fri, 10 Dec 2021 13:54:26 +0200
> +Subject: [PATCH] Fix maybe uninitialized errors
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +

Here commit log is missing. In the case it is trivial, please repeat the summary in the commit log body, like:
“Fix maybe uninitialized errors”
again

> +Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> +---
> + src/libopensc/pkcs15-coolkey.c  | 12 ++++++------
> + src/pkcs15init/pkcs15-asepcos.c |  2 +-
> + src/tools/opensc-explorer.c     |  2 +-
> + 3 files changed, 8 insertions(+), 8 deletions(-)
> +
> +diff --git a/src/libopensc/pkcs15-coolkey.c b/src/libopensc/pkcs15-coolkey.c
> +index 586475d..32a7674 100644
> +--- a/src/libopensc/pkcs15-coolkey.c
> ++++ b/src/libopensc/pkcs15-coolkey.c
> +@@ -147,9 +147,9 @@ coolkey_find_matching_cert(sc_card_t *card, sc_cardctl_coolkey_object_t *in_obj,
> + static int
> + coolkey_get_attribute_ulong(sc_card_t *card, sc_cardctl_coolkey_object_t *obj, CK_ATTRIBUTE_TYPE type, CK_ULONG *value)
> + {
> +-    const u8 *val;
> +-    size_t val_len;
> +-    u8 data_type;
> ++    const u8 *val = malloc(sizeof(u8));
> ++    size_t val_len = 0;
> ++    u8 data_type = 0;
> +    int r;
> + 
> +    r  = coolkey_get_attribute(card, obj, type, &val, &val_len, &data_type);
> +@@ -168,8 +168,8 @@ static int
> + coolkey_get_attribute_boolean(sc_card_t *card, sc_cardctl_coolkey_object_t *obj, CK_ATTRIBUTE_TYPE attr_type)
> + {
> +    int r;
> +-    const u8 *val;
> +-    size_t val_len;
> ++    const u8 *val = malloc(sizeof(u8));
> ++    size_t val_len = 0;
> + 
> +    r = coolkey_get_attribute(card, obj, attr_type, &val, &val_len, NULL);
> +    if (r < 0) {
> +@@ -186,7 +186,7 @@ static int
> + coolkey_get_attribute_bytes(sc_card_t *card, sc_cardctl_coolkey_object_t *obj, CK_ATTRIBUTE_TYPE type, u8 *data, size_t *data_len, size_t max_data_len)
> + {
> +    const u8 *val;
> +-    size_t val_len;
> ++    size_t val_len = 0;
> +    int r;
> + 
> +    r = coolkey_get_attribute(card, obj, type, &val, &val_len, NULL);
> +diff --git a/src/pkcs15init/pkcs15-asepcos.c b/src/pkcs15init/pkcs15-asepcos.c
> +index d712201..bc0efb5 100644
> +--- a/src/pkcs15init/pkcs15-asepcos.c
> ++++ b/src/pkcs15init/pkcs15-asepcos.c
> +@@ -221,7 +221,7 @@ static int asepcos_do_store_pin(sc_profile_t *profile, sc_card_t *card,
> + {
> +    sc_file_t *nfile = NULL;
> +    u8  buf[64], sbuf[64], *p = buf, *q = sbuf;
> +-    int r, akn;
> ++    int r, akn = 0;
> + 
> +    if (auth_info->auth_type != SC_PKCS15_PIN_AUTH_TYPE_PIN)
> +        return SC_ERROR_OBJECT_NOT_VALID;
> +diff --git a/src/tools/opensc-explorer.c b/src/tools/opensc-explorer.c
> +index d251495..749b163 100644
> +--- a/src/tools/opensc-explorer.c
> ++++ b/src/tools/opensc-explorer.c
> +@@ -2472,7 +2472,7 @@ int main(int argc, char *argv[])
> +        char *line;
> +        int cargc;
> +        char *cargv[260];
> +-        int multiple;
> ++        int multiple = 0;
> +        struct command *cmd;
> +        char prompt[3*SC_MAX_PATH_STRING_SIZE];
> + 
> +-- 
> +2.30.2
> +
> diff --git a/package/opensc/0002-Fix-strict-aliasing-warnings-as-errors.patch b/package/opensc/0002-Fix-strict-aliasing-warnings-as-errors.patch
> new file mode 100644
> index 0000000000..24cd1ff137
> --- /dev/null
> +++ b/package/opensc/0002-Fix-strict-aliasing-warnings-as-errors.patch
> @@ -0,0 +1,150 @@
> +From 5bb64ae9305bbe20bbf2f95dfdddb0966d7c9a50 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen@unikie.com>
> +Date: Fri, 10 Dec 2021 13:56:22 +0200
> +Subject: [PATCH] Fix strict aliasing warnings as errors
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit

Ditto

> +
> +Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> +---
> + src/libopensc/card-gids.c | 20 ++++++++++++--------
> + src/libopensc/card-gpk.c  | 11 ++++++-----
> + src/tools/gids-tool.c     |  3 ++-
> + 3 files changed, 20 insertions(+), 14 deletions(-)
> +
> +diff --git a/src/libopensc/card-gids.c b/src/libopensc/card-gids.c
> +index f25e37d..17901cd 100644
> +--- a/src/libopensc/card-gids.c
> ++++ b/src/libopensc/card-gids.c
> +@@ -691,7 +691,8 @@ static int gids_finish(sc_card_t *card)
> + // the cmap file is used to detect the key algorithm / size
> + static int gids_get_crypto_identifier_from_key_ref(sc_card_t *card, const unsigned char keyref, unsigned char *cryptoidentifier) {
> +    struct gids_private_data *data = (struct gids_private_data *) card->drv_data;
> +-    PCONTAINER_MAP_RECORD records = (PCONTAINER_MAP_RECORD) data->cmapfile;
> ++    PCONTAINER_MAP_RECORD records = malloc(sizeof(CONTAINER_MAP_RECORD));
> ++    memcpy(records, data->cmapfile, sizeof(CONTAINER_MAP_RECORD));
> +    int recordsnum = (int) (data->cmapfilesize / sizeof(CONTAINER_MAP_RECORD));
> +    int index = keyref - GIDS_FIRST_KEY_IDENTIFIER;
> +    if (index >= recordsnum) {
> +@@ -1112,10 +1113,10 @@ gids_get_all_containers(sc_card_t* card, size_t *recordsnum) {
> + // return the detail about a container to emulate a pkcs15 card
> + static int
> + gids_get_container_detail(sc_card_t* card, sc_cardctl_gids_get_container_t* container) {
> +-    PCONTAINER_MAP_RECORD records = NULL;
> ++    PCONTAINER_MAP_RECORD records = malloc(sizeof(CONTAINER_MAP_RECORD));
> +    struct gids_private_data *privatedata = (struct gids_private_data *) card->drv_data;
> +    size_t recordsnum, num, i;
> +-    records = (PCONTAINER_MAP_RECORD) privatedata ->cmapfile;
> ++    memcpy(records, privatedata->cmapfile, sizeof(CONTAINER_MAP_RECORD));
> +    recordsnum = (privatedata ->cmapfilesize / sizeof(CONTAINER_MAP_RECORD));
> + 
> +    num = container->containernum ;
> +@@ -1158,7 +1159,8 @@ gids_get_container_detail(sc_card_t* card, sc_cardctl_gids_get_container_t* cont
> + static int
> + gids_select_key_reference(sc_card_t *card, sc_pkcs15_prkey_info_t* key_info) {
> +    struct gids_private_data *data = (struct gids_private_data *) card->drv_data;
> +-    PCONTAINER_MAP_RECORD records = (PCONTAINER_MAP_RECORD) data->cmapfile;
> ++    PCONTAINER_MAP_RECORD records = malloc(sizeof(CONTAINER_MAP_RECORD));
> ++    memcpy(records, data->cmapfile, sizeof(CONTAINER_MAP_RECORD));
> +    size_t recordsnum;
> +    int r;
> +    char ch_tmp[10];
> +@@ -1302,7 +1304,8 @@ static int gids_create_keyfile(sc_card_t *card, sc_pkcs15_object_t *object) {
> +    struct gids_private_data *data = (struct gids_private_data *) card->drv_data;
> +    size_t recordnum;
> +    size_t containernum = key_info->key_reference - GIDS_FIRST_KEY_IDENTIFIER;
> +-    PCONTAINER_MAP_RECORD records = ((PCONTAINER_MAP_RECORD) cmapbuffer) + containernum;
> ++    PCONTAINER_MAP_RECORD records = malloc(sizeof(CONTAINER_MAP_RECORD));
> ++    memcpy(records, cmapbuffer + containernum, sizeof(CONTAINER_MAP_RECORD));
> +    struct gids_keymap_record* keymaprecord = NULL;
> +    int i;
> + 
> +@@ -1390,12 +1393,12 @@ static int gids_create_keyfile(sc_card_t *card, sc_pkcs15_object_t *object) {
> + 
> +    // convert char to wchar
> +    for(i = 0; i < MAX_CONTAINER_NAME_LEN && object->label[i]; i++) {
> +-        records->wszGuid[i] = object->label[i];
> ++        records->wszGuid[i] = (unsigned short) object->label[i];
> +    }
> + 
> +    // TODO: check if a container with the same name already exists and prevent is creation or change its name
> + 
> +-    records->bFlags = CONTAINER_MAP_VALID_CONTAINER;
> ++    records->bFlags = (unsigned char) CONTAINER_MAP_VALID_CONTAINER;
> +    if (recordnum == 0) {
> +        records->bFlags |= CONTAINER_MAP_DEFAULT_CONTAINER;
> +    }
> +@@ -1638,7 +1641,8 @@ static int gids_delete_container_num(sc_card_t *card, size_t containernum) {
> +    size_t keymaprecordnum = 0;
> +    struct gids_private_data *data = (struct gids_private_data *) card->drv_data;
> +    size_t recordnum;
> +-    PCONTAINER_MAP_RECORD records = ((PCONTAINER_MAP_RECORD) cmapbuffer) + containernum;
> ++    PCONTAINER_MAP_RECORD records = malloc(sizeof(CONTAINER_MAP_RECORD));
> ++    memcpy(records, cmapbuffer + containernum, sizeof(CONTAINER_MAP_RECORD));
> +    struct gids_keymap_record* keymaprecord = NULL;
> + 
> +    SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
> +diff --git a/src/libopensc/card-gpk.c b/src/libopensc/card-gpk.c
> +index 983ab5b..8afb0ee 100644
> +--- a/src/libopensc/card-gpk.c
> ++++ b/src/libopensc/card-gpk.c
> +@@ -228,11 +228,12 @@ static int
> + match_path(sc_card_t *card, unsigned short int **pathptr, size_t *pathlen,
> +        int need_info)
> + {
> +-    unsigned short int    *curptr, *ptr;
> ++    u8            *curptr;
> ++    unsigned short int    *ptr;
> +    size_t        curlen, len;
> +    size_t        i;
> + 
> +-    curptr = (unsigned short int *) card->cache.current_path.value;
> ++    curptr = (u8 *) card->cache.current_path.value;
> +    curlen = card->cache.current_path.len;
> +    ptr    = *pathptr;
> +    len    = *pathlen;
> +@@ -242,7 +243,7 @@ match_path(sc_card_t *card, unsigned short int **pathptr, size_t *pathlen,
> + 
> +    /* Make sure path starts with MF.
> +     * Note the cached path should always begin with MF. */
> +-    if (ptr[0] != GPK_FID_MF || curptr[0] != GPK_FID_MF)
> ++    if (ptr[0] != (GPK_FID_MF >> 8) || curptr[0] != (GPK_FID_MF >> 8))
> +        return 0;
> + 
> +    for (i = 1; i < len && i < curlen; i++) {
> +@@ -545,7 +546,7 @@ gpk_select_id(sc_card_t *card, int kind, unsigned int fid,
> +    /* Fix up the path cache.
> +     * NB we never cache the ID of an EF, just the DF path */
> +    if (r == 0) {
> +-        unsigned short int    *path;
> ++        u8    *path;
> + 
> +        switch (kind) {
> +        case GPK_SEL_MF:
> +@@ -555,7 +556,7 @@ gpk_select_id(sc_card_t *card, int kind, unsigned int fid,
> +            if (cp->len + 1 > SC_MAX_PATH_SIZE / 2) {
> +                return SC_ERROR_INTERNAL;
> +            }
> +-            path = (unsigned short int *) cp->value;
> ++            path = (u8 *) cp->value;
> +            path[cp->len++] = fid;
> +        }
> +    } else {
> +diff --git a/src/tools/gids-tool.c b/src/tools/gids-tool.c
> +index 1c9602b..eed4296 100644
> +--- a/src/tools/gids-tool.c
> ++++ b/src/tools/gids-tool.c
> +@@ -401,7 +401,8 @@ static int print_info(sc_card_t *card) {
> +        if (cmapfilesize == sizeof(cmapfile)) {
> +            printf("Unable to find the container file (mscp\\cmapfile)\n");
> +        } else {
> +-            PCONTAINER_MAP_RECORD cmaprecords = (PCONTAINER_MAP_RECORD) cmapfile;
> ++            PCONTAINER_MAP_RECORD cmaprecords = malloc(sizeof(CONTAINER_MAP_RECORD));
> ++            memcpy(cmaprecords, cmapfile, sizeof(CONTAINER_MAP_RECORD));
> +            int cmaprecordnum = (cmapfilesize / sizeof(CONTAINER_MAP_RECORD));
> +            int keymaprecordnum = -1;
> +            struct gids_keymap_record* keymaprecord = ((struct gids_keymap_record*)(keymap +1));
> +-- 
> +2.30.2
> +
> diff --git a/package/opensc/Config.in b/package/opensc/Config.in
> new file mode 100644
> index 0000000000..d6b137a87f
> --- /dev/null
> +++ b/package/opensc/Config.in
> @@ -0,0 +1,11 @@
> +config BR2_PACKAGE_OPENSC
> +    bool "opensc"
> +    depends on !BR2_STATIC_LIBS # dlopen()
> +    select BR2_PACKAGE_PCSC_LITE
> +    select BR2_PACKAGE_OPENSSL
> +    select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL
> +    help
> +      OpenSC provides a set of libraries and utilities to work
> +      with smart cards.
> +
> +      https://github.com/OpenSC/OpenSC/wiki
> diff --git a/package/opensc/opensc.hash b/package/opensc/opensc.hash
> new file mode 100644
> index 0000000000..1e3472ba2a
> --- /dev/null
> +++ b/package/opensc/opensc.hash
> @@ -0,0 +1,5 @@
> +# From https://https://github.com/OpenSC/OpenSC/releases/

As pointed before here ^^^ you need to point the file containing the sha256. If it doesn’t exists point that is computed locally.

Also, don’t respin so fast, otherwise other people can’t comment.

Thank you

Best regards
Giulio

> +sha256  8d4e5347195ebea332be585df61dcc470331c26969e4b0447c851fb0844c7186  opensc-0.22.0.tar.gz
> +
> +# Computed locally
> +sha256  376b54d4c5f4aa99421823fa4da93e3ab73096fce2400e89858632aa7da24a14  COPYING
> diff --git a/package/opensc/opensc.mk b/package/opensc/opensc.mk
> new file mode 100644
> index 0000000000..7221eee944
> --- /dev/null
> +++ b/package/opensc/opensc.mk
> @@ -0,0 +1,14 @@
> +################################################################################
> +#
> +# opensc
> +#
> +################################################################################
> +
> +OPENSC_VERSION = 0.22.0
> +OPENSC_SITE = https://github.com/OpenSC/OpenSC/releases/download/$(OPENSC_VERSION)
> +OPENSC_LICENSE = LGPL-2.1+
> +OPENSC_LICENSE_FILES = COPYING
> +OPENSC_DEPENDENCIES = openssl pcsc-lite
> +OPENSC_INSTALL_STAGING = YES
> +
> +$(eval $(autotools-package))
> -- 
> 2.30.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 2/7] package/minijail: new package
  2021-12-10 14:12 ` [Buildroot] [PATCH 2/7] package/minijail: " José Pekkarinen
@ 2021-12-10 14:48   ` Giulio Benetti
  2021-12-10 18:15     ` Arnout Vandecappelle
  2021-12-10 19:57   ` Yann E. MORIN
  2022-01-05 20:41   ` Thomas Petazzoni
  2 siblings, 1 reply; 39+ messages in thread
From: Giulio Benetti @ 2021-12-10 14:48 UTC (permalink / raw)
  To: José Pekkarinen, buildroot

Hi José,

On 10/12/21 15:12, José Pekkarinen wrote:
> This patch adds a new package for minijail.

Reword "This patch add package minijail"

> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> ---
>   DEVELOPERS                                    |  1 +
>   package/Config.in                             |  1 +
>   package/minijail/0001-Fix-prlimit-call.patch  | 29 ++++++++++++++++++
>   package/minijail/0002-Fix-static-assert.patch | 30 +++++++++++++++++++
>   package/minijail/Config.in                    | 12 ++++++++
>   package/minijail/minijail.hash                |  5 ++++
>   package/minijail/minijail.mk                  | 28 +++++++++++++++++
>   7 files changed, 106 insertions(+)
>   create mode 100644 package/minijail/0001-Fix-prlimit-call.patch
>   create mode 100644 package/minijail/0002-Fix-static-assert.patch
>   create mode 100644 package/minijail/Config.in
>   create mode 100644 package/minijail/minijail.hash
>   create mode 100644 package/minijail/minijail.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 854f6f2084..65448a74c8 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@unikie.com>
> +F:	package/minijail/
>   F:	package/opensc/
>   F:	package/softhsm2/
>   
> diff --git a/package/Config.in b/package/Config.in
> index b5907d7fa3..aac8172fc4 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -2516,6 +2516,7 @@ menu "System tools"
>   	source "package/mender/Config.in"
>   	source "package/mender-grubenv/Config.in"
>   	source "package/mfoc/Config.in"
> +	source "package/minijail/Config.in"
>   	source "package/monit/Config.in"
>   	source "package/multipath-tools/Config.in"
>   	source "package/ncdu/Config.in"
> diff --git a/package/minijail/0001-Fix-prlimit-call.patch b/package/minijail/0001-Fix-prlimit-call.patch
> new file mode 100644
> index 0000000000..9f6902ed43
> --- /dev/null
> +++ b/package/minijail/0001-Fix-prlimit-call.patch
> @@ -0,0 +1,29 @@
> +From 09348f06104bf8101a24a0bce235a75a214e1380 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen@unikie.com>
> +Date: Fri, 10 Dec 2021 14:20:30 +0200
> +Subject: [PATCH] Fix prlimit call
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +

Add a commit log

> +Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> +---
> + libminijail.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/libminijail.c b/libminijail.c
> +index b935dfd..45f133e 100644
> +--- a/libminijail.c
> ++++ b/libminijail.c
> +@@ -1908,7 +1908,7 @@ static void set_rlimits_or_die(const struct minijail *j)
> + 		struct rlimit limit;
> + 		limit.rlim_cur = j->rlimits[i].cur;
> + 		limit.rlim_max = j->rlimits[i].max;
> +-		if (prlimit(j->initpid, j->rlimits[i].type, &limit, NULL))
> ++		if (setrlimit(j->rlimits[i].type, &limit))
> + 			kill_child_and_die(j, "failed to set rlimit");
> + 	}
> + }
> +--
> +2.30.2
> +
> diff --git a/package/minijail/0002-Fix-static-assert.patch b/package/minijail/0002-Fix-static-assert.patch
> new file mode 100644
> index 0000000000..48139e8baa
> --- /dev/null
> +++ b/package/minijail/0002-Fix-static-assert.patch
> @@ -0,0 +1,30 @@
> +From b5d91b793942747e5126e75abca2eebad60ab478 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen@unikie.com>
> +Date: Fri, 10 Dec 2021 14:21:38 +0200
> +Subject: [PATCH] Fix static assert
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +

Ditto

> +Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> +---
> + libminijail.c | 3 ---
> + 1 file changed, 3 deletions(-)
> +
> +diff --git a/libminijail.c b/libminijail.c
> +index 45f133e..8323742 100644
> +--- a/libminijail.c
> ++++ b/libminijail.c
> +@@ -2620,9 +2620,6 @@ static int fd_is_open(int fd)
> + 	return fcntl(fd, F_GETFD) != -1 || errno != EBADF;
> + }
> +
> +-static_assert(FD_SETSIZE >= MAX_PRESERVED_FDS * 2 - 1,
> +-	      "If true, ensure_no_fd_conflict will always find an unused fd.");
> +-
> + /* If parent_fd will be used by a child fd, move it to an unused fd. */
> + static int ensure_no_fd_conflict(const fd_set *child_fds,
> + 				 int child_fd, int *parent_fd)
> +--
> +2.30.2
> +
> diff --git a/package/minijail/Config.in b/package/minijail/Config.in
> new file mode 100644
> index 0000000000..02868ef09c
> --- /dev/null
> +++ b/package/minijail/Config.in
> @@ -0,0 +1,12 @@
> +config BR2_PACKAGE_MINIJAIL
> +	bool "minijail"
> +	depends on !BR2_STATIC_LIBS # dlopen()
> +	select BR2_PACKAGE_HOST_LIBCAP
> +	select BR2_PACKAGE_LIBCAP
> +	help
> +	  Minijail is a sandboxing tool maintained by google.
> +
> +	  https://google.github.io/minijail/
> +
> +comment "minijail needs a toolchain with dynamic library support"
> +	depends on BR2_STATIC_LIBS
> diff --git a/package/minijail/minijail.hash b/package/minijail/minijail.hash
> new file mode 100644
> index 0000000000..227a77fcf5
> --- /dev/null
> +++ b/package/minijail/minijail.hash
> @@ -0,0 +1,5 @@
> +# From https://github.com/google/minijail/releases/

Point the sha256 file

> +sha256  1ee5a5916491a32c121c7422b4d8c16481c0396a3acab34bf1c44589dcf810ae  linux-v17.tar.gz
> +
> +# Locally computed
> +sha256  c6f439c5cf07263f71f01d29b79c79172ee529088e51ab434b22baad0988fe57  LICENSE
> diff --git a/package/minijail/minijail.mk b/package/minijail/minijail.mk
> new file mode 100644
> index 0000000000..bc72421b0c
> --- /dev/null
> +++ b/package/minijail/minijail.mk
> @@ -0,0 +1,28 @@
> +################################################################################
> +#
> +# minijail
> +#
> +################################################################################
> +
> +MINIJAIL_VERSION = linux-v17
> +MINIJAIL_SOURCE = $(MINIJAIL_VERSION).tar.gz
> +MINIJAIL_SITE = "https://github.com/google/minijail/archive/refs/tags"

Please use github wrapper ^^^

> +MINIJAIL_LICENSE = BSD-Style
> +MINIJAIL_LICENSE_FILES = LICENSE
> +MINIJAIL_DEPENDENCIES=libcap host-libcap
> +
> +define MINIJAIL_BUILD_CMDS
> +	(cd $(@D); \
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/$(d) CC="$(TARGET_CC)")
> +endef
> +
> +define MINIJAIL_INSTALL_TARGET_CMDS
> +	$(INSTALL) -m 0755 -D $(@D)/minijail0 \
> +		$(TARGET_DIR)/usr/bin/minijail0
> +	$(INSTALL) -m 0755 -D $(@D)/libminijailpreload.so \
> +		$(TARGET_DIR)/lib/libminijailpreload.so
> +	$(INSTALL) -m 0755 -D $(@D)/libminijail.so \
> +		$(TARGET_DIR)/lib/libminijail.so
> +endef
> +
> +$(eval $(generic-package))
> 

Best regards
-- 
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 1/7] package/opensc: new package
  2021-12-10 14:12 [Buildroot] [PATCH 1/7] package/opensc: new package José Pekkarinen
                   ` (6 preceding siblings ...)
  2021-12-10 14:32 ` [Buildroot] [PATCH 1/7] package/opensc: " Giulio Benetti
@ 2021-12-10 14:49 ` Giulio Benetti
  2021-12-10 17:06   ` Yann E. MORIN
  7 siblings, 1 reply; 39+ messages in thread
From: Giulio Benetti @ 2021-12-10 14:49 UTC (permalink / raw)
  To: José Pekkarinen, buildroot

Forgotten to point,

On 10/12/21 15:12, José Pekkarinen wrote:
> The patch will add a basic opensc package to build
> on buildroot.
> 
> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> ---
>   DEVELOPERS                                    |   1 +
>   package/Config.in                             |   1 +
>   .../0001-Fix-maybe-uninitialized-errors.patch |  81 ++++++++++
>   ...x-strict-aliasing-warnings-as-errors.patch | 150 ++++++++++++++++++
>   package/opensc/Config.in                      |  11 ++
>   package/opensc/opensc.hash                    |   5 +
>   package/opensc/opensc.mk                      |  14 ++
>   7 files changed, 263 insertions(+)
>   create mode 100644 package/opensc/0001-Fix-maybe-uninitialized-errors.patch
>   create mode 100644 package/opensc/0002-Fix-strict-aliasing-warnings-as-errors.patch
>   create mode 100644 package/opensc/Config.in
>   create mode 100644 package/opensc/opensc.hash
>   create mode 100644 package/opensc/opensc.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 3023526427..854f6f2084 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@unikie.com>
> +F:	package/opensc/
>   F:	package/softhsm2/
>   
>   N:	Joseph Kogut <joseph.kogut@gmail.com>
> diff --git a/package/Config.in b/package/Config.in
> index 57208309c4..b5907d7fa3 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1620,6 +1620,7 @@ menu "Hardware handling"
>   	source "package/mtdev/Config.in"
>   	source "package/ne10/Config.in"
>   	source "package/neardal/Config.in"
> +	source "package/opensc/Config.in"
>   	source "package/owfs/Config.in"
>   	source "package/pcsc-lite/Config.in"
>   	source "package/rpi-rgb-led-matrix/Config.in"
> diff --git a/package/opensc/0001-Fix-maybe-uninitialized-errors.patch b/package/opensc/0001-Fix-maybe-uninitialized-errors.patch
> new file mode 100644
> index 0000000000..17ef43a984
> --- /dev/null
> +++ b/package/opensc/0001-Fix-maybe-uninitialized-errors.patch
> @@ -0,0 +1,81 @@
> +From b74a624f21db3bfd45e0cb6ed017ceda9f29adfc Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen@unikie.com>
> +Date: Fri, 10 Dec 2021 13:54:26 +0200
> +Subject: [PATCH] Fix maybe uninitialized errors
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> +---
> + src/libopensc/pkcs15-coolkey.c  | 12 ++++++------
> + src/pkcs15init/pkcs15-asepcos.c |  2 +-
> + src/tools/opensc-explorer.c     |  2 +-
> + 3 files changed, 8 insertions(+), 8 deletions(-)
> +
> +diff --git a/src/libopensc/pkcs15-coolkey.c b/src/libopensc/pkcs15-coolkey.c
> +index 586475d..32a7674 100644
> +--- a/src/libopensc/pkcs15-coolkey.c
> ++++ b/src/libopensc/pkcs15-coolkey.c
> +@@ -147,9 +147,9 @@ coolkey_find_matching_cert(sc_card_t *card, sc_cardctl_coolkey_object_t *in_obj,
> + static int
> + coolkey_get_attribute_ulong(sc_card_t *card, sc_cardctl_coolkey_object_t *obj, CK_ATTRIBUTE_TYPE type, CK_ULONG *value)
> + {
> +-	const u8 *val;
> +-	size_t val_len;
> +-	u8 data_type;
> ++	const u8 *val = malloc(sizeof(u8));
> ++	size_t val_len = 0;
> ++	u8 data_type = 0;
> + 	int r;
> +
> + 	r  = coolkey_get_attribute(card, obj, type, &val, &val_len, &data_type);
> +@@ -168,8 +168,8 @@ static int
> + coolkey_get_attribute_boolean(sc_card_t *card, sc_cardctl_coolkey_object_t *obj, CK_ATTRIBUTE_TYPE attr_type)
> + {
> + 	int r;
> +-	const u8 *val;
> +-	size_t val_len;
> ++	const u8 *val = malloc(sizeof(u8));
> ++	size_t val_len = 0;
> +
> + 	r = coolkey_get_attribute(card, obj, attr_type, &val, &val_len, NULL);
> + 	if (r < 0) {
> +@@ -186,7 +186,7 @@ static int
> + coolkey_get_attribute_bytes(sc_card_t *card, sc_cardctl_coolkey_object_t *obj, CK_ATTRIBUTE_TYPE type, u8 *data, size_t *data_len, size_t max_data_len)
> + {
> + 	const u8 *val;
> +-	size_t val_len;
> ++	size_t val_len = 0;
> + 	int r;
> +
> + 	r = coolkey_get_attribute(card, obj, type, &val, &val_len, NULL);
> +diff --git a/src/pkcs15init/pkcs15-asepcos.c b/src/pkcs15init/pkcs15-asepcos.c
> +index d712201..bc0efb5 100644
> +--- a/src/pkcs15init/pkcs15-asepcos.c
> ++++ b/src/pkcs15init/pkcs15-asepcos.c
> +@@ -221,7 +221,7 @@ static int asepcos_do_store_pin(sc_profile_t *profile, sc_card_t *card,
> + {
> + 	sc_file_t *nfile = NULL;
> + 	u8  buf[64], sbuf[64], *p = buf, *q = sbuf;
> +-	int r, akn;
> ++	int r, akn = 0;
> +
> + 	if (auth_info->auth_type != SC_PKCS15_PIN_AUTH_TYPE_PIN)
> + 		return SC_ERROR_OBJECT_NOT_VALID;
> +diff --git a/src/tools/opensc-explorer.c b/src/tools/opensc-explorer.c
> +index d251495..749b163 100644
> +--- a/src/tools/opensc-explorer.c
> ++++ b/src/tools/opensc-explorer.c
> +@@ -2472,7 +2472,7 @@ int main(int argc, char *argv[])
> + 		char *line;
> + 		int cargc;
> + 		char *cargv[260];
> +-		int multiple;
> ++		int multiple = 0;
> + 		struct command *cmd;
> + 		char prompt[3*SC_MAX_PATH_STRING_SIZE];
> +
> +--
> +2.30.2
> +
> diff --git a/package/opensc/0002-Fix-strict-aliasing-warnings-as-errors.patch b/package/opensc/0002-Fix-strict-aliasing-warnings-as-errors.patch
> new file mode 100644
> index 0000000000..24cd1ff137
> --- /dev/null
> +++ b/package/opensc/0002-Fix-strict-aliasing-warnings-as-errors.patch
> @@ -0,0 +1,150 @@
> +From 5bb64ae9305bbe20bbf2f95dfdddb0966d7c9a50 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen@unikie.com>
> +Date: Fri, 10 Dec 2021 13:56:22 +0200
> +Subject: [PATCH] Fix strict aliasing warnings as errors
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> +---
> + src/libopensc/card-gids.c | 20 ++++++++++++--------
> + src/libopensc/card-gpk.c  | 11 ++++++-----
> + src/tools/gids-tool.c     |  3 ++-
> + 3 files changed, 20 insertions(+), 14 deletions(-)
> +
> +diff --git a/src/libopensc/card-gids.c b/src/libopensc/card-gids.c
> +index f25e37d..17901cd 100644
> +--- a/src/libopensc/card-gids.c
> ++++ b/src/libopensc/card-gids.c
> +@@ -691,7 +691,8 @@ static int gids_finish(sc_card_t *card)
> + // the cmap file is used to detect the key algorithm / size
> + static int gids_get_crypto_identifier_from_key_ref(sc_card_t *card, const unsigned char keyref, unsigned char *cryptoidentifier) {
> + 	struct gids_private_data *data = (struct gids_private_data *) card->drv_data;
> +-	PCONTAINER_MAP_RECORD records = (PCONTAINER_MAP_RECORD) data->cmapfile;
> ++	PCONTAINER_MAP_RECORD records = malloc(sizeof(CONTAINER_MAP_RECORD));
> ++	memcpy(records, data->cmapfile, sizeof(CONTAINER_MAP_RECORD));
> + 	int recordsnum = (int) (data->cmapfilesize / sizeof(CONTAINER_MAP_RECORD));
> + 	int index = keyref - GIDS_FIRST_KEY_IDENTIFIER;
> + 	if (index >= recordsnum) {
> +@@ -1112,10 +1113,10 @@ gids_get_all_containers(sc_card_t* card, size_t *recordsnum) {
> + // return the detail about a container to emulate a pkcs15 card
> + static int
> + gids_get_container_detail(sc_card_t* card, sc_cardctl_gids_get_container_t* container) {
> +-	PCONTAINER_MAP_RECORD records = NULL;
> ++	PCONTAINER_MAP_RECORD records = malloc(sizeof(CONTAINER_MAP_RECORD));
> + 	struct gids_private_data *privatedata = (struct gids_private_data *) card->drv_data;
> + 	size_t recordsnum, num, i;
> +-	records = (PCONTAINER_MAP_RECORD) privatedata ->cmapfile;
> ++	memcpy(records, privatedata->cmapfile, sizeof(CONTAINER_MAP_RECORD));
> + 	recordsnum = (privatedata ->cmapfilesize / sizeof(CONTAINER_MAP_RECORD));
> +
> + 	num = container->containernum ;
> +@@ -1158,7 +1159,8 @@ gids_get_container_detail(sc_card_t* card, sc_cardctl_gids_get_container_t* cont
> + static int
> + gids_select_key_reference(sc_card_t *card, sc_pkcs15_prkey_info_t* key_info) {
> + 	struct gids_private_data *data = (struct gids_private_data *) card->drv_data;
> +-	PCONTAINER_MAP_RECORD records = (PCONTAINER_MAP_RECORD) data->cmapfile;
> ++	PCONTAINER_MAP_RECORD records = malloc(sizeof(CONTAINER_MAP_RECORD));
> ++	memcpy(records, data->cmapfile, sizeof(CONTAINER_MAP_RECORD));
> + 	size_t recordsnum;
> + 	int r;
> + 	char ch_tmp[10];
> +@@ -1302,7 +1304,8 @@ static int gids_create_keyfile(sc_card_t *card, sc_pkcs15_object_t *object) {
> + 	struct gids_private_data *data = (struct gids_private_data *) card->drv_data;
> + 	size_t recordnum;
> + 	size_t containernum = key_info->key_reference - GIDS_FIRST_KEY_IDENTIFIER;
> +-	PCONTAINER_MAP_RECORD records = ((PCONTAINER_MAP_RECORD) cmapbuffer) + containernum;
> ++	PCONTAINER_MAP_RECORD records = malloc(sizeof(CONTAINER_MAP_RECORD));
> ++	memcpy(records, cmapbuffer + containernum, sizeof(CONTAINER_MAP_RECORD));
> + 	struct gids_keymap_record* keymaprecord = NULL;
> + 	int i;
> +
> +@@ -1390,12 +1393,12 @@ static int gids_create_keyfile(sc_card_t *card, sc_pkcs15_object_t *object) {
> +
> + 	// convert char to wchar
> + 	for(i = 0; i < MAX_CONTAINER_NAME_LEN && object->label[i]; i++) {
> +-		records->wszGuid[i] = object->label[i];
> ++		records->wszGuid[i] = (unsigned short) object->label[i];
> + 	}
> +
> + 	// TODO: check if a container with the same name already exists and prevent is creation or change its name
> +
> +-	records->bFlags = CONTAINER_MAP_VALID_CONTAINER;
> ++	records->bFlags = (unsigned char) CONTAINER_MAP_VALID_CONTAINER;
> + 	if (recordnum == 0) {
> + 		records->bFlags |= CONTAINER_MAP_DEFAULT_CONTAINER;
> + 	}
> +@@ -1638,7 +1641,8 @@ static int gids_delete_container_num(sc_card_t *card, size_t containernum) {
> + 	size_t keymaprecordnum = 0;
> + 	struct gids_private_data *data = (struct gids_private_data *) card->drv_data;
> + 	size_t recordnum;
> +-	PCONTAINER_MAP_RECORD records = ((PCONTAINER_MAP_RECORD) cmapbuffer) + containernum;
> ++	PCONTAINER_MAP_RECORD records = malloc(sizeof(CONTAINER_MAP_RECORD));
> ++	memcpy(records, cmapbuffer + containernum, sizeof(CONTAINER_MAP_RECORD));
> + 	struct gids_keymap_record* keymaprecord = NULL;
> +
> + 	SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
> +diff --git a/src/libopensc/card-gpk.c b/src/libopensc/card-gpk.c
> +index 983ab5b..8afb0ee 100644
> +--- a/src/libopensc/card-gpk.c
> ++++ b/src/libopensc/card-gpk.c
> +@@ -228,11 +228,12 @@ static int
> + match_path(sc_card_t *card, unsigned short int **pathptr, size_t *pathlen,
> + 		int need_info)
> + {
> +-	unsigned short int	*curptr, *ptr;
> ++	u8			*curptr;
> ++	unsigned short int	*ptr;
> + 	size_t		curlen, len;
> + 	size_t		i;
> +
> +-	curptr = (unsigned short int *) card->cache.current_path.value;
> ++	curptr = (u8 *) card->cache.current_path.value;
> + 	curlen = card->cache.current_path.len;
> + 	ptr    = *pathptr;
> + 	len    = *pathlen;
> +@@ -242,7 +243,7 @@ match_path(sc_card_t *card, unsigned short int **pathptr, size_t *pathlen,
> +
> + 	/* Make sure path starts with MF.
> + 	 * Note the cached path should always begin with MF. */
> +-	if (ptr[0] != GPK_FID_MF || curptr[0] != GPK_FID_MF)
> ++	if (ptr[0] != (GPK_FID_MF >> 8) || curptr[0] != (GPK_FID_MF >> 8))
> + 		return 0;
> +
> + 	for (i = 1; i < len && i < curlen; i++) {
> +@@ -545,7 +546,7 @@ gpk_select_id(sc_card_t *card, int kind, unsigned int fid,
> + 	/* Fix up the path cache.
> + 	 * NB we never cache the ID of an EF, just the DF path */
> + 	if (r == 0) {
> +-		unsigned short int	*path;
> ++		u8	*path;
> +
> + 		switch (kind) {
> + 		case GPK_SEL_MF:
> +@@ -555,7 +556,7 @@ gpk_select_id(sc_card_t *card, int kind, unsigned int fid,
> + 			if (cp->len + 1 > SC_MAX_PATH_SIZE / 2) {
> + 				return SC_ERROR_INTERNAL;
> + 			}
> +-			path = (unsigned short int *) cp->value;
> ++			path = (u8 *) cp->value;
> + 			path[cp->len++] = fid;
> + 		}
> + 	} else {
> +diff --git a/src/tools/gids-tool.c b/src/tools/gids-tool.c
> +index 1c9602b..eed4296 100644
> +--- a/src/tools/gids-tool.c
> ++++ b/src/tools/gids-tool.c
> +@@ -401,7 +401,8 @@ static int print_info(sc_card_t *card) {
> + 		if (cmapfilesize == sizeof(cmapfile)) {
> + 			printf("Unable to find the container file (mscp\\cmapfile)\n");
> + 		} else {
> +-			PCONTAINER_MAP_RECORD cmaprecords = (PCONTAINER_MAP_RECORD) cmapfile;
> ++			PCONTAINER_MAP_RECORD cmaprecords = malloc(sizeof(CONTAINER_MAP_RECORD));
> ++			memcpy(cmaprecords, cmapfile, sizeof(CONTAINER_MAP_RECORD));
> + 			int cmaprecordnum = (cmapfilesize / sizeof(CONTAINER_MAP_RECORD));
> + 			int keymaprecordnum = -1;
> + 			struct gids_keymap_record* keymaprecord = ((struct gids_keymap_record*)(keymap +1));
> +--
> +2.30.2
> +
> diff --git a/package/opensc/Config.in b/package/opensc/Config.in
> new file mode 100644
> index 0000000000..d6b137a87f
> --- /dev/null
> +++ b/package/opensc/Config.in
> @@ -0,0 +1,11 @@
> +config BR2_PACKAGE_OPENSC
> +	bool "opensc"
> +	depends on !BR2_STATIC_LIBS # dlopen()
> +	select BR2_PACKAGE_PCSC_LITE
> +	select BR2_PACKAGE_OPENSSL
> +	select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL
> +	help
> +	  OpenSC provides a set of libraries and utilities to work
> +	  with smart cards.
> +
> +	  https://github.com/OpenSC/OpenSC/wiki
> diff --git a/package/opensc/opensc.hash b/package/opensc/opensc.hash
> new file mode 100644
> index 0000000000..1e3472ba2a
> --- /dev/null
> +++ b/package/opensc/opensc.hash
> @@ -0,0 +1,5 @@
> +# From https://https://github.com/OpenSC/OpenSC/releases/
> +sha256  8d4e5347195ebea332be585df61dcc470331c26969e4b0447c851fb0844c7186  opensc-0.22.0.tar.gz
> +
> +# Computed locally
> +sha256  376b54d4c5f4aa99421823fa4da93e3ab73096fce2400e89858632aa7da24a14  COPYING
> diff --git a/package/opensc/opensc.mk b/package/opensc/opensc.mk
> new file mode 100644
> index 0000000000..7221eee944
> --- /dev/null
> +++ b/package/opensc/opensc.mk
> @@ -0,0 +1,14 @@
> +################################################################################
> +#
> +# opensc
> +#
> +################################################################################
> +
> +OPENSC_VERSION = 0.22.0
> +OPENSC_SITE = https://github.com/OpenSC/OpenSC/releases/download/$(OPENSC_VERSION)

Please use github wrapper ^^^

> +OPENSC_LICENSE = LGPL-2.1+
> +OPENSC_LICENSE_FILES = COPYING
> +OPENSC_DEPENDENCIES = openssl pcsc-lite
> +OPENSC_INSTALL_STAGING = YES

Do we need to install to staging?

> +
> +$(eval $(autotools-package))
> 

Best regards
-- 
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 3/7] package/bmx7: new package
  2021-12-10 14:12 ` [Buildroot] [PATCH 3/7] package/bmx7: " José Pekkarinen
@ 2021-12-10 14:52   ` Giulio Benetti
  2021-12-10 20:07   ` Yann E. MORIN
  2022-01-05 22:23   ` Thomas Petazzoni
  2 siblings, 0 replies; 39+ messages in thread
From: Giulio Benetti @ 2021-12-10 14:52 UTC (permalink / raw)
  To: José Pekkarinen, buildroot

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@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@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@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@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@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@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@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@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
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 4/7] package/alfred: new package
  2021-12-10 14:12 ` [Buildroot] [PATCH 4/7] package/alfred: " José Pekkarinen
@ 2021-12-10 14:54   ` Giulio Benetti
  2022-01-05 22:43   ` Thomas Petazzoni
  1 sibling, 0 replies; 39+ messages in thread
From: Giulio Benetti @ 2021-12-10 14:54 UTC (permalink / raw)
  To: José Pekkarinen, buildroot

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

Reword ^^^

> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> ---
>   DEVELOPERS                 |  1 +
>   package/Config.in          |  1 +
>   package/alfred/Config.in   | 20 ++++++++++++++++++++
>   package/alfred/alfred.hash |  4 ++++
>   package/alfred/alfred.mk   | 25 +++++++++++++++++++++++++
>   5 files changed, 51 insertions(+)
>   create mode 100644 package/alfred/Config.in
>   create mode 100644 package/alfred/alfred.hash
>   create mode 100644 package/alfred/alfred.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index e3e48522aa..0e4db835d3 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@unikie.com>
> +F:	package/alfred/
>   F:	package/bmx7/
>   F:	package/minijail/
>   F:	package/opensc/
> diff --git a/package/Config.in b/package/Config.in
> index 55ba0ded13..b857e18976 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -2112,6 +2112,7 @@ endmenu
>   
>   menu "Networking applications"
>   	source "package/aircrack-ng/Config.in"
> +	source "package/alfred/Config.in"
>   	source "package/aoetools/Config.in"
>   	source "package/apache/Config.in"
>   	source "package/argus/Config.in"
> diff --git a/package/alfred/Config.in b/package/alfred/Config.in
> new file mode 100644
> index 0000000000..5f9c6f2a6e
> --- /dev/null
> +++ b/package/alfred/Config.in
> @@ -0,0 +1,20 @@
> +config BR2_PACKAGE_ALFRED
> +	bool "alfred"
> +	depends on !BR2_STATIC_LIBS # dlopen()
> +	select BR2_PACKAGE_LIBNL
> +	select BR2_PACKAGE_LIBCAP
> +	select BR2_PACKAGE_GPSD
> +	help
> +	  Alfred is a user space daemon for distributing
> +	  arbitrary local information over the mesh/network in
> +	  a decentralized fashion.
> +	  This data can be anything which appears to be useful
> +	  - originally designed to replace the batman-adv
> +	  visualization (vis), you may distribute hostnames,
> +	  phone books, administration information, DNS
> +	  information, the local weather forecast ...
> +
> +	  https://www.open-mesh.org/projects/alfred/wiki
> +
> +comment "alfred needs a toolchain with dynamic library support"
> +	depends on BR2_STATIC_LIBS
> diff --git a/package/alfred/alfred.hash b/package/alfred/alfred.hash
> new file mode 100644
> index 0000000000..a2dd0116d7
> --- /dev/null
> +++ b/package/alfred/alfred.hash
> @@ -0,0 +1,4 @@
> +# From https://downloads.open-mesh.org/batman/stable/sources/alfred

sha256 file ^^^

> +sha256  4c79b6c45de4bcc8cbfe64cba9a0f8b4ef304ca84c194622f2bfa41e01e2cb95  alfred-2021.4.tar.gz
> +# Locally computed
> +sha256  cecbf53d1148e13256ac29f8b900655b7fc8dc12d59939a95bc2323ea1747025  LICENSES/preferred/GPL-2.0
> diff --git a/package/alfred/alfred.mk b/package/alfred/alfred.mk
> new file mode 100644
> index 0000000000..4e38ddad92
> --- /dev/null
> +++ b/package/alfred/alfred.mk
> @@ -0,0 +1,25 @@
> +################################################################################
> +#
> +# alfred
> +#
> +################################################################################
> +
> +ALFRED_VERSION = 2021.4
> +ALFRED_SITE = https://downloads.open-mesh.org/batman/stable/sources/alfred
> +ALFRED_LICENSE = GPL-2
> +ALFRED_LICENSE_FILES = LICENSES/preferred/GPL-2.0
> +ALFRED_DEPENDENCIES = libnl libcap gpsd
> +
> +define ALFRED_BUILD_CMDS
> +	(cd $(@D); \
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/$(d) CC="$(TARGET_CC)")
> +endef
> +
> +define ALFRED_INSTALL_TARGET_CMDS
> +	$(INSTALL) -m 0755 -D $(@D)/alfred \
> +		$(TARGET_DIR)/usr/bin/alfred
> +	$(INSTALL) -m 0755 -D $(@D)/vis/batadv-vis \
> +		$(TARGET_DIR)/usr/bin/batadv-vis
> +endef
> +
> +$(eval $(generic-package))
> 

Best regards
-- 
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 5/7] package/aexpect: new package
  2021-12-10 14:12 ` [Buildroot] [PATCH 5/7] package/aexpect: " José Pekkarinen
@ 2021-12-10 14:56   ` Giulio Benetti
  2021-12-10 20:11   ` Yann E. MORIN
  2022-01-06  8:40   ` Thomas Petazzoni
  2 siblings, 0 replies; 39+ messages in thread
From: Giulio Benetti @ 2021-12-10 14:56 UTC (permalink / raw)
  To: José Pekkarinen, buildroot

On 10/12/21 15:12, José Pekkarinen wrote:
> Add package to avocado framework's aexpect.

Reword

> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> ---
>   DEVELOPERS                   |  1 +
>   package/Config.in            |  1 +
>   package/aexpect/Config.in    | 12 ++++++++++++
>   package/aexpect/aexpect.hash |  4 ++++
>   package/aexpect/aexpect.mk   | 13 +++++++++++++
>   5 files changed, 31 insertions(+)
>   create mode 100644 package/aexpect/Config.in
>   create mode 100644 package/aexpect/aexpect.hash
>   create mode 100644 package/aexpect/aexpect.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 0e4db835d3..b8097556f8 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@unikie.com>
> +F:	package/aexpect/
>   F:	package/alfred/
>   F:	package/bmx7/
>   F:	package/minijail/
> diff --git a/package/Config.in b/package/Config.in
> index b857e18976..5395d8dd49 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -154,6 +154,7 @@ menu "Debugging, profiling and benchmark"
>   endmenu
>   
>   menu "Development tools"
> +	source "package/aexpect/Config.in"
>   	source "package/bats-core/Config.in"
>   	source "package/binutils/Config.in"
>   	source "package/bitwise/Config.in"
> diff --git a/package/aexpect/Config.in b/package/aexpect/Config.in
> new file mode 100644
> index 0000000000..efa2be8b91
> --- /dev/null
> +++ b/package/aexpect/Config.in
> @@ -0,0 +1,12 @@
> +config BR2_PACKAGE_AEXPECT
> +	bool "aexpect"
> +	depends on !BR2_STATIC_LIBS # dlopen()
> +	select BR2_PACKAGE_PYTHON
> +	help
> +	  This module provides services similar to
> +	  the pexpect python library, so to speak,
> +	  spawn and control interactive applications,
> +	  such as ssh, sftp and others.
> +
> +comment "aexpect needs a toolchain with dynamic library support"
> +	depends on BR2_STATIC_LIBS
> diff --git a/package/aexpect/aexpect.hash b/package/aexpect/aexpect.hash
> new file mode 100644
> index 0000000000..4a47da4121
> --- /dev/null
> +++ b/package/aexpect/aexpect.hash
> @@ -0,0 +1,4 @@
> +# From https://files.pythonhosted.org/packages/d0/fa/5ba16ca17a70980c7c09ea1c8d748aace1ee8772d032c483add0e17d0cf6

sha256 file ^^^

> +sha256  54abae31e7d3b7afbfb7a019756907a81d40be4422788bccf20d2e82ad6ef8c8  aexpect-1.6.3.tar.gz
> +# Locally computed
> +sha256  7be26abf35e531a226dc742d2379d42d372cb61f027a6e26477c0e2f1a03bfcb  LICENSE
> diff --git a/package/aexpect/aexpect.mk b/package/aexpect/aexpect.mk
> new file mode 100644
> index 0000000000..ca2097328a
> --- /dev/null
> +++ b/package/aexpect/aexpect.mk
> @@ -0,0 +1,13 @@
> +################################################################################
> +#
> +# aexpect
> +#
> +################################################################################
> +
> +AEXPECT_VERSION = 1.6.3
> +AEXPECT_SITE = https://files.pythonhosted.org/packages/d0/fa/5ba16ca17a70980c7c09ea1c8d748aace1ee8772d032c483add0e17d0cf6
> +AEXPECT_SETUP_TYPE = setuptools
> +AEXPECT_LICENSE = GPL-2.0
> +AEXPECT_LICENSE_FILES = LICENSE
> +
> +$(eval $(python-package))
> 

Best regards
-- 
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 6/7] package/avocado: new package
  2021-12-10 14:12 ` [Buildroot] [PATCH 6/7] package/avocado: " José Pekkarinen
@ 2021-12-10 14:57   ` Giulio Benetti
  2022-07-26  8:13   ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 39+ messages in thread
From: Giulio Benetti @ 2021-12-10 14:57 UTC (permalink / raw)
  To: José Pekkarinen, buildroot

On 10/12/21 15:12, José Pekkarinen wrote:
> This patch adds a basic package for
> avocado framework.

Reword

> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> ---
>   DEVELOPERS                   |  1 +
>   package/Config.in            |  1 +
>   package/avocado/Config.in    | 13 +++++++++++++
>   package/avocado/avocado.hash |  4 ++++
>   package/avocado/avocado.mk   | 14 ++++++++++++++
>   5 files changed, 33 insertions(+)
>   create mode 100644 package/avocado/Config.in
>   create mode 100644 package/avocado/avocado.hash
>   create mode 100644 package/avocado/avocado.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index b8097556f8..3ff6abb2af 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1466,6 +1466,7 @@ F:	support/testing/tests/package/test_zfs.py
>   N:	José Pekkarinen <jose.pekkarinen@unikie.com>
>   F:	package/aexpect/
>   F:	package/alfred/
> +F:	package/avocado/
>   F:	package/bmx7/
>   F:	package/minijail/
>   F:	package/opensc/
> diff --git a/package/Config.in b/package/Config.in
> index 5395d8dd49..c5d270a7fd 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -155,6 +155,7 @@ endmenu
>   
>   menu "Development tools"
>   	source "package/aexpect/Config.in"
> +	source "package/avocado/Config.in"
>   	source "package/bats-core/Config.in"
>   	source "package/binutils/Config.in"
>   	source "package/bitwise/Config.in"
> diff --git a/package/avocado/Config.in b/package/avocado/Config.in
> new file mode 100644
> index 0000000000..402a639969
> --- /dev/null
> +++ b/package/avocado/Config.in
> @@ -0,0 +1,13 @@
> +config BR2_PACKAGE_AVOCADO
> +	bool "avocado"
> +	depends on !BR2_STATIC_LIBS # dlopen()
> +	select BR2_PACKAGE_LIBFFI
> +	select BR2_PACKAGE_PYTHON3
> +	help
> +	  Avocado is an automated testing suite containing
> +	  tests for various subsystems.
> +
> +	  https://avocado-framework.readthedocs.io/
> +
> +comment "avocado needs a toolchain with dynamic library support"
> +	depends on BR2_STATIC_LIBS
> diff --git a/package/avocado/avocado.hash b/package/avocado/avocado.hash
> new file mode 100644
> index 0000000000..257ee5d5ae
> --- /dev/null
> +++ b/package/avocado/avocado.hash
> @@ -0,0 +1,4 @@
> +# From https://github.com/avocado-framework/avocado/archive/refs/tags

sha256 file ^^^

> +sha256  b7a35552cd0f0d8e4b3aa4bb7009ce9e474a40c1cd111698ed03da90d71a2f4b  93.0.tar.gz
> +# Locally computed
> +sha256  680ce56e9c4043826f0f1420935d2453ea3ddacd1582cb6f1cef26c1077fcc93  LICENSE
> diff --git a/package/avocado/avocado.mk b/package/avocado/avocado.mk
> new file mode 100644
> index 0000000000..8474fa48c8
> --- /dev/null
> +++ b/package/avocado/avocado.mk
> @@ -0,0 +1,14 @@
> +################################################################################
> +#
> +# avocado-framework
> +#
> +################################################################################
> +
> +AVOCADO_VERSION = 93.0
> +AVOCADO_SOURCE = $(AVOCADO_VERSION).tar.gz
> +AVOCADO_SITE = https://github.com/avocado-framework/avocado/archive/refs/tags
> +AVOCADO_SETUP_TYPE = setuptools
> +AVOCADO_LICENSE = Apache-2.0
> +AVOCADO_LICENSE_FILES = LICENSE
> +
> +$(eval $(python-package))
> 

Best regards
-- 
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 7/7] package/avocado-vt: new package
  2021-12-10 14:12 ` [Buildroot] [PATCH 7/7] package/avocado-vt: " José Pekkarinen
@ 2021-12-10 15:00   ` Giulio Benetti
  2022-07-26  8:21   ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 39+ messages in thread
From: Giulio Benetti @ 2021-12-10 15:00 UTC (permalink / raw)
  To: José Pekkarinen, buildroot

On 10/12/21 15:12, José Pekkarinen wrote:
> This patch adds a basic package for avocado-vt
> plugin.

Reword

> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> ---
>   DEVELOPERS                         |  1 +
>   package/Config.in                  |  1 +
>   package/avocado-vt/Config.in       | 13 +++++++++++++
>   package/avocado-vt/avocado-vt.hash |  4 ++++
>   package/avocado-vt/avocado-vt.mk   | 14 ++++++++++++++
>   5 files changed, 33 insertions(+)
>   create mode 100644 package/avocado-vt/Config.in
>   create mode 100644 package/avocado-vt/avocado-vt.hash
>   create mode 100644 package/avocado-vt/avocado-vt.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 3ff6abb2af..d258b46117 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1467,6 +1467,7 @@ N:	José Pekkarinen <jose.pekkarinen@unikie.com>
>   F:	package/aexpect/
>   F:	package/alfred/
>   F:	package/avocado/
> +F:	package/avocado-vt/
>   F:	package/bmx7/
>   F:	package/minijail/
>   F:	package/opensc/
> diff --git a/package/Config.in b/package/Config.in
> index c5d270a7fd..cdc0b437b3 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -156,6 +156,7 @@ endmenu
>   menu "Development tools"
>   	source "package/aexpect/Config.in"
>   	source "package/avocado/Config.in"
> +	source "package/avocado-vt/Config.in"
>   	source "package/bats-core/Config.in"
>   	source "package/binutils/Config.in"
>   	source "package/bitwise/Config.in"
> diff --git a/package/avocado-vt/Config.in b/package/avocado-vt/Config.in
> new file mode 100644
> index 0000000000..5fbfd278cd
> --- /dev/null
> +++ b/package/avocado-vt/Config.in
> @@ -0,0 +1,13 @@
> +config BR2_PACKAGE_AVOCADO_VT
> +	bool "avocado-vt"
> +	depends on !BR2_STATIC_LIBS # dlopen()
> +	select BR2_PACKAGE_LIBFFI
> +	select BR2_PACKAGE_PYTHON3
> +	help
> +	  Avocado VT is a virtualization test plugin for avocado test
> +	  framework.
> +
> +	  https://avocado-vt.readthedocs.io/
> +
> +comment "avocado-vt needs a toolchain with dynamic library support"
> +	depends on BR2_STATIC_LIBS
> diff --git a/package/avocado-vt/avocado-vt.hash b/package/avocado-vt/avocado-vt.hash
> new file mode 100644
> index 0000000000..f5b8a22f08
> --- /dev/null
> +++ b/package/avocado-vt/avocado-vt.hash
> @@ -0,0 +1,4 @@
> +# From https://github.com/avocado-framework/avocado-vt/archive/refs/tags

sha256 file ^^^

> +sha256  50b5735a9b445cea64ffa7929ca990b63a55976412a9456e65cb2d365e0177fc  93.0.tar.gz
> +# Locally computed
> +sha256  17be6b5c4a7ec639ae3ce1a5c0a5a61d602365e3c4bb3568493948392053b70c  LICENSE
> diff --git a/package/avocado-vt/avocado-vt.mk b/package/avocado-vt/avocado-vt.mk
> new file mode 100644
> index 0000000000..d54a207da0
> --- /dev/null
> +++ b/package/avocado-vt/avocado-vt.mk
> @@ -0,0 +1,14 @@
> +################################################################################
> +#
> +# avocado-vt
> +#
> +################################################################################
> +
> +AVOCADO_VT_VERSION = 93.0
> +AVOCADO_VT_SOURCE = $(AVOCADO_VT_VERSION).tar.gz
> +AVOCADO_VT_SITE = https://github.com/avocado-framework/avocado-vt/archive/refs/tags
> +AVOCADO_VT_SETUP_TYPE = setuptools
> +AVOCADO_VT_LICENSE = Apache-2.0
> +AVOCADO_VT_LICENSE_FILES = LICENSE
> +
> +$(eval $(python-package))
> 

Have you given a go with "./utils/test-pkg -p <package> -a" for every 
package in the patchset? It takes some time but this way we should be 
safer than testing without "-a" flash or without test-pkg at all.

Now let's wait for someone's else comment :-)

Thank you!

Best regards
-- 
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 1/7] package/opensc: new package
  2021-12-10 14:49 ` Giulio Benetti
@ 2021-12-10 17:06   ` Yann E. MORIN
  0 siblings, 0 replies; 39+ messages in thread
From: Yann E. MORIN @ 2021-12-10 17:06 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: José Pekkarinen, buildroot

Giulio, All,

On 2021-12-10 15:49 +0100, Giulio Benetti spake thusly:
> On 10/12/21 15:12, José Pekkarinen wrote:
> >The patch will add a basic opensc package to build
> >on buildroot.
[--SNIP--]
> >diff --git a/package/opensc/opensc.mk b/package/opensc/opensc.mk
> >new file mode 100644
> >index 0000000000..7221eee944
> >--- /dev/null
> >+++ b/package/opensc/opensc.mk
> >@@ -0,0 +1,14 @@
> >+################################################################################
> >+#
> >+# opensc
> >+#
> >+################################################################################
> >+
> >+OPENSC_VERSION = 0.22.0
> >+OPENSC_SITE = https://github.com/OpenSC/OpenSC/releases/download/$(OPENSC_VERSION)
> Please use github wrapper ^^^

Actually, no. The github helper is only to download arbitrary hashes and
tags, where the archives are generated on the fly by Github.

In the case of opensc, there are actual releases, which were uploaded to
Gihub by the opensc maintainer, and so this is the archive we want to
use, not the autogenerated one.

> >+OPENSC_LICENSE = LGPL-2.1+
> >+OPENSC_LICENSE_FILES = COPYING
> >+OPENSC_DEPENDENCIES = openssl pcsc-lite
> >+OPENSC_INSTALL_STAGING = YES
> Do we need to install to staging?

OpenSC installs at least one library, libopensc, so presumably, yes, we
need to install in staging...

Regards,
Yann E. MORIN.

> >+
> >+$(eval $(autotools-package))
> >
> 
> Best regards
> -- 
> Giulio Benetti
> Benetti Engineering sas
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 1/7] package/opensc: new package
  2021-12-10 14:32 ` [Buildroot] [PATCH 1/7] package/opensc: " Giulio Benetti
@ 2021-12-10 17:34   ` Yann E. MORIN
  0 siblings, 0 replies; 39+ messages in thread
From: Yann E. MORIN @ 2021-12-10 17:34 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: José Pekkarinen, buildroot

José, All,

On 2021-12-10 15:32 +0100, Giulio Benetti spake thusly:
> > Il giorno 10 dic 2021, alle ore 15:12, José Pekkarinen <jose.pekkarinen@unikie.com> ha scritto:
> > 
> > The patch will add a basic opensc package to build
> > on buildroot.
> 
> Please as pointed previously reword like this:
> “This patch adds opensc package”

Yes, please use the present form.

Additionally, we like that the commit log explains the packaging, like
the reason for the patches for example.

> > Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> > ---
[--SNIP--]
> > diff --git a/package/opensc/0001-Fix-maybe-uninitialized-errors.patch b/package/opensc/0001-Fix-maybe-uninitialized-errors.patch
> > new file mode 100644
> > index 0000000000..17ef43a984
> > --- /dev/null
> > +++ b/package/opensc/0001-Fix-maybe-uninitialized-errors.patch
> > @@ -0,0 +1,81 @@
> > +From b74a624f21db3bfd45e0cb6ed017ceda9f29adfc Mon Sep 17 00:00:00 2001
> > +From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen@unikie.com>
> > +Date: Fri, 10 Dec 2021 13:54:26 +0200
> > +Subject: [PATCH] Fix maybe uninitialized errors
> > +MIME-Version: 1.0
> > +Content-Type: text/plain; charset=UTF-8
> > +Content-Transfer-Encoding: 8bit
> > +
> 
> Here commit log is missing. In the case it is trivial, please repeat the summary in the commit log body, like:
> “Fix maybe uninitialized errors”

Also, please submit those changes upstream; if that's already done, then
add an URL to the upstream PR/MR. If this is is a backport, then say so
and point to the upstream commit (b74a624f21db3bfd45e0cb6ed017ceda9f29adfc
does not appear to be an upstream commit).

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 2/7] package/minijail: new package
  2021-12-10 14:48   ` Giulio Benetti
@ 2021-12-10 18:15     ` Arnout Vandecappelle
  2021-12-10 20:26       ` Giulio Benetti
  0 siblings, 1 reply; 39+ messages in thread
From: Arnout Vandecappelle @ 2021-12-10 18:15 UTC (permalink / raw)
  To: Giulio Benetti, José Pekkarinen, buildroot



On 10/12/2021 15:48, Giulio Benetti wrote:
> Hi José,
> 
> On 10/12/21 15:12, José Pekkarinen wrote:
>> This patch adds a new package for minijail.
> 
> Reword "This patch add package minijail"

  Actually, no. For something this simple, it's better to leave the body empty 
(i.e. just the SoB), because the subject says it all already.

  Regards,
  Arnout
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 2/7] package/minijail: new package
  2021-12-10 14:12 ` [Buildroot] [PATCH 2/7] package/minijail: " José Pekkarinen
  2021-12-10 14:48   ` Giulio Benetti
@ 2021-12-10 19:57   ` Yann E. MORIN
  2022-01-05 20:41   ` Thomas Petazzoni
  2 siblings, 0 replies; 39+ messages in thread
From: Yann E. MORIN @ 2021-12-10 19:57 UTC (permalink / raw)
  To: José Pekkarinen; +Cc: buildroot

José, All,

On 2021-12-10 16:12 +0200, José Pekkarinen spake thusly:
[--SNIP--]
> diff --git a/package/minijail/Config.in b/package/minijail/Config.in
> new file mode 100644
> index 0000000000..02868ef09c
> --- /dev/null
> +++ b/package/minijail/Config.in
> @@ -0,0 +1,12 @@
> +config BR2_PACKAGE_MINIJAIL
> +	bool "minijail"
> +	depends on !BR2_STATIC_LIBS # dlopen()
> +	select BR2_PACKAGE_HOST_LIBCAP

Why does a target pacakge select a host library?

Anywat, BR2_PACKAGE_HOST_LIBCAP does not exist, and your patch series
does not add it either. So this is totally useless.

Regards,
Yann E. MORIN.

> +	select BR2_PACKAGE_LIBCAP
> +	help
> +	  Minijail is a sandboxing tool maintained by google.
> +
> +	  https://google.github.io/minijail/
> +
> +comment "minijail needs a toolchain with dynamic library support"
> +	depends on BR2_STATIC_LIBS
> diff --git a/package/minijail/minijail.hash b/package/minijail/minijail.hash
> new file mode 100644
> index 0000000000..227a77fcf5
> --- /dev/null
> +++ b/package/minijail/minijail.hash
> @@ -0,0 +1,5 @@
> +# From https://github.com/google/minijail/releases/
> +sha256  1ee5a5916491a32c121c7422b4d8c16481c0396a3acab34bf1c44589dcf810ae  linux-v17.tar.gz
> +
> +# Locally computed
> +sha256  c6f439c5cf07263f71f01d29b79c79172ee529088e51ab434b22baad0988fe57  LICENSE
> diff --git a/package/minijail/minijail.mk b/package/minijail/minijail.mk
> new file mode 100644
> index 0000000000..bc72421b0c
> --- /dev/null
> +++ b/package/minijail/minijail.mk
> @@ -0,0 +1,28 @@
> +################################################################################
> +#
> +# minijail
> +#
> +################################################################################
> +
> +MINIJAIL_VERSION = linux-v17
> +MINIJAIL_SOURCE = $(MINIJAIL_VERSION).tar.gz
> +MINIJAIL_SITE = "https://github.com/google/minijail/archive/refs/tags"
> +MINIJAIL_LICENSE = BSD-Style
> +MINIJAIL_LICENSE_FILES = LICENSE
> +MINIJAIL_DEPENDENCIES=libcap host-libcap
> +
> +define MINIJAIL_BUILD_CMDS
> +	(cd $(@D); \
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/$(d) CC="$(TARGET_CC)")

There is no need to enclose the command in parentheses. That other
packages do it is purely historical baggage.

Regards,
Yann E. MORIN.

> +endef
> +
> +define MINIJAIL_INSTALL_TARGET_CMDS
> +	$(INSTALL) -m 0755 -D $(@D)/minijail0 \
> +		$(TARGET_DIR)/usr/bin/minijail0
> +	$(INSTALL) -m 0755 -D $(@D)/libminijailpreload.so \
> +		$(TARGET_DIR)/lib/libminijailpreload.so
> +	$(INSTALL) -m 0755 -D $(@D)/libminijail.so \
> +		$(TARGET_DIR)/lib/libminijail.so
> +endef
> +
> +$(eval $(generic-package))
> -- 
> 2.30.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 3/7] package/bmx7: new package
  2021-12-10 14:12 ` [Buildroot] [PATCH 3/7] package/bmx7: " José Pekkarinen
  2021-12-10 14:52   ` Giulio Benetti
@ 2021-12-10 20:07   ` Yann E. MORIN
  2022-01-05 22:23   ` Thomas Petazzoni
  2 siblings, 0 replies; 39+ messages in thread
From: Yann E. MORIN @ 2021-12-10 20:07 UTC (permalink / raw)
  To: José Pekkarinen; +Cc: buildroot

José, All,

On 2021-12-10 16:12 +0200, José Pekkarinen spake thusly:
> This patch will provide an initial package
> for bmx7 project.
> 
> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
[--SNIP--]
> 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

You can't select BR2_PACKAGE_LIBZLIB, because it is an entry of a
choice.

If your package can work with any zlib, then selecting BR2_PACKAGE_ZLIB
as you did is enough. But if your package really require the original
zlib, then you must depend on BR2_PACKAGE_LIBZLIB (and not select
BR2_PACKAGE_ZLIB).

[--SNIP--]
> 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)")

Again, no need for the enclosing parentheses.

Regards,
Yann E. MORIN.

> +endef
> +
> +define BMX7_INSTALL_TARGET_CMDS
> +	$(INSTALL) -m 0755 -D $(@D)/src/bmx7 $(TARGET_DIR)/usr/bin/bmx7
> +endef
> +
> +$(eval $(generic-package))
> -- 
> 2.30.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 5/7] package/aexpect: new package
  2021-12-10 14:12 ` [Buildroot] [PATCH 5/7] package/aexpect: " José Pekkarinen
  2021-12-10 14:56   ` Giulio Benetti
@ 2021-12-10 20:11   ` Yann E. MORIN
  2021-12-11  8:43     ` Arnout Vandecappelle
  2022-01-06  8:40   ` Thomas Petazzoni
  2 siblings, 1 reply; 39+ messages in thread
From: Yann E. MORIN @ 2021-12-10 20:11 UTC (permalink / raw)
  To: José Pekkarinen; +Cc: buildroot

José, All,

On 2021-12-10 16:12 +0200, José Pekkarinen spake thusly:
> Add package to avocado framework's aexpect.
> 
> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
[--SNIP--]
> diff --git a/package/aexpect/Config.in b/package/aexpect/Config.in
> new file mode 100644
> index 0000000000..efa2be8b91
> --- /dev/null
> +++ b/package/aexpect/Config.in
> @@ -0,0 +1,12 @@
> +config BR2_PACKAGE_AEXPECT
> +	bool "aexpect"
> +	depends on !BR2_STATIC_LIBS # dlopen()
> +	select BR2_PACKAGE_PYTHON

Do not select python, depend on it.

Also python in Buildroot is python 2. We are trying to get rid of it.
Is aexpect really only supporting python2? If so, this is a bit
unfortuante...

But since it require 2to6, maybe it works with python3 too?

Regards,
Yann E. MORIN.

> +	help
> +	  This module provides services similar to
> +	  the pexpect python library, so to speak,
> +	  spawn and control interactive applications,
> +	  such as ssh, sftp and others.
> +
> +comment "aexpect needs a toolchain with dynamic library support"
> +	depends on BR2_STATIC_LIBS
> diff --git a/package/aexpect/aexpect.hash b/package/aexpect/aexpect.hash
> new file mode 100644
> index 0000000000..4a47da4121
> --- /dev/null
> +++ b/package/aexpect/aexpect.hash
> @@ -0,0 +1,4 @@
> +# From https://files.pythonhosted.org/packages/d0/fa/5ba16ca17a70980c7c09ea1c8d748aace1ee8772d032c483add0e17d0cf6
> +sha256  54abae31e7d3b7afbfb7a019756907a81d40be4422788bccf20d2e82ad6ef8c8  aexpect-1.6.3.tar.gz
> +# Locally computed
> +sha256  7be26abf35e531a226dc742d2379d42d372cb61f027a6e26477c0e2f1a03bfcb  LICENSE
> diff --git a/package/aexpect/aexpect.mk b/package/aexpect/aexpect.mk
> new file mode 100644
> index 0000000000..ca2097328a
> --- /dev/null
> +++ b/package/aexpect/aexpect.mk
> @@ -0,0 +1,13 @@
> +################################################################################
> +#
> +# aexpect
> +#
> +################################################################################
> +
> +AEXPECT_VERSION = 1.6.3
> +AEXPECT_SITE = https://files.pythonhosted.org/packages/d0/fa/5ba16ca17a70980c7c09ea1c8d748aace1ee8772d032c483add0e17d0cf6
> +AEXPECT_SETUP_TYPE = setuptools
> +AEXPECT_LICENSE = GPL-2.0
> +AEXPECT_LICENSE_FILES = LICENSE
> +
> +$(eval $(python-package))
> -- 
> 2.30.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 2/7] package/minijail: new package
  2021-12-10 18:15     ` Arnout Vandecappelle
@ 2021-12-10 20:26       ` Giulio Benetti
  2021-12-11  8:30         ` Arnout Vandecappelle
  0 siblings, 1 reply; 39+ messages in thread
From: Giulio Benetti @ 2021-12-10 20:26 UTC (permalink / raw)
  To: Arnout Vandecappelle; +Cc: José Pekkarinen, yann.morin.1998, buildroot


[-- Attachment #1.1: Type: text/plain, Size: 1117 bytes --]

Hi Arnout, Yann, All,

> Il giorno 10 dic 2021, alle ore 19:15, Arnout Vandecappelle <arnout@mind.be> ha scritto:
> 
> 
> 
>> On 10/12/2021 15:48, Giulio Benetti wrote:
>> Hi José,
>>> On 10/12/21 15:12, José Pekkarinen wrote:
>>> This patch adds a new package for minijail.
>> Reword "This patch add package minijail"
> 
> Actually, no. For something this simple, it's better to leave the body empty (i.e. just the SoB), because the subject says it all already.

I agree with you. But I don’t know why I’ve been asked to repeat the summary into the body of commit log, like in this commit:
https://source.denx.de/u-boot/u-boot/-/commit/4ca28e98ace5d1253ed8cb9623dfac9296d70971

This is a Linux patch that has been committed to pinctrl next:
https://lore.kernel.org/lkml/20211125211443.1150135-5-Mr.Bossman075@gmail.com/

Maybe it is because when you see the patch in a mail client(I’m thinking about thunderbird) the summary is separated and “difficult” to read.

I don’t know what else :-)

Best regards
Giulio Benetti
Benetti Engineering sas

> 
> Regards,
> Arnout

[-- Attachment #1.2: Type: text/html, Size: 2104 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 2/7] package/minijail: new package
  2021-12-10 20:26       ` Giulio Benetti
@ 2021-12-11  8:30         ` Arnout Vandecappelle
  2021-12-11 11:53           ` Giulio Benetti
  0 siblings, 1 reply; 39+ messages in thread
From: Arnout Vandecappelle @ 2021-12-11  8:30 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: José Pekkarinen, yann.morin.1998, buildroot



On 10/12/2021 21:26, Giulio Benetti wrote:
> Hi Arnout, Yann, All,
> 
>> Il giorno 10 dic 2021, alle ore 19:15, Arnout Vandecappelle <arnout@mind.be> 
>> ha scritto:
>>
>> 
>>
>> On 10/12/2021 15:48, Giulio Benetti wrote:
>>> Hi José,
>>> On 10/12/21 15:12, José Pekkarinen wrote:
>>>> This patch adds a new package for minijail.
>>> Reword "This patch add package minijail"
>>
>> Actually, no. For something this simple, it's better to leave the body empty 
>> (i.e. just the SoB), because the subject says it all already.
> 
> I agree with you. But I don’t know why I’ve been asked to repeat the summary 
> into the body of commit log, like in this commit:
> https://source.denx.de/u-boot/u-boot/-/commit/4ca28e98ace5d1253ed8cb9623dfac9296d70971 
> <https://source.denx.de/u-boot/u-boot/-/commit/4ca28e98ace5d1253ed8cb9623dfac9296d70971>
> 
> This is a Linux patch that has been committed to pinctrl next:
> https://lore.kernel.org/lkml/20211125211443.1150135-5-Mr.Bossman075@gmail.com/ 
> <https://lore.kernel.org/lkml/20211125211443.1150135-5-Mr.Bossman075@gmail.com/>

  Well, I have no idea about the principles that lie behind the comments given 
in those other projects. So I tried to find the mail that asked for it, but I 
couldn't find it either on u-boot patchwork [1] or on lore.kernel.org...

  Regards,
  Arnout

[1] 
http://patchwork.ozlabs.org/project/uboot/list/?series=&submitter=77479&state=*&q=1050+clk&archive=&delegate=



> 
> Maybe it is because when you see the patch in a mail client(I’m thinking about 
> thunderbird) the summary is separated and “difficult” to read.
> 
> I don’t know what else :-)
> 
> Best regards
> Giulio Benetti
> Benetti Engineering sas
> 
>>
>> Regards,
>> Arnout
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 5/7] package/aexpect: new package
  2021-12-10 20:11   ` Yann E. MORIN
@ 2021-12-11  8:43     ` Arnout Vandecappelle
  2021-12-11  9:17       ` Yann E. MORIN
  0 siblings, 1 reply; 39+ messages in thread
From: Arnout Vandecappelle @ 2021-12-11  8:43 UTC (permalink / raw)
  To: Yann E. MORIN, José Pekkarinen; +Cc: buildroot



On 10/12/2021 21:11, Yann E. MORIN wrote:
> José, All,
> 
> On 2021-12-10 16:12 +0200, José Pekkarinen spake thusly:
>> Add package to avocado framework's aexpect.
>>
>> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> [--SNIP--]
>> diff --git a/package/aexpect/Config.in b/package/aexpect/Config.in
>> new file mode 100644
>> index 0000000000..efa2be8b91
>> --- /dev/null
>> +++ b/package/aexpect/Config.in
>> @@ -0,0 +1,12 @@
>> +config BR2_PACKAGE_AEXPECT
>> +	bool "aexpect"
>> +	depends on !BR2_STATIC_LIBS # dlopen()
>> +	select BR2_PACKAGE_PYTHON
> 
> Do not select python, depend on it.

  Why not? Currently we have the following packages that select python(3): 
cifs-utils, docker-compose, dstat, glslsandbox-player, gpsd, jack2, 
libsigrokdecode, midori, opkg-utils, ranger.

  Actually, ranger is a great example: it's also a tool that is just a tool and 
just happens to be implemented in python. So select is appropriate, like we do 
for any tool that happens to be implemented in Go, Rust, ...

  However, note that you need either

	select BR2_PACKAGE_PYTHON3 if !BR2_PACKAGE_PYTHON

or

	depends on !BR2_PACKAGE_PYTHON
	select BR2_PACKAGE_PYTHON3


  Regards,
  Arnout

> Also python in Buildroot is python 2. We are trying to get rid of it.
> Is aexpect really only supporting python2? If so, this is a bit
> unfortuante...
> 
> But since it require 2to6, maybe it works with python3 too?
> 
> Regards,
> Yann E. MORIN.
> 
>> +	help
>> +	  This module provides services similar to
>> +	  the pexpect python library, so to speak,
>> +	  spawn and control interactive applications,
>> +	  such as ssh, sftp and others.
>> +
>> +comment "aexpect needs a toolchain with dynamic library support"
>> +	depends on BR2_STATIC_LIBS
>> diff --git a/package/aexpect/aexpect.hash b/package/aexpect/aexpect.hash
>> new file mode 100644
>> index 0000000000..4a47da4121
>> --- /dev/null
>> +++ b/package/aexpect/aexpect.hash
>> @@ -0,0 +1,4 @@
>> +# From https://files.pythonhosted.org/packages/d0/fa/5ba16ca17a70980c7c09ea1c8d748aace1ee8772d032c483add0e17d0cf6
>> +sha256  54abae31e7d3b7afbfb7a019756907a81d40be4422788bccf20d2e82ad6ef8c8  aexpect-1.6.3.tar.gz
>> +# Locally computed
>> +sha256  7be26abf35e531a226dc742d2379d42d372cb61f027a6e26477c0e2f1a03bfcb  LICENSE
>> diff --git a/package/aexpect/aexpect.mk b/package/aexpect/aexpect.mk
>> new file mode 100644
>> index 0000000000..ca2097328a
>> --- /dev/null
>> +++ b/package/aexpect/aexpect.mk
>> @@ -0,0 +1,13 @@
>> +################################################################################
>> +#
>> +# aexpect
>> +#
>> +################################################################################
>> +
>> +AEXPECT_VERSION = 1.6.3
>> +AEXPECT_SITE = https://files.pythonhosted.org/packages/d0/fa/5ba16ca17a70980c7c09ea1c8d748aace1ee8772d032c483add0e17d0cf6
>> +AEXPECT_SETUP_TYPE = setuptools
>> +AEXPECT_LICENSE = GPL-2.0
>> +AEXPECT_LICENSE_FILES = LICENSE
>> +
>> +$(eval $(python-package))
>> -- 
>> 2.30.2
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot@buildroot.org
>> https://lists.buildroot.org/mailman/listinfo/buildroot
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 5/7] package/aexpect: new package
  2021-12-11  8:43     ` Arnout Vandecappelle
@ 2021-12-11  9:17       ` Yann E. MORIN
  0 siblings, 0 replies; 39+ messages in thread
From: Yann E. MORIN @ 2021-12-11  9:17 UTC (permalink / raw)
  To: Arnout Vandecappelle; +Cc: José Pekkarinen, buildroot

Arnout, José, All,

On 2021-12-11 09:43 +0100, Arnout Vandecappelle spake thusly:
> On 10/12/2021 21:11, Yann E. MORIN wrote:
> >José, All,
> >
> >On 2021-12-10 16:12 +0200, José Pekkarinen spake thusly:
> >>Add package to avocado framework's aexpect.
> >>
> >>Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> >[--SNIP--]
> >>diff --git a/package/aexpect/Config.in b/package/aexpect/Config.in
> >>new file mode 100644
> >>index 0000000000..efa2be8b91
> >>--- /dev/null
> >>+++ b/package/aexpect/Config.in
> >>@@ -0,0 +1,12 @@
> >>+config BR2_PACKAGE_AEXPECT
> >>+	bool "aexpect"
> >>+	depends on !BR2_STATIC_LIBS # dlopen()
> >>+	select BR2_PACKAGE_PYTHON
> >
> >Do not select python, depend on it.
> 
>  Why not? Currently we have the following packages that select python(3):
> cifs-utils, docker-compose, dstat, glslsandbox-player, gpsd, jack2,
> libsigrokdecode, midori, opkg-utils, ranger.

None selects python (aka python2, which is what I implied when writing
'python'):

    $ git grep -E 'select BR2_PACKAGE_PYTHON\>'
    [none, naught, nix, zilch]

Yes, they do however select python3.

And since we do want to get rid of python (aka python2), it would be
very disapointing to introduce a new package that is python2-only, or
that inconsiderately selects it.

>  Actually, ranger is a great example: it's also a tool that is just a tool
> and just happens to be implemented in python. So select is appropriate, like
> we do for any tool that happens to be implemented in Go, Rust, ...
> 
>  However, note that you need either
> 
> 	select BR2_PACKAGE_PYTHON3 if !BR2_PACKAGE_PYTHON
> or
> 	depends on !BR2_PACKAGE_PYTHON
> 	select BR2_PACKAGE_PYTHON3

Yes, this is what should be done.

But definitely do not select python (aka python2).

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 2/7] package/minijail: new package
  2021-12-11  8:30         ` Arnout Vandecappelle
@ 2021-12-11 11:53           ` Giulio Benetti
  0 siblings, 0 replies; 39+ messages in thread
From: Giulio Benetti @ 2021-12-11 11:53 UTC (permalink / raw)
  To: Arnout Vandecappelle; +Cc: buildroot, José Pekkarinen, yann.morin.1998

Hi Arnout,

On 11/12/21 09:30, Arnout Vandecappelle wrote:
> 
> 
> On 10/12/2021 21:26, Giulio Benetti wrote:
>> Hi Arnout, Yann, All,
>>
>>> Il giorno 10 dic 2021, alle ore 19:15, Arnout Vandecappelle <arnout@mind.be>
>>> ha scritto:
>>>
>>> 
>>>
>>> On 10/12/2021 15:48, Giulio Benetti wrote:
>>>> Hi José,
>>>> On 10/12/21 15:12, José Pekkarinen wrote:
>>>>> This patch adds a new package for minijail.
>>>> Reword "This patch add package minijail"
>>>
>>> Actually, no. For something this simple, it's better to leave the body empty
>>> (i.e. just the SoB), because the subject says it all already.
>>
>> I agree with you. But I don’t know why I’ve been asked to repeat the summary
>> into the body of commit log, like in this commit:
>> https://source.denx.de/u-boot/u-boot/-/commit/4ca28e98ace5d1253ed8cb9623dfac9296d70971
>> <https://source.denx.de/u-boot/u-boot/-/commit/4ca28e98ace5d1253ed8cb9623dfac9296d70971>
>>
>> This is a Linux patch that has been committed to pinctrl next:
>> https://lore.kernel.org/lkml/20211125211443.1150135-5-Mr.Bossman075@gmail.com/
>> <https://lore.kernel.org/lkml/20211125211443.1150135-5-Mr.Bossman075@gmail.com/>
> 
>    Well, I have no idea about the principles that lie behind the comments given
> in those other projects. So I tried to find the mail that asked for it, but I
> couldn't find it either on u-boot patchwork [1] or on lore.kernel.org...

Here is the u-boot ML discussion talking about it:
https://www.mail-archive.com/u-boot@lists.denx.de/msg405563.html

and some commit have summary and body equal or very similar, like:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=16b343e8e0ef7de5ce451427fafc9e2ea42f548f

But looking around I see that usually summary and body are not the same, 
also a commit log almost always deserves an explanation. So better 
almost always having a patch that explains in the body what is going on 
as Yann pointed:
https://lists.buildroot.org/pipermail/buildroot/2021-December/630268.html

This was only for completeness :-)

Kind regards
-- 
Giulio Benetti
Benetti Engineering sas

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 2/7] package/minijail: new package
  2021-12-10 14:12 ` [Buildroot] [PATCH 2/7] package/minijail: " José Pekkarinen
  2021-12-10 14:48   ` Giulio Benetti
  2021-12-10 19:57   ` Yann E. MORIN
@ 2022-01-05 20:41   ` Thomas Petazzoni
  2022-01-12 14:15     ` José Pekkarinen
  2 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2022-01-05 20:41 UTC (permalink / raw)
  To: José Pekkarinen; +Cc: buildroot

Hello José,

On Fri, 10 Dec 2021 16:12:04 +0200
José Pekkarinen <jose.pekkarinen@unikie.com> wrote:

> This patch adds a new package for minijail.
> 
> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>

I wanted to apply after fixing the issues pointed by others, but there
are in fact other issues, which I cannot resolve directly. See below.

> diff --git a/package/minijail/0001-Fix-prlimit-call.patch b/package/minijail/0001-Fix-prlimit-call.patch
> new file mode 100644
> index 0000000000..9f6902ed43
> --- /dev/null
> +++ b/package/minijail/0001-Fix-prlimit-call.patch
> @@ -0,0 +1,29 @@
> +From 09348f06104bf8101a24a0bce235a75a214e1380 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen@unikie.com>
> +Date: Fri, 10 Dec 2021 14:20:30 +0200
> +Subject: [PATCH] Fix prlimit call

What are you "fixing"? You're replacing a prlimit() call by by
setrlimit(), but why? What problem does it solve? Why is it correct to
do that?

> diff --git a/package/minijail/0002-Fix-static-assert.patch b/package/minijail/0002-Fix-static-assert.patch
> new file mode 100644
> index 0000000000..48139e8baa
> --- /dev/null
> +++ b/package/minijail/0002-Fix-static-assert.patch
> @@ -0,0 +1,30 @@
> +From b5d91b793942747e5126e75abca2eebad60ab478 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen@unikie.com>
> +Date: Fri, 10 Dec 2021 14:21:38 +0200
> +Subject: [PATCH] Fix static assert
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> +---
> + libminijail.c | 3 ---
> + 1 file changed, 3 deletions(-)
> +
> +diff --git a/libminijail.c b/libminijail.c
> +index 45f133e..8323742 100644
> +--- a/libminijail.c
> ++++ b/libminijail.c
> +@@ -2620,9 +2620,6 @@ static int fd_is_open(int fd)
> + 	return fcntl(fd, F_GETFD) != -1 || errno != EBADF;
> + }
> + 
> +-static_assert(FD_SETSIZE >= MAX_PRESERVED_FDS * 2 - 1,
> +-	      "If true, ensure_no_fd_conflict will always find an unused fd.");

You're not fixing the static_assert() here but simply dropping it. Why?
When does it fail? What is the problem with it? Why is it safe to drop
it?

Could you take into account these comments as well as the others
received, and send an update patch?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 3/7] package/bmx7: new package
  2021-12-10 14:12 ` [Buildroot] [PATCH 3/7] package/bmx7: " José Pekkarinen
  2021-12-10 14:52   ` Giulio Benetti
  2021-12-10 20:07   ` Yann E. MORIN
@ 2022-01-05 22:23   ` Thomas Petazzoni
  2022-01-10  5:36     ` José Pekkarinen
  2 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2022-01-05 22:23 UTC (permalink / raw)
  To: José Pekkarinen; +Cc: buildroot

Hello José,

On Fri, 10 Dec 2021 16:12:05 +0200
José Pekkarinen <jose.pekkarinen@unikie.com> wrote:

> This patch will provide an initial package
> for bmx7 project.
> 
> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>

I have applied this patch, with a few changes (see below). But I must
say I hesitated. Do you really use this? This project has not seen any
updates since July 2019, there is a simple pull request fixing the
SIOCGSTAMP issue that has never been looked at, and there are
alternatives such as olsr and batman-adv which are actively maintained.

Also, gcc generates tons and tons of warnings, which is quite worrying,
as gcc tends to become more and more strict, and upstream is no longer
active.

So I've applied, but I really hesitated.


> 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

I dropped that, and tested it builds fine with zlib-ng.


> +BMX7_VERSION = v7.1.1
> +BMX7_SOURCE = $(BMX7_VERSION).tar.gz
> +BMX7_SITE = https://github.com/bmx-routing/bmx7/archive/refs/tags

Changed that to use the github macro that we have in Buildroot.

> +BMX7_LICENSE = GPL-2

Changed to GPL-2.0.

> +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)")

Changed to:

        $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/$(d)/src

I.e, not need to cd into $(@D), and then using $(TARGET_CONFIGURE_OPTS)
to pass all variables, not just CC.

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 4/7] package/alfred: new package
  2021-12-10 14:12 ` [Buildroot] [PATCH 4/7] package/alfred: " José Pekkarinen
  2021-12-10 14:54   ` Giulio Benetti
@ 2022-01-05 22:43   ` Thomas Petazzoni
  1 sibling, 0 replies; 39+ messages in thread
From: Thomas Petazzoni @ 2022-01-05 22:43 UTC (permalink / raw)
  To: José Pekkarinen; +Cc: buildroot

Hello José,

On Fri, 10 Dec 2021 16:12:06 +0200
José Pekkarinen <jose.pekkarinen@unikie.com> wrote:

> This  patch will provide the initial
> package for alfred project.
> 
> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>

I have applied your patch, but after doing a number of changes. See below.

> diff --git a/package/alfred/Config.in b/package/alfred/Config.in
> new file mode 100644
> index 0000000000..5f9c6f2a6e
> --- /dev/null
> +++ b/package/alfred/Config.in
> @@ -0,0 +1,20 @@
> +config BR2_PACKAGE_ALFRED
> +	bool "alfred"
> +	depends on !BR2_STATIC_LIBS # dlopen()
> +	select BR2_PACKAGE_LIBNL

You have forgotten to account for the threads dependency of libnl,
which must be replicated here;

> +	select BR2_PACKAGE_LIBCAP
> +	select BR2_PACKAGE_GPSD

Neither libcap and gpsd are mandatory dependencies (see the README file
from the alfred code base for details). So I dropped these entirely. If
you want to have support for libcap and gpsd, you need to handle them
in the .mk file like this:

ifeq ($(BR2_PACKAGE_LIBCAP),y)
... do something ...
else
... do something else ...
endif

> +comment "alfred needs a toolchain with dynamic library support"
> +	depends on BR2_STATIC_LIBS

Modified to account for the threads dependency.

> diff --git a/package/alfred/alfred.hash b/package/alfred/alfred.hash
> new file mode 100644
> index 0000000000..a2dd0116d7
> --- /dev/null
> +++ b/package/alfred/alfred.hash
> @@ -0,0 +1,4 @@
> +# From https://downloads.open-mesh.org/batman/stable/sources/alfred

As pointed out by Giulio, this didn't make sense, as it doesn't point
to a file that contains the sha256, and actually no file there contains
the sha256. So instead I've added the sha1 from the file provided by
upstream, and put the sha256 hash under the "Locally computed" comment.

> +sha256  4c79b6c45de4bcc8cbfe64cba9a0f8b4ef304ca84c194622f2bfa41e01e2cb95  alfred-2021.4.tar.gz
> +# Locally computed
> +sha256  cecbf53d1148e13256ac29f8b900655b7fc8dc12d59939a95bc2323ea1747025  LICENSES/preferred/GPL-2.0
> diff --git a/package/alfred/alfred.mk b/package/alfred/alfred.mk
> new file mode 100644
> index 0000000000..4e38ddad92
> --- /dev/null
> +++ b/package/alfred/alfred.mk
> @@ -0,0 +1,25 @@
> +################################################################################
> +#
> +# alfred
> +#
> +################################################################################
> +
> +ALFRED_VERSION = 2021.4
> +ALFRED_SITE = https://downloads.open-mesh.org/batman/stable/sources/alfred
> +ALFRED_LICENSE = GPL-2

used GPL-2.0 here, which is the correct SPDX code for the GPLv2.

> +ALFRED_LICENSE_FILES = LICENSES/preferred/GPL-2.0
> +ALFRED_DEPENDENCIES = libnl libcap gpsd

Dropped libcap and gpsd from here.

> +
> +define ALFRED_BUILD_CMDS
> +	(cd $(@D); \
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/$(d) CC="$(TARGET_CC)")

Several things were wrong:

 - cd $(@D) was not needed, since you're doing -C $(@D)

 - the $(d) was wrong, as $(d) is an empty variable

 - doing that within a subshell is not necessary

 - passing $(TARGET_CONFIGURE_OPTS) is preferred over passing just CC.

Applied with those changes, thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 5/7] package/aexpect: new package
  2021-12-10 14:12 ` [Buildroot] [PATCH 5/7] package/aexpect: " José Pekkarinen
  2021-12-10 14:56   ` Giulio Benetti
  2021-12-10 20:11   ` Yann E. MORIN
@ 2022-01-06  8:40   ` Thomas Petazzoni
  2 siblings, 0 replies; 39+ messages in thread
From: Thomas Petazzoni @ 2022-01-06  8:40 UTC (permalink / raw)
  To: José Pekkarinen; +Cc: buildroot

Hello José,

On Fri, 10 Dec 2021 16:12:07 +0200
José Pekkarinen <jose.pekkarinen@unikie.com> wrote:

> Add package to avocado framework's aexpect.
> 
> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> ---
>  DEVELOPERS                   |  1 +
>  package/Config.in            |  1 +
>  package/aexpect/Config.in    | 12 ++++++++++++
>  package/aexpect/aexpect.hash |  4 ++++
>  package/aexpect/aexpect.mk   | 13 +++++++++++++
>  5 files changed, 31 insertions(+)
>  create mode 100644 package/aexpect/Config.in
>  create mode 100644 package/aexpect/aexpect.hash
>  create mode 100644 package/aexpect/aexpect.mk

So I have "applied", but I put this between quotes because I've
basically redone it entirely. First I've named the package
python-aexpect because really aexpect is primarily a Python module.
I've used scanpypi to generate the package. Also added a test case for
it, noticed that the package doesn't work with Python 2 (syntax error
when byte-compiling), so I made it Python 3 only.

See the final commit:

  https://git.buildroot.org/buildroot/commit/?id=63b72a7c15bcd56fe1570e3f7ecd43993c0fde90

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 3/7] package/bmx7: new package
  2022-01-05 22:23   ` Thomas Petazzoni
@ 2022-01-10  5:36     ` José Pekkarinen
  0 siblings, 0 replies; 39+ messages in thread
From: José Pekkarinen @ 2022-01-10  5:36 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

On Thu, Jan 6, 2022 at 12:23 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello José,
>
> On Fri, 10 Dec 2021 16:12:05 +0200
> José Pekkarinen <jose.pekkarinen@unikie.com> wrote:
>
> > This patch will provide an initial package
> > for bmx7 project.
> >
> > Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
>
> I have applied this patch, with a few changes (see below). But I must
> say I hesitated. Do you really use this? This project has not seen any
> updates since July 2019, there is a simple pull request fixing the
> SIOCGSTAMP issue that has never been looked at, and there are
> alternatives such as olsr and batman-adv which are actively maintained.

    Hi,

    Thanks! I took some time to ask the project participants
to confirm they use these packages before starting the
upstreaming process. Apparently this may be of use in
communications over wifi mesh networks.

    Best regards.

    José.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 2/7] package/minijail: new package
  2022-01-05 20:41   ` Thomas Petazzoni
@ 2022-01-12 14:15     ` José Pekkarinen
  2022-01-12 14:51       ` Thomas Petazzoni
  0 siblings, 1 reply; 39+ messages in thread
From: José Pekkarinen @ 2022-01-12 14:15 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

On Wed, Jan 5, 2022 at 10:41 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello José,
>
> On Fri, 10 Dec 2021 16:12:04 +0200
> José Pekkarinen <jose.pekkarinen@unikie.com> wrote:
>
> > This patch adds a new package for minijail.
> >
> > Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
>
> I wanted to apply after fixing the issues pointed by others, but there
> are in fact other issues, which I cannot resolve directly. See below.
>
> > diff --git a/package/minijail/0001-Fix-prlimit-call.patch b/package/minijail/0001-Fix-prlimit-call.patch
> > new file mode 100644
> > index 0000000000..9f6902ed43
> > --- /dev/null
> > +++ b/package/minijail/0001-Fix-prlimit-call.patch
> > @@ -0,0 +1,29 @@
> > +From 09348f06104bf8101a24a0bce235a75a214e1380 Mon Sep 17 00:00:00 2001
> > +From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen@unikie.com>
> > +Date: Fri, 10 Dec 2021 14:20:30 +0200
> > +Subject: [PATCH] Fix prlimit call
>
> What are you "fixing"? You're replacing a prlimit() call by by
> setrlimit(), but why? What problem does it solve? Why is it correct to
> do that?

    The problem is shown from as this:

/home/pekkari/br-test-pkg/bootlin-armv5-uclibc/build/minijail-linux-v17/libminijail.c:
In function ‘set_rlimits_or_die’:
/home/pekkari/br-test-pkg/bootlin-armv5-uclibc/build/minijail-linux-v17/libminijail.c:1911:7:
error: implicit declaration of function ‘prlimit’; did you mean
‘setrlimit’? [-Werror=implicit-function-declaration]
1911 |   if (prlimit(j->initpid, j->rlimits[i].type, &limit, NULL))
     |       ^~~~~~~
     |       setrlimit

    So I followed the suggestion, no more, no less.

> > diff --git a/package/minijail/0002-Fix-static-assert.patch b/package/minijail/0002-Fix-static-assert.patch
> > new file mode 100644
> > index 0000000000..48139e8baa
> > --- /dev/null
> > +++ b/package/minijail/0002-Fix-static-assert.patch
> > @@ -0,0 +1,30 @@
> > +From b5d91b793942747e5126e75abca2eebad60ab478 Mon Sep 17 00:00:00 2001
> > +From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= <jose.pekkarinen@unikie.com>
> > +Date: Fri, 10 Dec 2021 14:21:38 +0200
> > +Subject: [PATCH] Fix static assert
> > +MIME-Version: 1.0
> > +Content-Type: text/plain; charset=UTF-8
> > +Content-Transfer-Encoding: 8bit
> > +
> > +Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> > +---
> > + libminijail.c | 3 ---
> > + 1 file changed, 3 deletions(-)
> > +
> > +diff --git a/libminijail.c b/libminijail.c
> > +index 45f133e..8323742 100644
> > +--- a/libminijail.c
> > ++++ b/libminijail.c
> > +@@ -2620,9 +2620,6 @@ static int fd_is_open(int fd)
> > +     return fcntl(fd, F_GETFD) != -1 || errno != EBADF;
> > + }
> > +
> > +-static_assert(FD_SETSIZE >= MAX_PRESERVED_FDS * 2 - 1,
> > +-          "If true, ensure_no_fd_conflict will always find an unused fd.");
>
> You're not fixing the static_assert() here but simply dropping it. Why?
> When does it fail? What is the problem with it? Why is it safe to drop
> it?

    It fails like this:

/home/pekkari/br-test-pkg/bootlin-armv5-uclibc/build/minijail-linux-v17/libminijail.c:2623:15:
error: expected declaration specifiers or ‘...’ before numeric
constant
2623 | static_assert(FD_SETSIZE >= MAX_PRESERVED_FDS * 2 - 1,
     |               ^~~~~~~~~~
/home/pekkari/br-test-pkg/bootlin-armv5-uclibc/build/minijail-linux-v17/libminijail.c:2624:8:
error: expected declaration specifiers or ‘...’ before string constant
2624 |        "If true, ensure_no_fd_conflict will always find an unused fd.");
     |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    So my understanding is that this platform may
define static_assert in a different manner, and I
find no traces of the purpose of that isolated assert,
so the easier way to get around this was removing it.

    Best regards

    José.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 2/7] package/minijail: new package
  2022-01-12 14:15     ` José Pekkarinen
@ 2022-01-12 14:51       ` Thomas Petazzoni
  2022-01-12 15:08         ` José Pekkarinen
  0 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2022-01-12 14:51 UTC (permalink / raw)
  To: José Pekkarinen; +Cc: buildroot

Hello,

On Wed, 12 Jan 2022 16:15:16 +0200
José Pekkarinen <jose.pekkarinen@unikie.com> wrote:

> > What are you "fixing"? You're replacing a prlimit() call by by
> > setrlimit(), but why? What problem does it solve? Why is it correct to
> > do that?  
> 
>     The problem is shown from as this:
> 
> /home/pekkari/br-test-pkg/bootlin-armv5-uclibc/build/minijail-linux-v17/libminijail.c:
> In function ‘set_rlimits_or_die’:
> /home/pekkari/br-test-pkg/bootlin-armv5-uclibc/build/minijail-linux-v17/libminijail.c:1911:7:
> error: implicit declaration of function ‘prlimit’; did you mean
> ‘setrlimit’? [-Werror=implicit-function-declaration]
> 1911 |   if (prlimit(j->initpid, j->rlimits[i].type, &limit, NULL))
>      |       ^~~~~~~
>      |       setrlimit
> 
>     So I followed the suggestion, no more, no less.

You shouldn't blindly follow compiler suggestions :-)

prlimit() exists in musl. Was <sys/resource.h> included, as suggested
by the prlimit() man page ?


> > > +-static_assert(FD_SETSIZE >= MAX_PRESERVED_FDS * 2 - 1,
> > > +-          "If true, ensure_no_fd_conflict will always find an unused fd.");  
> >
> > You're not fixing the static_assert() here but simply dropping it. Why?
> > When does it fail? What is the problem with it? Why is it safe to drop
> > it?  
> 
>     It fails like this:
> 
> /home/pekkari/br-test-pkg/bootlin-armv5-uclibc/build/minijail-linux-v17/libminijail.c:2623:15:
> error: expected declaration specifiers or ‘...’ before numeric
> constant
> 2623 | static_assert(FD_SETSIZE >= MAX_PRESERVED_FDS * 2 - 1,
>      |               ^~~~~~~~~~
> /home/pekkari/br-test-pkg/bootlin-armv5-uclibc/build/minijail-linux-v17/libminijail.c:2624:8:
> error: expected declaration specifiers or ‘...’ before string constant
> 2624 |        "If true, ensure_no_fd_conflict will always find an unused fd.");
>      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
>     So my understanding is that this platform may
> define static_assert in a different manner, and I
> find no traces of the purpose of that isolated assert,
> so the easier way to get around this was removing it.

Well, the assert is there for a reason, so we need to understand what
it is verifying, and whether it is safe to drop it.

After checking, FD_SETSIZE seems to be defined to 1024 by glibc, musl
and uclibc-ng, and MAX_PRESERVED_FDS is defined as 128 by the minijail
code.

Can you try using _Static_assert() instead, which is part of the C11
standard?

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 2/7] package/minijail: new package
  2022-01-12 14:51       ` Thomas Petazzoni
@ 2022-01-12 15:08         ` José Pekkarinen
  2022-01-12 16:00           ` Thomas Petazzoni
  0 siblings, 1 reply; 39+ messages in thread
From: José Pekkarinen @ 2022-01-12 15:08 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

On Wed, Jan 12, 2022 at 4:51 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello,
>
> On Wed, 12 Jan 2022 16:15:16 +0200
> José Pekkarinen <jose.pekkarinen@unikie.com> wrote:
>
> > > What are you "fixing"? You're replacing a prlimit() call by by
> > > setrlimit(), but why? What problem does it solve? Why is it correct to
> > > do that?
> >
> >     The problem is shown from as this:
> >
> > /home/pekkari/br-test-pkg/bootlin-armv5-uclibc/build/minijail-linux-v17/libminijail.c:
> > In function ‘set_rlimits_or_die’:
> > /home/pekkari/br-test-pkg/bootlin-armv5-uclibc/build/minijail-linux-v17/libminijail.c:1911:7:
> > error: implicit declaration of function ‘prlimit’; did you mean
> > ‘setrlimit’? [-Werror=implicit-function-declaration]
> > 1911 |   if (prlimit(j->initpid, j->rlimits[i].type, &limit, NULL))
> >      |       ^~~~~~~
> >      |       setrlimit
> >
> >     So I followed the suggestion, no more, no less.
>
> You shouldn't blindly follow compiler suggestions :-)
>
> prlimit() exists in musl. Was <sys/resource.h> included, as suggested
> by the prlimit() man page ?

    It is:

$ cat libminijail.c
[...]
#include <sys/resource.h>
[...]

> > > > +-static_assert(FD_SETSIZE >= MAX_PRESERVED_FDS * 2 - 1,
> > > > +-          "If true, ensure_no_fd_conflict will always find an unused fd.");
> > >
> > > You're not fixing the static_assert() here but simply dropping it. Why?
> > > When does it fail? What is the problem with it? Why is it safe to drop
> > > it?
> >
> >     It fails like this:
> >
> > /home/pekkari/br-test-pkg/bootlin-armv5-uclibc/build/minijail-linux-v17/libminijail.c:2623:15:
> > error: expected declaration specifiers or ‘...’ before numeric
> > constant
> > 2623 | static_assert(FD_SETSIZE >= MAX_PRESERVED_FDS * 2 - 1,
> >      |               ^~~~~~~~~~
> > /home/pekkari/br-test-pkg/bootlin-armv5-uclibc/build/minijail-linux-v17/libminijail.c:2624:8:
> > error: expected declaration specifiers or ‘...’ before string constant
> > 2624 |        "If true, ensure_no_fd_conflict will always find an unused fd.");
> >      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> >     So my understanding is that this platform may
> > define static_assert in a different manner, and I
> > find no traces of the purpose of that isolated assert,
> > so the easier way to get around this was removing it.
>
> Well, the assert is there for a reason, so we need to understand what
> it is verifying, and whether it is safe to drop it.
>
> After checking, FD_SETSIZE seems to be defined to 1024 by glibc, musl
> and uclibc-ng, and MAX_PRESERVED_FDS is defined as 128 by the minijail
> code.
>
> Can you try using _Static_assert() instead, which is part of the C11
> standard?

    I'll do.

    Thanks!

    José.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 2/7] package/minijail: new package
  2022-01-12 15:08         ` José Pekkarinen
@ 2022-01-12 16:00           ` Thomas Petazzoni
  2022-01-13  5:12             ` José Pekkarinen
  0 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2022-01-12 16:00 UTC (permalink / raw)
  To: José Pekkarinen; +Cc: buildroot

On Wed, 12 Jan 2022 17:08:26 +0200
José Pekkarinen <jose.pekkarinen@unikie.com> wrote:

> > prlimit() exists in musl. Was <sys/resource.h> included, as suggested
> > by the prlimit() man page ?  
> 
>     It is:
> 
> $ cat libminijail.c
> [...]
> #include <sys/resource.h>
> [...]

Ah, it's uClibc that is missing prlimit(). Can you confirm that
minijail builds fine with glibc and musl, but breaks on uClibc due to
prlimit() being missing?

I'm not sure it's possible to replace prlimit() by setrlimit(). Indeed,
prlimit() has a PID as the first argument, which allows to ste resource
limits on other processes, while setrlimit() only takes care of the
current process.

I'm afraid it seems we will have to disallow the use of minijail with
uClibc toolchains.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 2/7] package/minijail: new package
  2022-01-12 16:00           ` Thomas Petazzoni
@ 2022-01-13  5:12             ` José Pekkarinen
  0 siblings, 0 replies; 39+ messages in thread
From: José Pekkarinen @ 2022-01-13  5:12 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

On Wed, Jan 12, 2022 at 6:00 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> On Wed, 12 Jan 2022 17:08:26 +0200
> José Pekkarinen <jose.pekkarinen@unikie.com> wrote:
>
> > > prlimit() exists in musl. Was <sys/resource.h> included, as suggested
> > > by the prlimit() man page ?
> >
> >     It is:
> >
> > $ cat libminijail.c
> > [...]
> > #include <sys/resource.h>
> > [...]
>
> Ah, it's uClibc that is missing prlimit(). Can you confirm that
> minijail builds fine with glibc and musl, but breaks on uClibc due to
> prlimit() being missing?
>
> I'm not sure it's possible to replace prlimit() by setrlimit(). Indeed,
> prlimit() has a PID as the first argument, which allows to ste resource
> limits on other processes, while setrlimit() only takes care of the
> current process.
>
> I'm afraid it seems we will have to disallow the use of minijail with
> uClibc toolchains.

    Hi,

    Yes, it is only uclibc, this is the out of test-pkg:

$ utils/test-pkg -c minijail.cfg -p minijail
                   bootlin-armv5-uclibc [1/6]: FAILED
                    bootlin-armv7-glibc [2/6]: OK
                  bootlin-armv7m-uclibc [3/6]: SKIPPED
                    bootlin-x86-64-musl [4/6]: OK
                     br-arm-full-static [5/6]: SKIPPED
                           sourcery-arm [6/6]: OK
6 builds, 2 skipped, 1 build failed, 0 legal-info failed

    Thanks!

    José.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 6/7] package/avocado: new package
  2021-12-10 14:12 ` [Buildroot] [PATCH 6/7] package/avocado: " José Pekkarinen
  2021-12-10 14:57   ` Giulio Benetti
@ 2022-07-26  8:13   ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 39+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-07-26  8:13 UTC (permalink / raw)
  To: José Pekkarinen; +Cc: buildroot

Hello José,

On Fri, 10 Dec 2021 16:12:08 +0200
José Pekkarinen <jose.pekkarinen@unikie.com> wrote:

> This patch adds a basic package for
> avocado framework.
> 
> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>

I have finally applied this package, but with a number of changes. See below.

> diff --git a/package/avocado/Config.in b/package/avocado/Config.in
> new file mode 100644
> index 0000000000..402a639969
> --- /dev/null
> +++ b/package/avocado/Config.in
> @@ -0,0 +1,13 @@
> +config BR2_PACKAGE_AVOCADO
> +	bool "avocado"
> +	depends on !BR2_STATIC_LIBS # dlopen()
> +	select BR2_PACKAGE_LIBFFI
> +	select BR2_PACKAGE_PYTHON3

Since you select Python, you need to inherit all its dependencies:

+       depends on BR2_USE_WCHAR # python3
+       depends on BR2_USE_MMU # python3
+       depends on BR2_TOOLCHAIN_HAS_THREADS # python3
+       depends on !BR2_STATIC_LIBS # python3

Also, you were missing a number of modules part of the Python standard
library, and one external module, so I had to add:

+       select BR2_PACKAGE_PYTHON3_BZIP2
+       select BR2_PACKAGE_PYTHON3_PYEXPAT
+       select BR2_PACKAGE_PYTHON3_SQLITE
+       select BR2_PACKAGE_PYTHON3_XZ
+       select BR2_PACKAGE_PYTHON_SETUPTOOLS # runtime, pkg_resources

for Avocado to work properly.

> +	help
> +	  Avocado is an automated testing suite containing
> +	  tests for various subsystems.
> +
> +	  https://avocado-framework.readthedocs.io/
> +
> +comment "avocado needs a toolchain with dynamic library support"
> +	depends on BR2_STATIC_LIBS

You had forgotten BR2_USE_MMU here, and this had to be updated
according to the dependencies:

+comment "avocado needs a toolchain w/ wchar, threads, dynamic library"
+       depends on BR2_USE_MMU
+       depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS

> diff --git a/package/avocado/avocado.hash b/package/avocado/avocado.hash
> new file mode 100644
> index 0000000000..257ee5d5ae
> --- /dev/null
> +++ b/package/avocado/avocado.hash
> @@ -0,0 +1,4 @@
> +# From https://github.com/avocado-framework/avocado/archive/refs/tags

This page does not exist.

> +sha256  b7a35552cd0f0d8e4b3aa4bb7009ce9e474a40c1cd111698ed03da90d71a2f4b  93.0.tar.gz
> +# Locally computed
> +sha256  680ce56e9c4043826f0f1420935d2453ea3ddacd1582cb6f1cef26c1077fcc93  LICENSE
> diff --git a/package/avocado/avocado.mk b/package/avocado/avocado.mk
> new file mode 100644
> index 0000000000..8474fa48c8
> --- /dev/null
> +++ b/package/avocado/avocado.mk
> @@ -0,0 +1,14 @@
> +################################################################################
> +#
> +# avocado-framework
> +#
> +################################################################################
> +
> +AVOCADO_VERSION = 93.0

I have updated to version 98.0

> +AVOCADO_SOURCE = $(AVOCADO_VERSION).tar.gz
> +AVOCADO_SITE = https://github.com/avocado-framework/avocado/archive/refs/tags

And here replaced both of those lines by:

+AVOCADO_SITE = $(call github,avocado-framework,avocado,$(AVOCADO_VERSION))

> +AVOCADO_SETUP_TYPE = setuptools
> +AVOCADO_LICENSE = Apache-2.0

And now I realize this is wrong... the license is not Apache-2.0, but
GPL-2.0. I forgot to check this, I will commit a follow-up patch.

Another thing I did is add a runtime test for Avocado, in
support/testing/tests/package/test_avocado.py

Thanks for your contribution!

Thomas Petazzoni
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 7/7] package/avocado-vt: new package
  2021-12-10 14:12 ` [Buildroot] [PATCH 7/7] package/avocado-vt: " José Pekkarinen
  2021-12-10 15:00   ` Giulio Benetti
@ 2022-07-26  8:21   ` Thomas Petazzoni via buildroot
  2022-07-28  6:07     ` José Pekkarinen via buildroot
  1 sibling, 1 reply; 39+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-07-26  8:21 UTC (permalink / raw)
  To: José Pekkarinen; +Cc: buildroot

Hello José,

On Fri, 10 Dec 2021 16:12:09 +0200
José Pekkarinen <jose.pekkarinen@unikie.com> wrote:

> This patch adds a basic package for avocado-vt
> plugin.
> 
> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>

Thanks a lot for your contribution!

Do you have an example on how to use this in the context of Buildroot?

First, your patch was missing lots of dependencies: python-netaddr,
python-netifaces, python-simplejson, and one more I can't remember.

Then, I tried to follow
https://avocado-vt.readthedocs.io/en/latest/GetStartedGuide.html by
running "avocado vt-bootstrap --vt-type qemu" on the target, but this
checks if gcc is installed on the target, which obviously fails because
we don't support installing a compiler on the target.

Could you show a simple example of using avocado-vt in the context of
Buildroot? Ideally, a runtime test in support/testing/ would be useful.
See support/testing/tests/package/test_avocado.py for an example test
case I have added for avocado itself.

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [Buildroot] [PATCH 7/7] package/avocado-vt: new package
  2022-07-26  8:21   ` Thomas Petazzoni via buildroot
@ 2022-07-28  6:07     ` José Pekkarinen via buildroot
  0 siblings, 0 replies; 39+ messages in thread
From: José Pekkarinen via buildroot @ 2022-07-28  6:07 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot


[-- Attachment #1.1: Type: text/plain, Size: 1467 bytes --]

On Tue, Jul 26, 2022 at 11:21 AM Thomas Petazzoni <
thomas.petazzoni@bootlin.com> wrote:

> Hello José,
>
> On Fri, 10 Dec 2021 16:12:09 +0200
> José Pekkarinen <jose.pekkarinen@unikie.com> wrote:
>
> > This patch adds a basic package for avocado-vt
> > plugin.
> >
> > Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
>
> Thanks a lot for your contribution!
>
> Do you have an example on how to use this in the context of Buildroot?
>
> First, your patch was missing lots of dependencies: python-netaddr,
> python-netifaces, python-simplejson, and one more I can't remember.
>
> Then, I tried to follow
> https://avocado-vt.readthedocs.io/en/latest/GetStartedGuide.html by
> running "avocado vt-bootstrap --vt-type qemu" on the target, but this
> checks if gcc is installed on the target, which obviously fails because
> we don't support installing a compiler on the target.
>
> Could you show a simple example of using avocado-vt in the context of
> Buildroot? Ideally, a runtime test in support/testing/ would be useful.
> See support/testing/tests/package/test_avocado.py for an example test
> case I have added for avocado itself.
>

Hi,

I'm afraid, I find no traces of it being used in our records, we

targeted to set it up to have a testing facility that could be used by a
tester that never came to the table. Please feel free to ignore this patch,
we don't need it anymore.

Best regards.


José.

[-- Attachment #1.2: Type: text/html, Size: 2648 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2022-07-28  6:07 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 14:12 [Buildroot] [PATCH 1/7] package/opensc: new package José Pekkarinen
2021-12-10 14:12 ` [Buildroot] [PATCH 2/7] package/minijail: " José Pekkarinen
2021-12-10 14:48   ` Giulio Benetti
2021-12-10 18:15     ` Arnout Vandecappelle
2021-12-10 20:26       ` Giulio Benetti
2021-12-11  8:30         ` Arnout Vandecappelle
2021-12-11 11:53           ` Giulio Benetti
2021-12-10 19:57   ` Yann E. MORIN
2022-01-05 20:41   ` Thomas Petazzoni
2022-01-12 14:15     ` José Pekkarinen
2022-01-12 14:51       ` Thomas Petazzoni
2022-01-12 15:08         ` José Pekkarinen
2022-01-12 16:00           ` Thomas Petazzoni
2022-01-13  5:12             ` José Pekkarinen
2021-12-10 14:12 ` [Buildroot] [PATCH 3/7] package/bmx7: " José Pekkarinen
2021-12-10 14:52   ` Giulio Benetti
2021-12-10 20:07   ` Yann E. MORIN
2022-01-05 22:23   ` Thomas Petazzoni
2022-01-10  5:36     ` José Pekkarinen
2021-12-10 14:12 ` [Buildroot] [PATCH 4/7] package/alfred: " José Pekkarinen
2021-12-10 14:54   ` Giulio Benetti
2022-01-05 22:43   ` Thomas Petazzoni
2021-12-10 14:12 ` [Buildroot] [PATCH 5/7] package/aexpect: " José Pekkarinen
2021-12-10 14:56   ` Giulio Benetti
2021-12-10 20:11   ` Yann E. MORIN
2021-12-11  8:43     ` Arnout Vandecappelle
2021-12-11  9:17       ` Yann E. MORIN
2022-01-06  8:40   ` Thomas Petazzoni
2021-12-10 14:12 ` [Buildroot] [PATCH 6/7] package/avocado: " José Pekkarinen
2021-12-10 14:57   ` Giulio Benetti
2022-07-26  8:13   ` Thomas Petazzoni via buildroot
2021-12-10 14:12 ` [Buildroot] [PATCH 7/7] package/avocado-vt: " José Pekkarinen
2021-12-10 15:00   ` Giulio Benetti
2022-07-26  8:21   ` Thomas Petazzoni via buildroot
2022-07-28  6:07     ` José Pekkarinen via buildroot
2021-12-10 14:32 ` [Buildroot] [PATCH 1/7] package/opensc: " Giulio Benetti
2021-12-10 17:34   ` Yann E. MORIN
2021-12-10 14:49 ` Giulio Benetti
2021-12-10 17:06   ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.