initial buildroot for linux 5.15
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
From 44fe2328b715db25134ee095526d2fa47e6cd834 Mon Sep 17 00:00:00 2001
|
||||
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
|
||||
Date: Wed, 1 Jan 2020 15:25:57 +0100
|
||||
Subject: [PATCH] python: ensure proper shabang on python scripts
|
||||
|
||||
When instlling python scripts, distutils would use the python used to
|
||||
run setup.py as shabang for the scripts it installs.
|
||||
|
||||
However, when cross-compiling, this is most often not correct.
|
||||
|
||||
Instead, using '/usr/bin/env python' is guaranteed to find the proper
|
||||
python in the PATH, so we need to instruct setyup.py to use that as the
|
||||
executable.
|
||||
|
||||
[yann.morin.1998@free.fr:
|
||||
- author did not provide their SoB, but it's simple enough to
|
||||
not require it for once
|
||||
- provide proper commit log
|
||||
]
|
||||
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
|
||||
[Fabrice: update for 6.0.0]
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
---
|
||||
python/Makefile.am | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/python/Makefile.am b/python/Makefile.am
|
||||
index 59d195f29..a41604f72 100644
|
||||
--- a/python/Makefile.am
|
||||
+++ b/python/Makefile.am
|
||||
@@ -6,11 +6,11 @@ EXTRA_DIST = setup.py \
|
||||
if HAVE_PYTHON_DISTUTILS
|
||||
all-local:
|
||||
cd $(srcdir) && \
|
||||
- $(HAVE_PYTHON) setup.py build --build-base "$(abs_builddir)"
|
||||
+ $(HAVE_PYTHON) setup.py build -e "/usr/bin/env python" --build-base "$(abs_builddir)"
|
||||
|
||||
install-exec-local:
|
||||
cd $(srcdir) && \
|
||||
- $(HAVE_PYTHON) setup.py build --build-base "$(abs_builddir)" \
|
||||
+ $(HAVE_PYTHON) setup.py build -e "/usr/bin/env python" --build-base "$(abs_builddir)" \
|
||||
install --prefix $(DESTDIR)$(prefix)
|
||||
|
||||
uninstall-local:
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 7ab4d5eb55e1d3900390b76e5f46e80e22d4e80e Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Sat, 10 Oct 2020 21:34:21 +0200
|
||||
Subject: [PATCH] configure.ac: allow the user to override RUST_TARGET
|
||||
|
||||
When cross-compiling, RUST_TARGET is not always equal to host_triplet
|
||||
(e.g. buildroot) so allow the user to override this default value
|
||||
through RUST_TARGET environment variable
|
||||
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
---
|
||||
configure.ac | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 32c230209..7d7c9373f 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -2489,7 +2489,12 @@ fi
|
||||
have_rust_vendor="no"
|
||||
|
||||
if test "x$cross_compiling" = "xyes"; then
|
||||
- RUST_SURICATA_LIB_XC_DIR="${host_alias}/"
|
||||
+ if test "x$RUST_TARGET" != "x"; then
|
||||
+ RUST_SURICATA_LIB_XC_DIR="$RUST_TARGET/"
|
||||
+ AC_SUBST([RUST_TARGET],["--target $RUST_TARGET"])
|
||||
+ else
|
||||
+ RUST_SURICATA_LIB_XC_DIR="${host_alias}/"
|
||||
+ fi
|
||||
else
|
||||
if test "x$CARGO_BUILD_TARGET" = "x"; then
|
||||
RUST_SURICATA_LIB_XC_DIR=
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
config BR2_PACKAGE_SURICATA
|
||||
bool "suricata"
|
||||
depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
|
||||
depends on BR2_USE_MMU # fork()
|
||||
depends on BR2_USE_WCHAR
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
select BR2_PACKAGE_HOST_RUSTC
|
||||
select BR2_PACKAGE_JANSSON
|
||||
select BR2_PACKAGE_LIBHTP
|
||||
select BR2_PACKAGE_LIBPCAP
|
||||
select BR2_PACKAGE_LIBYAML
|
||||
select BR2_PACKAGE_PCRE
|
||||
help
|
||||
Suricata is a free and open source, mature, fast and robust
|
||||
network threat detection engine.
|
||||
|
||||
The Suricata engine is capable of real time intrusion
|
||||
detection (IDS), inline intrusion prevention (IPS), network
|
||||
security monitoring (NSM) and offline pcap processing.
|
||||
|
||||
https://suricata-ids.org
|
||||
|
||||
comment "suricata needs a toolchain w/ wchar, threads"
|
||||
depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
|
||||
depends on BR2_USE_MMU
|
||||
depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
|
||||
@@ -0,0 +1,64 @@
|
||||
#!/bin/sh
|
||||
|
||||
DAEMON=suricata
|
||||
PIDFILE=/var/run/$DAEMON.pid
|
||||
|
||||
SURICATA_ARGS="-c /etc/suricata/suricata.yaml -i eth0"
|
||||
|
||||
SURICATA_RELOAD=0
|
||||
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
start() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
mkdir -p /var/log/suricata
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $SURICATA_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
start-stop-daemon -K -q -p "$PIDFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
||||
# SIGUSR2 makes suricata reload rules
|
||||
reload() {
|
||||
printf 'Reloading %s: ' "$DAEMON"
|
||||
start-stop-daemon -K -s "$SURICATA_RELOAD" -q -p "$PIDFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
||||
@@ -0,0 +1,6 @@
|
||||
# Locally computed:
|
||||
sha256 a8f197e33d1678689ebbf7bc1abe84934c465d22c504c47c2c7e9b74aa042d0d suricata-6.0.4.tar.gz
|
||||
|
||||
# Hash for license files:
|
||||
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
|
||||
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSE
|
||||
@@ -0,0 +1,136 @@
|
||||
################################################################################
|
||||
#
|
||||
# suricata
|
||||
#
|
||||
################################################################################
|
||||
|
||||
SURICATA_VERSION = 6.0.4
|
||||
SURICATA_SITE = https://www.openinfosecfoundation.org/download
|
||||
SURICATA_LICENSE = GPL-2.0
|
||||
SURICATA_LICENSE_FILES = COPYING LICENSE
|
||||
SURICATA_CPE_ID_VENDOR = oisf
|
||||
# 0001-python-ensure-proper-shabang-on-python-scripts.patch
|
||||
# 0002-configure.ac-allow-the-user-to-override-RUST_TARGET.patch
|
||||
SURICATA_AUTORECONF = YES
|
||||
|
||||
SURICATA_DEPENDENCIES = \
|
||||
host-pkgconf \
|
||||
host-rustc \
|
||||
jansson \
|
||||
$(if $(BR2_PACKAGE_LIBCAP_NG),libcap-ng) \
|
||||
$(if $(BR2_PACKAGE_LIBEVENT),libevent) \
|
||||
libhtp \
|
||||
$(if $(BR2_PACKAGE_LIBNFNETLINK),libnfnetlink) \
|
||||
libpcap \
|
||||
libyaml \
|
||||
$(if $(BR2_PACKAGE_LZ4),lz4) \
|
||||
pcre \
|
||||
$(if $(BR2_PACKAGE_XZ),xz)
|
||||
|
||||
SURICATA_CONF_ENV = \
|
||||
ac_cv_path_HAVE_SPHINXBUILD=no \
|
||||
CARGO_HOME=$(HOST_DIR)/share/cargo \
|
||||
RUST_TARGET=$(RUSTC_TARGET_NAME)
|
||||
|
||||
SURICATA_CONF_OPTS = \
|
||||
--disable-gccprotect \
|
||||
--disable-pie \
|
||||
--disable-suricata-update \
|
||||
--enable-non-bundled-htp
|
||||
|
||||
# install: install binaries
|
||||
# install-conf: install initial configuration files
|
||||
# install-full: install binaries, configuration and rules (rules will be
|
||||
# download through wget/curl)
|
||||
SURICATA_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) install install-conf
|
||||
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
||||
SURICATA_CONF_ENV += LIBS=-latomic
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_FILE),y)
|
||||
SURICATA_DEPENDENCIES += file
|
||||
SURICATA_CONF_OPTS += --enable-libmagic
|
||||
else
|
||||
SURICATA_CONF_OPTS += --disable-libmagic
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBMAXMINDDB),y)
|
||||
SURICATA_DEPENDENCIES += libmaxminddb
|
||||
SURICATA_CONF_OPTS += --enable-geoip
|
||||
else
|
||||
SURICATA_CONF_OPTS += --disable-geoip
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_HIREDIS),y)
|
||||
SURICATA_DEPENDENCIES += hiredis
|
||||
SURICATA_CONF_OPTS += --enable-hiredis
|
||||
else
|
||||
SURICATA_CONF_OPTS += --disable-hiredis
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBNET),y)
|
||||
SURICATA_DEPENDENCIES += libnet
|
||||
SURICATA_CONF_OPTS += --with-libnet-includes=$(STAGING_DIR)/usr/include
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBNETFILTER_LOG),y)
|
||||
SURICATA_DEPENDENCIES += libnetfilter_log
|
||||
SURICATA_CONF_OPTS += --enable-nflog
|
||||
else
|
||||
SURICATA_CONF_OPTS += --disable-nflog
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBNETFILTER_QUEUE),y)
|
||||
SURICATA_DEPENDENCIES += libnetfilter_queue
|
||||
SURICATA_CONF_OPTS += --enable-nfqueue
|
||||
else
|
||||
SURICATA_CONF_OPTS += --disable-nfqueue
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBNSPR),y)
|
||||
SURICATA_DEPENDENCIES += libnspr
|
||||
SURICATA_CONF_OPTS += --enable-nspr
|
||||
else
|
||||
SURICATA_CONF_OPTS += --disable-nspr
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBNSS),y)
|
||||
SURICATA_DEPENDENCIES += libnss
|
||||
SURICATA_CONF_OPTS += --enable-nss
|
||||
else
|
||||
SURICATA_CONF_OPTS += --disable-nss
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LUA),y)
|
||||
SURICATA_CONF_OPTS += --enable-lua
|
||||
SURICATA_DEPENDENCIES += lua
|
||||
else
|
||||
SURICATA_CONF_OPTS += --disable-lua
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LUAJIT),y)
|
||||
SURICATA_CONF_OPTS += --enable-luajit
|
||||
SURICATA_DEPENDENCIES += luajit
|
||||
else
|
||||
SURICATA_CONF_OPTS += --disable-luajit
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
|
||||
SURICATA_CONF_OPTS += --enable-python
|
||||
SURICATA_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON),python,python3)
|
||||
else
|
||||
SURICATA_CONF_OPTS += --disable-python
|
||||
endif
|
||||
|
||||
define SURICATA_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -D -m 0755 package/suricata/S99suricata \
|
||||
$(TARGET_DIR)/etc/init.d/S99suricata
|
||||
endef
|
||||
|
||||
define SURICATA_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -D -m 644 package/suricata/suricata.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/suricata.service
|
||||
endef
|
||||
|
||||
$(eval $(autotools-package))
|
||||
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Suricata Intrusion Detection Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/etc/default/suricata
|
||||
ExecStartPre=/bin/rm -f /var/run/suricata.pid
|
||||
ExecStartPre=/usr/bin/mkdir -p /var/log/suricata
|
||||
ExecStart=/usr/bin/suricata -c /etc/suricata/suricata.yaml -i eth0 --pidfile /var/run/suricata.pid
|
||||
ExecReload=/bin/kill -USR2 $MAINPID
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user