Dynamic Linking with MUSL?

Does anyone know if the OpenWrt's MUSL toolchain links libs dynamic or statically? Is it the same across all devices?

I have a vague memory of reading somewhere it was always dynamically links, but I'm trying to make sure.

Is there a CONFIG_ I can reference against?

Almost all libraries are dynamic and linked dynamic to the other libraries and binaries.

I do not know that there is a global config flag, so that everything gets statically linked.

If there is some config option it will be package specific.

You can try to set -static in the custom CFLAGS/LDFLAGS. But i think this will throw at least some errors if you set it globally...

1 Like

I'm not trying to set a static or dynamic environment, I'm trying to learn which one is used in which situation.

x86_64 GNU probably isn't dynamically linked?

It's also probably I'm just asking the wrong question.. I suppose the question is: Are their targets are use MUSL that aren't dynamically linked - Can I assume MUSL = Dynamically linked.

Almost everything is dynamically linked to save every possible KB in persistent storage and also ram.
Also x86_64 is dynamically linked!
This doesn't depends on the used c library and is true for glibc, musl and also the old uclibc.

Another important point is if for example the openssl library has a vulnerability, then only the dynamic library has to be updated with an ABI compatible version instead of recompiling every binary that is statically linked against the vulnerable openssl library.

So in short, you will find only a few binaries that are statically linked against libraries and this will have a good reason to do so.

1 Like

I'm working to put Rust language integration into OpenWrt. By default, rust statically links the libraries. I had to change this for my testing to dynamically linked.

Linux-MUSL defaults to statically linking under Rust, unless its changed

    // These targets statically link libc by default
    base.crt_static_default = true;

So, I should change this to dynamically link under OpenWrt for the whole kit, rather than just my test triple :wink: I was looking at potentially having to go through every triple target to determine static vs dynamic linking for MUSL.

Thanks!

1 Like

That would be great if you're able to bring rust lang support to the OpenWrt build system.
If i
I'm right, you aren't the first one that tried this...

So then all targets should use dynamic linking against the c library, which is the only one library written in c/c++ that rust uses if I'm right.

Oh, it's already done. I wanted to compile Suricata 6 and test it.

The overall package is shoddy and hackish and barely works - which is why I posted it.. However.. it generates (or will) a dist-installation archive for the host and target triples. I've tested it on mips64 octeon3 and a armv7 build as well. It required making custom triple targets for the mips64 and some other things for the armv7. I'm looking for testers to break it :smiley:

1 Like

Cool :sunglasses: Keep your work going.

Do you have also a package that is ready to compile and uses rust?
I'm also interested in suricata on OpenWrt.

I finally got Suricata6 to work properly the other day. The issues with soft-float and dynamically linking was causing issues.

