Rust-lang (rustc/cargo) for OpenWrt - testing needed

Interesting. I stopped investigating when I noticed your rust triple makefile couldn't find an appropriate triple, so maybe I should hack around it.

By the way, you have a check for finding multiple triples, but no check for finding no triples. Maybe you should add one for that as well.

Just set RUSTC_TARGET_ARCH:=mipsel-unknown-linux-musl in your rustc-triple.mk near the bottom to override it.

...
# Check to see if it's a soft-float target
ifeq ($(CONFIG_SOFT_FLOAT),y)
RUSTC_TARGET_ARCH:=$(strip $(filter %sf, $(RUSTC_TARGET_ARCH_BASE)))
else
RUSTC_TARGET_ARCH:=$(strip $(filter-out %sf, $(RUSTC_TARGET_ARCH_BASE)))
endif

# For Testing - Override
RUSTC_TARGET_ARCH:=mipsel-unknown-linux-musl

# More than one triple-target remains.
ifneq ($(word 2, $(RUSTC_TARGET_ARCH)),)
$(error RUSTC ERROR: Unsupported or Unknown Target Triple: $(RUSTC_TARGET_ARCH))
endif

# These are environment variables that are used by other packages to
# define where rustc/cargo are kept.
CARGO_HOME:=$(BUILD_DIR_HOST)/.cargo
RUSTUP_HOME:=$(BUILD_DIR_HOST)/.rustup

Here's an absolutely amazing little fact: after totally purging rust, rustup and cargo from my host and starting again, using the rustup makefile has added the OpenWrt buildroot cargo path to my .profile and .bash_profile.

I think perhaps you need --no-modify-path in your rustup-init.sh arguments, let me check...

There is probably a --prefix somewhere in there that can be set.

However, honestly, since I can't use rustup, I've not been paying attention to it. All of my focus has been on trying to get source building. It's different than it was, and so far, I've not yet hit a hard-stop wall yet...

There is also a command to not call the system linker, if I remember right.

Here's the full command I have right now in my Makefile. I think it can be pruned though, so I'll let you know:

define Build/Compile
	source $(CARGO_HOME)/env && \
	CARGO_HOME=$(CARGO_HOME) \
	RUSTUP_HOME=$(RUSTUP_HOME) \
	TARGET_CC=$(TARGET_CC_NOCACHE) \
	TARGET_CXX=$(TARGET_CXX_NOCACHE) \
	PKG_CONFIG_ALLOW_CROSS=1 \
	CROSS_COMPILE=$(CROSS_PREFIX) \
	RUSTFLAGS="-C linker=$(TARGET_CC_NOCACHE) -C ar=$(TARGET_AR)" \
	RUSTC="$(CARGO_HOME)/bin/rustc" \
	"$(CARGO_HOME)/bin/cargo" build --target $(RUSTC_TARGET_ARCH) --manifest-path $(PKG_BUILD_DIR)/Cargo.toml
endef

In fact, for my extremely basic hello world program, the minimal set of env vars I needed was:

define Build/Compile
	source $(CARGO_HOME)/env && \
	CARGO_HOME=$(CARGO_HOME) \
 	RUSTUP_HOME=$(RUSTUP_HOME) \
	RUSTFLAGS="-C linker=$(TARGET_CC_NOCACHE) -C ar=$(TARGET_AR)" \
	"$(CARGO_HOME)/bin/cargo" build --target $(RUSTC_TARGET_ARCH) --manifest-path $(PKG_BUILD_DIR)/Cargo.toml
endef
1 Like

The environmental source call is called as part of the Host/Configure in rustup, which means it should be in place by the time your package and the HOST_BUILD_DEPENDS:=rustup/host is called. Maybe move it to the rustc-triple.mkl to ensure it's called?

Since I'm having Linker issues, maybe what you've found will help. :+1:

define Host/Configure
	$(CONFIGURE_VARS) \
	$(BUILD_DIR_HOST)/$(PKG_SOURCE_SUBDIR)/rustup-init.sh -y -v $(RUSTUP_INIT_ARGS)
	source $(CARGO_HOME)/env
endef

