Open TimDowker opened 2 years ago
check the file type of the 'netclient' file you downloaded.. I suspect it is not a binary but a text file.
It appears to be a binary file - see screenshot attached when I tried to open it in vscode.
run file /sbin/netclient
Returns "-ash: file: not found"
I downloaded the same file to my desktop and ran the file command on it and it returned the following
netclient-mips: ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), statically linked, Go BuildID=kwVB84ITCZWtKwztk3La/zhxYcqkXBRXJ0VCJvhlG/SYjWYzO6gz7djz75OadI/9gTxvV_AZPnu0Olpuf4y, stripped
looks like a bad build .... the mips binary was a recent community contributionn.
Ok - I've trid cloning the v0.16.3 repo and compiling the binary myself but it isn't working and fixing the issue is beyond my expertise. I'll have to wait until the binary gets fixed.
figured it out - cloned v0.16.3 repo - then the following line in the bin-maker.sh script needed to be modified. It was compiling mipsle versions only for mips arch. GOARM=$_goarm GOMIPS=softfloat GOARCH=mipsle GOOS=$_goose GOHOSTARCH=$__HOST_ARCH CGO_ENABLED=0 go build -ldflags="-X 'main.version=$VERSION'" -o $_out
Changed GOARCH=mipsle to GOARCH=mips and re-ran the script - new binary version seems to run but it has now crashed my openwrt router so...
@TimDowker , could you share uname
& cat /etc/os-release
output.
Also, I would recommend checking https://github.com/gravitl/netmaker/blob/develop/netclient/bin-maker.sh#L23-L28
Recent PR merged for mips support is https://github.com/gravitl/netmaker/pull/1681
uname = Linux uname -a = Linux Router 5.10.146 #0 Fri Oct 14 22:44:41 2022 mips GNU/Linux cat /etc/os-release = NAME="OpenWrt" VERSION="22.03.2" ID="openwrt" ID_LIKE="lede openwrt" PRETTY_NAME="OpenWrt 22.03.2" VERSION_ID="22.03.2" HOME_URL="https://openwrt.org/" BUG_URL="https://bugs.openwrt.org/" SUPPORT_URL="https://forum.openwrt.org/" BUILD_ID="r19803-9a599fee93" OPENWRT_BOARD="ath79/generic" OPENWRT_ARCH="mips_24kc" OPENWRT_TAINTS="" OPENWRT_DEVICE_MANUFACTURER="OpenWrt" OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/" OPENWRT_DEVICE_PRODUCT="Generic" OPENWRT_DEVICE_REVISION="v0" OPENWRT_RELEASE="OpenWrt 22.03.2 r19803-9a599fee93"
@TimDowker, could you please share the device model too for reference?
Try to use https://github.com/gravitl/netmaker/blob/develop/scripts/netclient-install.sh, to install Netclient on your device. Still, if you face trouble try to replace Netclient binary manually from https://github.com/gravitl/netmaker/releases/download/v0.16.3/netclient-mips or https://github.com/gravitl/netmaker/releases/download/v0.16.3/netclient-mips-upx
I believe the above steps will help resolve your issue.
The device is a TP-Link Archer C7 v5 running OpenWrt 22.03.2 r19803-9a599fee93 / LuCI openwrt-22.03 branch git-22.304.65171-ec905e6 with kernel version 5.10.146
I've tried the netclient-install.sh script - no go - like I said - had to modify it to work properly (see above).
The binary's also do not work - see above.
@TimDowker , device I have tested has "Little Endian" architecture
>> lscpu
Architecture: mips
Byte Order: Little Endian
could you post the output for lscpu
root@Router:~# lscpu
Architecture: mips
Byte Order: Big Endian
CPU(s): 1
On-line CPU(s) list: 0
Model: MIPS 74Kc V5.0
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 1
BogoMIPS: 385.84
Flags: mips16 dsp dsp2
Caches (sum of all):
L1d: 32 KiB (1 instance)
L1i: 64 KiB (1 instance)
Device model is a TP-Link Archer C7 v5 ruuning OpenWrt 22.03.2 r19803-9a599fee93 / LuCI openwrt-22.03 branch git-22.304.65171-ec905e6
Both the netclient-mips and netclient-mips-upx are both still giving the same error ./netclient-mips: line 1: syntax error: unexpected "("
@TimDowker ,
yes, as you mentioned earlier for "Big Endian" netclient binary to be generated with GOARCH=mips and GOMIPS=softfloat
I have installed OpenWrt in one of my old D-Link Router, it seems to be "Big Endian" and helped me to make the pull request https://github.com/gravitl/netmaker/pull/1756 .
Let's see if someone comes with a different device & test other binaries.
line 1: syntax error: unexpected "("
says, that you using the bad compiled target version. If you get these error message, use the little endian version of mips. Most IoT Mips-CPU's using these.
Contact Details
No response
What happened?
2 bugs really.
1 - The install script for mips on Openwrt calls a URL for "latest" (line 76 of the netclient-install.sh script) ie "url="https://github.com/gravitl/netmaker/releases/download/$VERSION/$dist" but "latest" doesn't exist - had to hard code "v0.16.3" into the URL to get it to work.
2 - The netclient executable produces the error "/sbin/netclient: line 1: syntax error: unexpected "("" continuously in the log file /tmp/netclient.logs. Tried restarting the proc - no go. Tried joining a network with "netclient join -t" - no go.
Version
Not listed
What OS are you using?
Unlisted
Relevant log output
Contributing guidelines