root@OpenWrt:/# suricata -vvv -c /etc/suricata/suricata.yaml -i eth0
[2282] 11/11/2020 -- 00:30:00 - (suricata.c:1065) <Notice> (LogVersion) -- This is Suricata version 6.0.0-dev running in SYSTEM mode
[2282] 11/11/2020 -- 00:30:00 - (util-cpu.c:178) <Info> (UtilCpuPrintSummary) -- CPUs/cores online: 2
[2282] 11/11/2020 -- 00:30:00 - (app-layer-htp.c:2414) <Config> (HTPConfigSetDefaultsPhase2) -- 'default' server has 'request-body-minimal-inspect-size' set to 33934 and 'request-bod.
[2282] 11/11/2020 -- 00:30:00 - (app-layer-htp.c:2432) <Config> (HTPConfigSetDefaultsPhase2) -- 'default' server has 'response-body-minimal-inspect-size' set to 40181 and 'response-b.
[2282] 11/11/2020 -- 00:30:00 - (app-layer-smb.c:316) <Config> (RegisterSMBParsers) -- SMB stream depth: 0
[2282] 11/11/2020 -- 00:30:00 - (app-layer-modbus.c:1514) <Config> (RegisterModbusParsers) -- Protocol detection and parser disabled for modbus protocol.
[2282] 11/11/2020 -- 00:30:00 - (app-layer-enip.c:463) <Config> (RegisterENIPUDPParsers) -- Protocol detection and parser disabled for enip protocol.
[2282] 11/11/2020 -- 00:30:00 - (app-layer-dnp3.c:1606) <Config> (RegisterDNP3Parsers) -- Protocol detection and parser disabled for DNP3.
[2282] 11/11/2020 -- 00:30:00 - (util-ioctl.c:111) <Info> (GetIfaceMTU) -- Found an MTU of 1500 for 'eth0'
[2282] 11/11/2020 -- 00:30:00 - (util-ioctl.c:111) <Info> (GetIfaceMTU) -- Found an MTU of 1500 for 'eth0'
[2282] 11/11/2020 -- 00:30:00 - (host.c:256) <Config> (HostInitConfig) -- allocated 262144 bytes of memory for the host hash... 4096 buckets of size 64
[2282] 11/11/2020 -- 00:30:00 - (host.c:281) <Config> (HostInitConfig) -- preallocated 1000 hosts of size 136
[2282] 11/11/2020 -- 00:30:00 - (host.c:283) <Config> (HostInitConfig) -- host memory usage: 398144 bytes, maximum: 33554432
[2282] 11/11/2020 -- 00:30:00 - (util-coredump-config.c:149) <Config> (CoredumpLoadConfig) -- Core dump size set to unlimited.
[2282] 11/11/2020 -- 00:30:00 - (defrag-hash.c:251) <Config> (DefragInitConfig) -- allocated 3670016 bytes of memory for the defrag hash... 65536 buckets of size 56
[2282] 11/11/2020 -- 00:30:00 - (defrag-hash.c:278) <Config> (DefragInitConfig) -- preallocated 65535 defrag trackers of size 160
[2282] 11/11/2020 -- 00:30:00 - (defrag-hash.c:285) <Config> (DefragInitConfig) -- defrag memory usage: 14155616 bytes, maximum: 33554432
[2282] 11/11/2020 -- 00:30:00 - (flow.c:636) <Config> (FlowInitConfig) -- flow size 320, memcap allows for 419430 flows. Per hash row in perfect conditions 6
[2282] 11/11/2020 -- 00:30:00 - (stream-tcp.c:398) <Config> (StreamTcpInitConfig) -- stream "prealloc-sessions": 2048 (per thread)
[2282] 11/11/2020 -- 00:30:00 - (stream-tcp.c:418) <Config> (StreamTcpInitConfig) -- stream "memcap": 67108864
[2282] 11/11/2020 -- 00:30:00 - (stream-tcp.c:424) <Config> (StreamTcpInitConfig) -- stream "midstream" session pickups: disabled
[2282] 11/11/2020 -- 00:30:00 - (stream-tcp.c:430) <Config> (StreamTcpInitConfig) -- stream "async-oneside": disabled
[2282] 11/11/2020 -- 00:30:00 - (stream-tcp.c:445) <Config> (StreamTcpInitConfig) -- stream "checksum-validation": enabled
[2282] 11/11/2020 -- 00:30:00 - (stream-tcp.c:473) <Config> (StreamTcpInitConfig) -- stream."inline": disabled
[2282] 11/11/2020 -- 00:30:00 - (stream-tcp.c:486) <Config> (StreamTcpInitConfig) -- stream "bypass": disabled
[2282] 11/11/2020 -- 00:30:00 - (stream-tcp.c:510) <Config> (StreamTcpInitConfig) -- stream "max-synack-queued": 5
[2282] 11/11/2020 -- 00:30:00 - (stream-tcp.c:531) <Config> (StreamTcpInitConfig) -- stream.reassembly "memcap": 268435456
[2282] 11/11/2020 -- 00:30:00 - (stream-tcp.c:550) <Config> (StreamTcpInitConfig) -- stream.reassembly "depth": 1048576
[2282] 11/11/2020 -- 00:30:00 - (stream-tcp.c:624) <Config> (StreamTcpInitConfig) -- stream.reassembly "toserver-chunk-size": 2489
[2282] 11/11/2020 -- 00:30:00 - (stream-tcp.c:626) <Config> (StreamTcpInitConfig) -- stream.reassembly "toclient-chunk-size": 2465
[2282] 11/11/2020 -- 00:30:00 - (stream-tcp.c:639) <Config> (StreamTcpInitConfig) -- stream.reassembly.raw: enabled
[2282] 11/11/2020 -- 00:30:00 - (stream-tcp-reassemble.c:377) <Config> (StreamTcpReassemblyConfig) -- stream.reassembly "segment-prealloc": 2048
[2282] 11/11/2020 -- 00:30:00 - (util-logopenfile.c:570) <Info> (SCConfLogOpenGeneric) -- fast output device (regular) initialized: fast.log
[2282] 11/11/2020 -- 00:30:00 - (util-logopenfile.c:570) <Info> (SCConfLogOpenGeneric) -- eve-log output device (regular) initialized: eve.json
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'alert'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'anomaly'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'http'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'dns'
[2282] 11/11/2020 -- 00:30:00 - (output-json-dns.c:563) <Config> (JsonDnsParseVersion) -- eve-log dns version not set, defaulting to version 2
[2282] 11/11/2020 -- 00:30:00 - (output-json-dns.c:563) <Config> (JsonDnsParseVersion) -- eve-log dns version not set, defaulting to version 2
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'tls'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'files'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'smtp'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'ftp'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'rdp'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'nfs'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'smb'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'tftp'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'ikev2'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'dcerpc'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'krb5'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'snmp'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'rfb'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'sip'
[2282] 11/11/2020 -- 00:30:00 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'dhcp'
[2282] 11/11/2020 -- 00:30:01 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'ssh'
[2282] 11/11/2020 -- 00:30:01 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'mqtt'
[2282] 11/11/2020 -- 00:30:01 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'stats'
[2282] 11/11/2020 -- 00:30:01 - (runmodes.c:641) <Config> (RunModeInitializeEveOutput) -- enabling 'eve-log' module 'flow'
[2282] 11/11/2020 -- 00:30:01 - (util-logopenfile.c:570) <Info> (SCConfLogOpenGeneric) -- stats output device (regular) initialized: stats.log
[2282] 11/11/2020 -- 00:30:01 - (suricata.c:2189) <Config> (SetupDelayedDetect) -- Delayed detect disabled
[2282] 11/11/2020 -- 00:30:01 - (util-conf.c:161) <Info> (ConfUnixSocketIsEnable) -- Running in live mode, activating unix socket
[2282] 11/11/2020 -- 00:30:01 - (detect-engine.c:1994) <Config> (DetectEngineCtxInitReal) -- pattern matchers: MPM: ac, SPM: bm
[2282] 11/11/2020 -- 00:30:01 - (detect-engine.c:2403) <Config> (DetectEngineCtxLoadConf) -- grouping: tcp-whitelist (default) 53, 80, 139, 443, 445, 1433, 3306, 3389, 6666, 6667, 800
[2282] 11/11/2020 -- 00:30:01 - (detect-engine.c:2427) <Config> (DetectEngineCtxLoadConf) -- grouping: udp-whitelist (default) 53, 135, 5060
[2282] 11/11/2020 -- 00:30:01 - (detect-engine.c:2455) <Config> (DetectEngineCtxLoadConf) -- prefilter engines: MPM
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_uri
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_raw_uri
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_request_line
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_client_body
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_response_line
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_header
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_header
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_header_names
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_header_names
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_accept
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_accept_enc
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_accept_lang
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_referer
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_connection
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_content_len
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_content_len
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_content_type
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_content_type
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http.server
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http.location
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_protocol
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_protocol
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_start
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_start
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_raw_header
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_raw_header
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_method
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_cookie
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_cookie
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.name
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.name
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.name
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.name
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.name
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.name
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.name
[2282] 11/11/2020 -- 00:30:01 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.name
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.name
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.magic
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.magic
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.magic
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.magic
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.magic
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.magic
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.magic
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.magic
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.magic
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.magic
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file.magic
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_user_agent
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_host
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_raw_host
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_stat_msg
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http_stat_code
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http2_header_name
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http2_header_name
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http2_header
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for http2_header
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for dns_query
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for dnp3_data
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for dnp3_data
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for tls.sni
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for tls.cert_issuer
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for tls.cert_subject
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for tls.cert_serial
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for tls.cert_fingerprint
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for tls.certs
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for ja3.hash
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for ja3.string
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for ja3s.hash
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for ja3s.string
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for dce_stub_data
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for dce_stub_data
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for dce_stub_data
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for dce_stub_data
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for smb_named_pipe
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for smb_share
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for ssh.proto
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for ssh.proto
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for ssh_software
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for ssh_software
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for ssh.hassh
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for ssh.hassh.server
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for ssh.hassh.string
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for ssh.hassh.server.string
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file_data
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file_data
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file_data
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file_data
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file_data
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for file_data
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for krb5_cname
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for krb5_sname
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for sip.method
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for sip.uri
[2282] 11/11/2020 -- 00:30:02 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for sip.protocol
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for sip.protocol
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for sip.method
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for sip.stat_msg
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for sip.request_line
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for sip.response_line
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for rfb.name
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for snmp.community
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for snmp.community
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for mqtt.connect.clientid
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for mqtt.connect.username
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for mqtt.connect.password
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for mqtt.connect.willtopic
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for mqtt.connect.willmessage
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for mqtt.publish.topic
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for mqtt.publish.message
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for mqtt.subscribe.topic
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:246) <Perf> (DetectMpmInitializeAppMpms) -- using shared mpm ctx' for mqtt.unsubscribe.topic
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:413) <Perf> (DetectMpmInitializePktMpms) -- using shared mpm ctx' for tcp.hdr
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:413) <Perf> (DetectMpmInitializePktMpms) -- using shared mpm ctx' for udp.hdr
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:413) <Perf> (DetectMpmInitializePktMpms) -- using shared mpm ctx' for icmpv6.hdr
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:413) <Perf> (DetectMpmInitializePktMpms) -- using shared mpm ctx' for ipv4.hdr
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:413) <Perf> (DetectMpmInitializePktMpms) -- using shared mpm ctx' for ipv6.hdr
[2282] 11/11/2020 -- 00:30:03 - (reputation.c:603) <Config> (SRepInit) -- IP reputation disabled
[2282] 11/11/2020 -- 00:30:03 - (util-classification-config.c:363) <Info> (SCClassConfParseFile) -- Added "43" classification types from the classification file
[2282] 11/11/2020 -- 00:30:03 - (util-reference-config.c:339) <Info> (SCRConfParseFile) -- Added "19" reference types from the reference.config file
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-loader.c:232) <Warning> (ProcessSigFiles) -- [ERRCODE: SC_ERR_NO_RULES(42)] - No rule files match the pattern /etc/suricata/rules/surics
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-loader.c:322) <Config> (SigLoadSignatures) -- No rules loaded from suricata.rules.
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-loader.c:347) <Warning> (SigLoadSignatures) -- [ERRCODE: SC_ERR_NO_RULES_LOADED(43)] - 1 rule files specified, but no rules were loaded!
[2282] 11/11/2020 -- 00:30:03 - (util-threshold-config.c:1091) <Info> (SCThresholdConfParseFile) -- Threshold config parsed: 0 rule(s) found
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:470) <Perf> (SetupBuiltinMpm) -- using shared mpm ctx' for tcp-packet
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:470) <Perf> (SetupBuiltinMpm) -- using shared mpm ctx' for tcp-stream
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:470) <Perf> (SetupBuiltinMpm) -- using shared mpm ctx' for udp-packet
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:470) <Perf> (SetupBuiltinMpm) -- using shared mpm ctx' for other-ip
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-build.c:1412) <Info> (SigAddressPrepareStage1) -- 0 signatures processed. 0 are IP-only rules, 0 are inspecting packet payload, 0 inspey
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-build.c:1418) <Config> (SigAddressPrepareStage1) -- building signature grouping structure, stage 1: preprocessing rules... complete
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-build.c:1256) <Perf> (RulesGroupByPorts) -- TCP toserver: 0 port groups, 0 unique SGH's, 0 copies
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-build.c:1256) <Perf> (RulesGroupByPorts) -- TCP toclient: 0 port groups, 0 unique SGH's, 0 copies
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-build.c:1256) <Perf> (RulesGroupByPorts) -- UDP toserver: 0 port groups, 0 unique SGH's, 0 copies
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-build.c:1256) <Perf> (RulesGroupByPorts) -- UDP toclient: 0 port groups, 0 unique SGH's, 0 copies
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-build.c:1004) <Perf> (RulesGroupByProto) -- OTHER toserver: 0 proto groups, 0 unique SGH's, 0 copies
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-build.c:1041) <Perf> (RulesGroupByProto) -- OTHER toclient: 0 proto groups, 0 unique SGH's, 0 copies
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-build.c:1786) <Perf> (SigAddressPrepareStage4) -- Unique rule groups: 0
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:1158) <Perf> (MpmStoreReportStats) -- Builtin MPM "toserver TCP packet": 0
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:1158) <Perf> (MpmStoreReportStats) -- Builtin MPM "toclient TCP packet": 0
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:1158) <Perf> (MpmStoreReportStats) -- Builtin MPM "toserver TCP stream": 0
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:1158) <Perf> (MpmStoreReportStats) -- Builtin MPM "toclient TCP stream": 0
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:1158) <Perf> (MpmStoreReportStats) -- Builtin MPM "toserver UDP packet": 0
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:1158) <Perf> (MpmStoreReportStats) -- Builtin MPM "toclient UDP packet": 0
[2282] 11/11/2020 -- 00:30:03 - (detect-engine-mpm.c:1158) <Perf> (MpmStoreReportStats) -- Builtin MPM "other IP packet": 0
[2282] 11/11/2020 -- 00:30:03 - (runmode-af-packet.c:320) <Config> (ParseAFPConfig) -- Using flow cluster mode for AF_PACKET (iface eth0)
[2282] 11/11/2020 -- 00:30:03 - (runmode-af-packet.c:324) <Config> (ParseAFPConfig) -- Using defrag kernel functionality for AF_PACKET (iface eth0)
[2282] 11/11/2020 -- 00:30:03 - (runmode-af-packet.c:639) <Perf> (ParseAFPConfig) -- 2 cores, so using 2 threads
[2282] 11/11/2020 -- 00:30:03 - (runmode-af-packet.c:651) <Perf> (ParseAFPConfig) -- Using 2 AF_PACKET threads for interface eth0
[2282] 11/11/2020 -- 00:30:03 - (util-ioctl.c:442) <Perf> (DisableIfaceOffloadingLinux) -- eth0: disabling gro offloading
[2282] 11/11/2020 -- 00:30:03 - (util-ioctl.c:456) <Perf> (DisableIfaceOffloadingLinux) -- eth0: disabling gso offloading
[2282] 11/11/2020 -- 00:30:03 - (util-ioctl.c:463) <Perf> (DisableIfaceOffloadingLinux) -- eth0: disabling sg offloading
[2282] 11/11/2020 -- 00:30:03 - (util-ioctl.c:322) <Warning> (SetEthtoolValue) -- [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to set feature via ioctl for 'eth0': Not support)
[2282] 11/11/2020 -- 00:30:03 - (runmode-af-packet.c:708) <Config> (ParseAFPConfig) -- eth0: enabling zero copy mode by using data release call
[2282] 11/11/2020 -- 00:30:03 - (util-runmodes.c:264) <Info> (RunModeSetLiveCaptureWorkersForDevice) -- Going to use 2 thread(s)
[2289] 11/11/2020 -- 00:30:03 - (util-magic.c:78) <Error> (MagicInitContext) -- [ERRCODE: SC_ERR_MAGIC_LOAD(197)] - magic_load failed: could not find any valid magic files!
[2290] 11/11/2020 -- 00:30:03 - (util-magic.c:78) <Error> (MagicInitContext) -- [ERRCODE: SC_ERR_MAGIC_LOAD(197)] - magic_load failed: could not find any valid magic files!
[2282] 11/11/2020 -- 00:30:03 - (flow-manager.c:1063) <Config> (FlowManagerThreadSpawn) -- using 1 flow manager threads
[2282] 11/11/2020 -- 00:30:03 - (flow-manager.c:1266) <Config> (FlowRecyclerThreadSpawn) -- using 1 flow recycler threads
[2282] 11/11/2020 -- 00:30:03 - (util-conf.c:161) <Info> (ConfUnixSocketIsEnable) -- Running in live mode, activating unix socket
[2282] 11/11/2020 -- 00:30:03 - (unix-manager.c:132) <Info> (UnixNew) -- Using unix socket file '/var/run/suricata/suricata-command.socket'
[2282] 11/11/2020 -- 00:30:03 - (unix-manager.c:149) <Info> (Un[  135.758385] device eth0 entered promiscuous mode
ixNew) -- Created socket directory /var/run/suricata/
[2282] 11/11/2020 -- 00:30:03 - (tm-threads.c:1964) <Notice> (TmThreadWaitOnThreadInit) -- all 2 packet processing threads, 4 management threads initialized, engine started.
[2289] 11/11/2020 -- 00:30:04 - (source-af-packet.c:1742) <Perf> (AFPComputeRingParams) -- AF_PACKET RX Ring params: block_size=32768 block_nr=1 frame_size=1600 frame_nr=20
[2290] 11/11/2020 -- 00:30:04 - (source-af-packet.c:1742) <Perf> (AFPComputeRingParams) -- AF_PACKET RX Ring params: block_size=32768 block_nr=1 frame_size=1600 frame_nr=20
[2290] 11/11/2020 -- 00:30:04 - (source-af-packet.c:507) <Info> (AFPPeersListReachedInc) -- All AFP capture threads are running.

