Skip to contentSkip to conversation

package/libpcap: add host variant

PATCH New Fabrice Fontaine 2 participants 5 messages Oct 25, 2020 – Oct 27, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 package/libpcap: add host variant

host-libpcap is needed to build host-zeek

---
 package/libpcap/libpcap.mk | 9 +++++++++
 1 file changed, 9 insertions(+)
package/libpcap/libpcap.mk +9 -0
index 881a109a0a..93d5587466 100644
@@ -10,6 +10,7 @@ LIBPCAP_LICENSE = BSD-3-Clause
 LIBPCAP_LICENSE_FILES = LICENSE
 LIBPCAP_INSTALL_STAGING = YES
 LIBPCAP_DEPENDENCIES = host-flex host-bison
+HOST_LIBPCAP_DEPENDENCIES = host-flex host-bison
 
 LIBPCAP_CONF_ENV = \
 	ac_cv_header_linux_wireless_h=yes \
@@ -18,6 +19,13 @@ LIBPCAP_CFLAGS = $(TARGET_CFLAGS)
 LIBPCAP_CONF_OPTS = --disable-yydebug --with-pcap=linux --without-dag
 # Disable dbus to break recursive dependencies
 LIBPCAP_CONF_OPTS += --disable-dbus
+HOST_LIBPCAP_CONF_OPTS = \
+	--disable-bluetooth \
+	--disable-dbus \
+	--disable-yydebug \
+	--with-pcap=linux \
+	--without-dag \
+	--without-libnl
 LIBPCAP_CONFIG_SCRIPTS = pcap-config
 
 # Omit -rpath from pcap-config output
@@ -46,3 +54,4 @@ LIBPCAP_CFLAGS += -fPIC
 endif
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.28.0
#1 lore raw

PATCH v3 2/2 package/zeek: new package

The Zeek Network Security Monitor

Zeek is a powerful network analysis framework that is much different from the typical IDS you may know. (Zeek is the new name for the long-established Bro system.)

---
Changes v2 -> v3 (after review of Thomas Petazzoni):
- Bump to version 3.2.2 (security fixes)
- Add host-zeek dependencies
- Install bifcl and binpac to HOST_DIR

Changes v1 -> v2:
- Bump to version 3.2.0
- Drop second and third patches (already in version)
- Update ZEEK_SITE
- Update indentation in hash file (two spaces)
- Update third party licences

 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 ...rdinator.hpp-check-for-RUSAGE_THREAD.patch | 31 +++++++
 package/zeek/Config.in                        | 44 ++++++++++
 package/zeek/zeek.hash                        |  6 ++
 package/zeek/zeek.mk                          | 86 +++++++++++++++++++
 6 files changed, 169 insertions(+)
 create mode 100644 package/zeek/0001-profiled_coordinator.hpp-check-for-RUSAGE_THREAD.patch
 create mode 100644 package/zeek/Config.in
 create mode 100644 package/zeek/zeek.hash
 create mode 100644 package/zeek/zeek.mk
DEVELOPERS +1 -0
index 123ffbf033..4b2b250b4a 100644
@@ -877,6 +877,7 @@ F:	package/tinycbor/
 F:	package/tinydtls/
 F:	package/tinymembench/
 F:	package/whois/
+F:	package/zeek/
 
 N:	Fabrice Goucem <[email protected]>
 F:	board/freescale/imx6ullevk/
package/Config.in +1 -0
index ee05467479..08b379e08f 100644
@@ -2289,6 +2289,7 @@ endif
 	source "package/xinetd/Config.in"
 	source "package/xl2tp/Config.in"
 	source "package/xtables-addons/Config.in"
+	source "package/zeek/Config.in"
 	source "package/znc/Config.in"
 
 endmenu