Are you sure it carries over? I thought make spawned a new shell for each command (let alone stanza). I found I wasn't seeing the appropriate $PATH without it.

Because I'm not at all familar with rustc or cargo, I've generated the distro tarballs because apparently there are issues with cross-compiling internal to rust.

build-manifest-1.49.0-dev-x86_64-unknown-linux-gnu.tar.gz  rust-analyzer-1.49.0-dev-x86_64-unknown-linux-gnu.tar.xz
build-manifest-1.49.0-dev-x86_64-unknown-linux-gnu.tar.xz  rustc-1.49.0-dev-src.tar.gz
cargo-1.49.0-dev-x86_64-unknown-linux-gnu.tar.gz           rustc-1.49.0-dev-src.tar.xz
cargo-1.49.0-dev-x86_64-unknown-linux-gnu.tar.xz           rustc-1.49.0-dev-x86_64-unknown-linux-gnu.tar.gz
clippy-1.49.0-dev-x86_64-unknown-linux-gnu.tar.gz          rustc-1.49.0-dev-x86_64-unknown-linux-gnu.tar.xz
clippy-1.49.0-dev-x86_64-unknown-linux-gnu.tar.xz          rustc-dev-1.49.0-dev-x86_64-unknown-linux-gnu.tar.gz
llvm-tools-1.49.0-dev-x86_64-unknown-linux-gnu.tar.gz      rustc-dev-1.49.0-dev-x86_64-unknown-linux-gnu.tar.xz
llvm-tools-1.49.0-dev-x86_64-unknown-linux-gnu.tar.xz      rust-dev-1.49.0-dev-x86_64-unknown-linux-gnu.tar.gz
miri-1.49.0-dev-x86_64-unknown-linux-gnu.tar.gz            rust-dev-1.49.0-dev-x86_64-unknown-linux-gnu.tar.xz
miri-1.49.0-dev-x86_64-unknown-linux-gnu.tar.xz            rust-src-1.49.0-dev.tar.gz
rust-1.49.0-dev-x86_64-unknown-linux-gnu.tar.gz            rust-src-1.49.0-dev.tar.xz
rust-1.49.0-dev-x86_64-unknown-linux-gnu.tar.xz            rust-std-1.49.0-dev-mips64-unknown-linux-muslabi64.tar.gz
rust-analysis-1.49.0-dev-x86_64-unknown-linux-gnu.tar.gz   rust-std-1.49.0-dev-mips64-unknown-linux-muslabi64.tar.xz
rust-analysis-1.49.0-dev-x86_64-unknown-linux-gnu.tar.xz   rust-std-1.49.0-dev-x86_64-unknown-linux-gnu.tar.gz
rust-analyzer-1.49.0-dev-x86_64-unknown-linux-gnu.tar.gz   rust-std-1.49.0-dev-x86_64-unknown-linux-gnu.tar.xz

It generates both xz and gz, and while I've not tested them yet, I would guess they are the same.

You'll notice rust-std-1.49.0-dev-mips64-unknown-linux-muslabi64.tar.gz is the only "cross compiling" target that gets made.

Which of these components should I be installing? I know rustfmt and RLS both fail to compile, but shouldn't effect compilation on the far end. Any suggestions from someone whose actually used Rust? :slight_smile:

Ok @detly, I'm considering rustup completely dead.

I can, however, report great strides in getting from source to work. Including soft-floats, dynamic linking, etc. I'm hoping to have something complete in the next few days :slight_smile:

Success!

I've gotten it to build out, compile Suricata6 with soft-float and dynamically linked, and it runs on the device.

Now I'm just trying to figure out how to keep from rebuilding the toolchain every time, since it won't change after it's compiled until the package is updated.

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

Here is the draft PR. It still need much work but it works if I shove it along.. Now it's just an issue of getting the rest of it to work automagically

1 Like

I left this alone for a while because... well, general chaos... but I'll take a look at this over the next couple of weeks and let you know how I go.

1 Like

I'm not sure if I've pushed the latest, but it's working without apparent issue.

The biggest issue is defining the custom triples and build testing so they can be added to the list.

I'm also working on settling default compiler settings, and ways of being able to reduce the host footprint (currently the compiled binary installation files are roughly 400mb, I'm sure it can be trimmed significantly, but it means testing and then rebuilding everything over and over)