Suricata 6.0.0-beta1 Makefile - this uses the rust pr I linked in order to supply the rust/host requirement. This whole thing is in flux because I've been re-doing Rust, which then leads to redoing Suricata, which goes back.. etc.. This is also very much a WIP package-wise, but it does work.

suricata6/Makefile - I've not tested the updated version - YMMV on this Makefile working out of the box.

#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk

PKG_NAME:=suricata
PKG_VERSION:=6.0.0-beta1

PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2020-10-08
PKG_SOURCE_VERSION:=95729e923f39b5adda31e4843a1b6ee06edbb0c8
PKG_SOURCE_URL:=https://github.com/OISF/suricata.git
PKG_HASH:=skip

SURICATA-UPDATE_SOURCE_DATE:=2020-10-05
SURICATA-UPDATE_SOURCE_VERSION:=86e530cbbfc78ac327072750a12edf888e6b8cae
SURICATA-UPDATE_SOURCE_URL:=https://github.com/OISF/suricata-update.git
SURICATA-UPDATE_HASH:=skip

PKG_FIXUP:=autoreconf
PKG_FIXUP:=patch-libtool

PKG_INSTALL:=1
HOST_BUILD_DEPENDS:=rust/host python3/host luajit/host

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
include ../../lang/rust/rustc-triple.mk