package/zeek/0001-profiled_coordinator.hpp-check-for-RUSAGE_THREAD.patch new file +31 -0
new file mode 100644
index 0000000000..4b431a5a56
@@ -0,0 +1,31 @@
+From af299e7ef8650be6b05152e91ca7a2a6fac3eb14 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 31 Jan 2020 16:46:48 +0100
+Subject: [PATCH] profiled_coordinator.hpp: check for RUSAGE_THREAD
+
+RUSAGE_THREAD is not defined on uclibc, so use RUSAGE_SELF if
+RUSAGE_THREAD is undefined
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Retrieved from:
+https://github.com/actor-framework/actor-framework/commit/af299e7ef8650be6b05152e91ca7a2a6fac3eb14]
+---
+ auxil/broker/caf/libcaf_core/caf/scheduler/profiled_coordinator.hpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/libcaf_core/caf/scheduler/profiled_coordinator.hpp b/libcaf_core/caf/scheduler/profiled_coordinator.hpp
+index 3e091321f..7d7b8bad2 100644
+--- a/auxil/broker/caf/libcaf_core/caf/scheduler/profiled_coordinator.hpp
++++ b/auxil/broker/caf/libcaf_core/caf/scheduler/profiled_coordinator.hpp
+@@ -113,7 +113,11 @@ class profiled_coordinator : public coordinator<Policy> {
+       m.mem = 0;
+ #else
+       ::rusage ru;
++#ifdef RUSAGE_THREAD
+       ::getrusage(RUSAGE_THREAD, &ru);
++#else
++      ::getrusage(RUSAGE_SELF, &ru);
++#endif
+       m.usr = to_usec(ru.ru_utime);
+       m.sys = to_usec(ru.ru_stime);
+       m.mem = ru.ru_maxrss;
package/zeek/Config.in new file +44 -0

44 lines not on this page · raw message

package/zeek/zeek.hash new file +6 -0
new file mode 100644
index 0000000000..30411e4948
@@ -0,0 +1,6 @@
+# Locally computed:
+sha256  6c5748c49207241977a0d9fcbac8ce3b6abbf866ff29469fd0c2dcd3d4f99d01  zeek-3.2.2.tar.gz
+
+# Hash for license files:
+sha256  690b4eee9a01fe94edd5710a0bc026df96bb3b2403d26dc923921ec0116908b2  COPYING
+sha256  f191fefe3f28a32e51499f57d700595946055518e00261ac398279639d5a5bea  COPYING.3rdparty
package/zeek/zeek.mk new file +86 -0

86 lines not on this page · raw message

Signature · 1 line
2.28.0
#2 lore raw

PATCH v3 2/2 package/zeek: new package

Hello Fabrice,

Quoted 4 lines · On Sun, 25 Oct 2020 17:12:46 +0100 Fabrice Fontaine…
package/zeek/zeek.mk new file +4 -0
+ZEEK_CONF_OPTS = \
+	-DBIFCL_EXE_PATH=$(HOST_DIR)/bin/bifcl \
+	-DBINPAC_EXE_PATH=$(HOST_DIR)/bin/binpac \
+	-DBROKER_DISABLE_DOCS=ON \

package/zeek/zeek.mk line 48

Quoted 10 lines
package/zeek/zeek.mk new file +10 -0
+	-DBROKER_DISABLE_TESTS=ON \
+	-DINSTALL_AUX_TOOLS=ON \
+	-DZEEK_ETC_INSTALL_DIR=/etc
+
+define ZEEK_FIX_PYTHON_PATH
+	$(SED) 's, at PYTHON_EXECUTABLE@,/usr/bin/python,' \
+		$(@D)/auxil/zeekctl/ZeekControl/ssh_runner.py
+endef
+
+ZEEK_POST_CONFIGURE_HOOKS += ZEEK_FIX_PYTHON_PATH

Does this needs to be a post-configure hook ? Isn't that needed simply after the installation ?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v3 2/2 package/zeek: new package

Hi Thomas,

Le lun. 26 oct. 2020 ? 22:08, Thomas Petazzoni
<[email protected]> a ?crit :

Quoted 15 lines

Hello Fabrice,

Quoted 9 lines · On Sun, 25 Oct 2020 17:12:46 +0100 Fabrice Fontaine…
package/zeek/zeek.mk new file +9 -0
+ZEEK_CONF_OPTS = \
+     -DBIFCL_EXE_PATH=$(HOST_DIR)/bin/bifcl \
+     -DBINPAC_EXE_PATH=$(HOST_DIR)/bin/binpac \
+     -DBROKER_DISABLE_DOCS=ON \
+     -DBROKER_DISABLE_TESTS=ON \
+     -DINSTALL_AUX_TOOLS=ON \
+     -DZEEK_ETC_INSTALL_DIR=/etc
+
+define ZEEK_FIX_PYTHON_PATH
Quoted 8 lines

package/zeek/zeek.mk line 48

Quoted 5 lines
package/zeek/zeek.mk new file +5 -0
+     $(SED) 's, at PYTHON_EXECUTABLE@,/usr/bin/python,' \
+             $(@D)/auxil/zeekctl/ZeekControl/ssh_runner.py
+endef
+
+ZEEK_POST_CONFIGURE_HOOKS += ZEEK_FIX_PYTHON_PATH

Does this needs to be a post-configure hook ? Isn't that needed simply after the installation ?

I can't use @PYTHON_EXECUTABLE@ in a post install hook as cmake will replace it with the expanded value of $(HOST_DIR)/bin/python. I could replace $(HOST_DIR) by /usr in a post install hook but I find this solution less elegant.
Another option would be to patch ssh_runner.py but I don't think that upstream will accept that we hardcode /usr/bin/python.

Quoted 8 lines

Thanks,

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Best Regards,

Fabrice

#4 lore raw

PATCH v3 2/2 package/zeek: new package

Quoted 8 lines · On Mon, 26 Oct 2020 23:50:22 +0100 Fabrice Fontaine…
Quoted 2 lines

Does this needs to be a post-configure hook ? Isn't that needed simply after the installation ?

I can't use @PYTHON_EXECUTABLE@ in a post install hook as cmake will replace it with the expanded value of $(HOST_DIR)/bin/python. I could replace $(HOST_DIR) by /usr in a post install hook but I find this solution less elegant.
Another option would be to patch ssh_runner.py but I don't think that upstream will accept that we hardcode /usr/bin/python.

OK, thanks for the additional explanation, makes sense.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com