I'll check to see the PR is up to date. Appreciate the feedback

Any feedback/issues/suggestions @detly?

Bump to the top for exposure. Thx!

Hi,

I stumbled on this thread while looking to see if Rust is already a good candidate for OpenWRT package development. Currently we develop everything in C but the added value of Rust's thread safety and compile time memory access validation would be huge. Especially because valgrind or any other runtime memory debuggers aren't created for the MIPS targets we use.

@Grommish thank you very much for your dedication and hard work. I have downloaded your latest version of the lang/rust package (from 6 days ago) in my OpenWRT 19.07 toolchain. As I'm willing to compile a simple Hello World rust program for my MIPS target. The build was failing the first time but I found out this was because I didn't have ccache installed on my host. Now the build succeeds :slight_smile:

I'm however not succeeding in getting a minimal Hello World example working. I've now created a simple package and a Makefile like this:

daanpape/rust-hello-world: Attempt to make a simple Rust Hello World example in OpenWRT (github.com)

And I'm getting a linker error:

error: linking with `cc` failed: exit code: 1
  |
  = note: /usr/bin/ld: main.main.7rcbfp3g-cgu.0.rcgu.o: relocations in generic ELF (EM: 8)
          /usr/bin/ld: main.main.7rcbfp3g-cgu.0.rcgu.o: relocations in generic ELF (EM: 8)
          /usr/bin/ld: main.main.7rcbfp3g-cgu.0.rcgu.o: error adding symbols: file in wrong format
          collect2: error: ld returned 1 exit status

Could you give me any pointers?

Update: I got it working by looking at the suricata example. I updated the github. I'm going to try and add some floating point operations, also the binary is quite large. I think this might be optimized in the future.

The build system is using your existing Host's Rust Toolchain, which probably isn't equipped to Cross-compile.

Add this to your test package and see what it does. You may or may not need the RUSTFLAGS, but I left them in for documentation sake. In my Suricata package, I only need it as you see it.

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

Errors on the Package/install but that's alright. Notice it built it.