define Package/suricata6
    SUBMENU:=Firewall
    SECTION:=net
    CATEGORY:=Network
    DEPENDS:=+jansson +libcap-ng +libevent2 +libhiredis +libhtp +liblz4 \
      +libmagic +libpcap +libpcre +libmaxminddb +libnet-1.2.x \
	 +libnetfilter-log +libnetfilter-queue +libnfnetlink +libnss \
	 +libopenssl +luajit +python3 +python3-yaml +python3-yaml-src +zlib \
	 $(ICONV_DEPENDS)
    TITLE:=OISF Suricata IDS
    URL:=https://www.openinfosecfoundation.org/
endef

CONFIGURE_VARS += \
	CARGO_HOME=$(CARGO_HOME) \
	ac_cv_path_CARGO="$(CARGO_HOME)/bin/cargo" \
	ac_cv_path_RUSTC="$(CARGO_HOME)/bin/rustc"
#	RUSTFLAGS="-C linker=$(TARGET_CC_NOCACHE) -C ar=$(TARGET_AR)"

CONFIGURE_ARGS = \
  	--prefix="/usr" \
  	--sysconfdir="/etc" \
  	--localstatedir="/var" \
  	--enable-nfqueue \
     --enable-af-packet \
     --enable-unittests \
	--enable-luajit \
	--enable-geoip \
     --enable-debug \
	--host=$(RUSTC_TARGET_ARCH) \
	--build=$(RUSTC_HOST_ARCH) \
	--with-suricata-update \
	--enable-non-bundled-htp \
	--with-sysroot=$(STAGING_DIR)

#	--enable-ebpf-build \
#     --enable-profiling \
#     --enable-profiling-locks \
#     --enable-af-packet \
#	--enable-luajit \
#	--enable-geoip \
#	--enable-unittests \
#	--enable-hiredis \
#	--enable-ipfw

SURICATA_PATHS = \
	--with-zlib-includes=$(STAGING_DIR)/usr/include/ \
	--with-zlib-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libpcre-includes=$(STAGING_DIR)/usr/include/ \
	--with-libpcre-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libhs-includes=$(STAGING_DIR)/usr/include/ \
	--with-libhs-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libyaml-includes=$(STAGING_DIR)/usr/include/ \
	--with-libyaml-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libpthread-includes=$(STAGING_DIR)/usr/include/ \
	--with-libpthread-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libjansson-includes=$(STAGING_DIR)/usr/include/ \
	--with-libjansson-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libnfnetlink-includes=$(STAGING_DIR)/usr/include/ \
	--with-libnfnetlink-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libnetfilter_queue-includes=$(STAGING_DIR)/usr/include/ \
	--with-libnetfilter_queue-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libnet-includes=$(STAGING_DIR)/usr/include/ \
	--with-libnet-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libpcap-includes=$(STAGING_DIR)/usr/include/ \
	--with-libpcap-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libpfring-includes=$(STAGING_DIR)/usr/include/ \
	--with-libpfring-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-netmap-includes=$(STAGING_DIR)/usr/include/ \
	--with-libhtp-includes=$(STAGING_DIR)/usr/include/ \
	--with-libhtp-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libcap_ng-includes=$(STAGING_DIR)/usr/include/ \
	--with-libcap_ng-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-dag-includes=$(STAGING_DIR)/usr/include/ \
	--with-dag-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libnspr-includes=$(STAGING_DIR)/usr/include/ \
	--with-libnspr-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libnss-includes=$(STAGING_DIR)/usr/include/ \
	--with-libnss-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libmagic-includes=$(STAGING_DIR)/usr/include/ \
	--with-libmagic-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-napatech-includes=$(STAGING_DIR)/usr/include/ \
	--with-napatech-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-liblua-includes=$(STAGING_DIR)/usr/include/ \
	--with-liblua-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libluajit-includes=$(STAGING_DIR)/usr/include/ \
	--with-libluajit-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libmaxminddb-includes=$(STAGING_DIR)/usr/include/ \
	--with-libmaxminddb-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libevent-includes=$(STAGING_DIR)/usr/include/ \
	--with-libevent-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libhiredis-includes=$(STAGING_DIR)/usr/include/ \
	--with-libhiredis-libraries=$(STAGING_DIR)/usr/lib/ \
	--with-libnetfilter_log-includes=$(STAGING_DIR)/usr/include/ \
	--with-libnetfilter_log-libraries=$(STAGING_DIR)/usr/lib/