grommish@DESKTOP-N35LRJ4:~/openwrt$ make -j1 V=sc package/feeds/packages/rust-hello-world/compile
make[2]: Entering directory '/home/grommish/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/grommish/openwrt/scripts/config'
time: target/linux/prereq#0.12#0.01#0.12
make[1]: Entering directory '/home/grommish/openwrt'
make[2]: Entering directory '/home/grommish/openwrt/package/libs/toolchain'
echo "libc" >> /home/grommish/openwrt/staging_dir/target-mips64_octeonplus_64_musl/pkginfo/toolchain.default.install
echo "libgcc" >> /home/grommish/openwrt/staging_dir/target-mips64_octeonplus_64_musl/pkginfo/toolchain.default.install
echo "libatomic" >> /home/grommish/openwrt/staging_dir/target-mips64_octeonplus_64_musl/pkginfo/toolchain.default.install
echo "libpthread" >> /home/grommish/openwrt/staging_dir/target-mips64_octeonplus_64_musl/pkginfo/toolchain.default.install
echo "librt" >> /home/grommish/openwrt/staging_dir/target-mips64_octeonplus_64_musl/pkginfo/toolchain.default.install
make[2]: Leaving directory '/home/grommish/openwrt/package/libs/toolchain'
time: package/libs/toolchain/compile#0.18#0.01#0.16
make[2]: Entering directory '/home/grommish/openwrt/feeds/packages/utils/rust-hello-world'
rm -f /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/.configured_*
rm -f /home/grommish/openwrt/staging_dir/target-mips64_octeonplus_64_musl/stamp/.rust-hello-world_installed
(cd /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/./; if [ -x ./configure ]; then find /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/ -name config.guess | xargs -r chmod u+w; find /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/ -name config.guess | xargs -r -n1 cp --remove-destination /home/grommish/openwrt/scripts/config.guess; find /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/ -name config.sub | xargs -r chmod u+w; find /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/ -name config.sub | xargs -r -n1 cp --remove-destination /home/grommish/openwrt/scripts/config.sub; AR="mips64-openwrt-linux-musl-gcc-ar" AS="mips64-openwrt-linux-musl-gcc -c -Os -pipe -mno-branch-likely -march=octeon+ -mtune=octeon3 -mabi=64 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -fmacro-prefix-map=/home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1=rust-hello-world-0.0.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" LD=mips64-openwrt-linux-musl-ld NM="mips64-openwrt-linux-musl-gcc-nm" CC="mips64-openwrt-linux-musl-gcc" GCC="mips64-openwrt-linux-musl-gcc" CXX="mips64-openwrt-linux-musl-g++" RANLIB="mips64-openwrt-linux-musl-gcc-ranlib" STRIP=mips64-openwrt-linux-musl-strip OBJCOPY=mips64-openwrt-linux-musl-objcopy OBJDUMP=mips64-openwrt-linux-musl-objdump SIZE=mips64-openwrt-linux-musl-size CFLAGS="-Os -pipe -mno-branch-likely -march=octeon+ -mtune=octeon3 -mabi=64 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -fmacro-prefix-map=/home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1=rust-hello-world-0.0.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro " CXXFLAGS="-Os -pipe -mno-branch-likely -march=octeon+ -mtune=octeon3 -mabi=64 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -fmacro-prefix-map=/home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1=rust-hello-world-0.0.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro " CPPFLAGS="-I/home/grommish/openwrt/staging_dir/toolchain-mips64_octeonplus_64_gcc-10.2.0_musl/usr/include -I/home/grommish/openwrt/staging_dir/toolchain-mips64_octeonplus_64_gcc-10.2.0_musl/include/fortify -I/home/grommish/openwrt/staging_dir/toolchain-mips64_octeonplus_64_gcc-10.2.0_musl/include " LDFLAGS="-L/home/grommish/openwrt/staging_dir/toolchain-mips64_octeonplus_64_gcc-10.2.0_musl/usr/lib -L/home/grommish/openwrt/staging_dir/toolchain-mips64_octeonplus_64_gcc-10.2.0_musl/lib -znow -zrelro "  CARGO_HOME=/home/grommish/openwrt/staging_dir/hostpkg ac_cv_path_CARGO="/home/grommish/openwrt/staging_dir/hostpkg/bin/cargo" ac_cv_path_RUSTC="/home/grommish/openwrt/staging_dir/hostpkg/bin/rustc"  ./configure --target=mips64-openwrt-linux --host=mips64-openwrt-linux --build=x86_64-pc-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls  ; fi; )
touch /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/.configured_68b329da9893e34099c7d8ad5cb9c940
rm -f /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/.built
touch /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/.built_check
cd /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1 && cargo rustc --target=mips64-openwrt-linux-musl --release -- -C linker=mips64-openwrt-linux-musl-gcc -C ar=mips64-openwrt-linux-musl-gcc-ar
   Compiling rust-hello-world v0.0.1 (/home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1)
    Finished release [optimized] target(s) in 0.95s
touch /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/.built
rm -rf /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/.pkgdir/rust-hello-world.installed /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/.pkgdir/rust-hello-world
mkdir -p /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/.pkgdir/rust-hello-world
install -d -m0755 /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/.pkgdir/rust-hello-world/usr/sbin
install -m0755 /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/target/mips-openwrt-linux-musl/release/main /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/.pkgdir/rust-hello-world/usr/sbin/rust-hello-world
install: cannot stat '/home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/target/mips-openwrt-linux-musl/release/main': No such file or directory
make[2]: *** [Makefile:53: /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/rust-hello-world-0.0.1/.pkgdir/rust-hello-world.installed] Error 1
make[2]: Leaving directory '/home/grommish/openwrt/feeds/packages/utils/rust-hello-world'
time: package/feeds/packages/rust-hello-world/compile#1.33#0.11#1.12
    ERROR: package/feeds/packages/rust-hello-world failed to build.
make[1]: *** [package/Makefile:114: package/feeds/packages/rust-hello-world/compile] Error 1
make[1]: Leaving directory '/home/grommish/openwrt'
make: *** [/home/grommish/openwrt/include/toplevel.mk:230: package/feeds/packages/rust-hello-world/compile] Error 2