define Build/Prepare
	$(call Build/Prepare/Default)
	$(CONFIGURE_VARS) cargo install cbindgen
	$(call HostPython3/Run,,$(HOST_PYTHON3_PIP_INSTALL_HOST) PyYAML)
endef

define Build/Configure
	cd $(PKG_BUILD_DIR) && $(CONFIGURE_VARS) ./autogen.sh
	$(call Build/Configure/Default)
endef

define Package/suricata6/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/suricata $(1)/usr/bin/suricata
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/suricatactl $(1)/usr/bin/suricatactl
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/suricatasc $(1)/usr/bin/suricatasc

	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) -r $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/

	$(INSTALL_DIR) $(1)/usr/include
	$(CP) -r $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/

	$(INSTALL_DIR) $(1)/usr/share
	$(CP) -r $(PKG_INSTALL_DIR)/usr/share/* $(1)/usr/share/

	$(INSTALL_DIR) $(1)/etc/suricata
	$(CP) $(PKG_BUILD_DIR)/suricata.yaml \
	$(PKG_BUILD_DIR)/etc/classification.config \
	$(PKG_BUILD_DIR)/threshold.config \
	$(PKG_BUILD_DIR)/etc/reference.config \
	$(1)/etc/suricata/

#	$(INSTALL_DIR) $(1)/etc/suricata/rules
#	$(CP) $(PKG_BUILD_DIR)/rules/*.rules $(1)/etc/suricata/rules/
#	$(INSTALL_DIR) $(1)/etc/init.d
#	$(INSTALL_BIN) ./files/suricata.init $(1)/etc/init.d/suricata
endef

$(eval $(call BuildPackage,suricata6))
1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.