Skip to content

Commit

Permalink
Adding support for OpenWrt-mips arch
Browse files Browse the repository at this point in the history
  • Loading branch information
shanker JJ committed Oct 23, 2022
1 parent 7e5e621 commit df04e4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion netclient/bin-maker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function build
build $_goarch $_goose 5 && build $_goarch $_goose 6 && build $_goarch $_goose 7
else
echo $_out
GOARM=$_goarm GOARCH=$_goarch GOOS=$_goose GOHOSTARCH=$__HOST_ARCH CGO_ENABLED=0 go build -ldflags="-X 'main.version=$VERSION'" -o $_out
if [ "$_goarch" == "mips" ]; then GOMIPS=softfloat; fi; GOARM=$_goarm GOARCH=$_goarch GOOS=$_goose GOHOSTARCH=$__HOST_ARCH CGO_ENABLED=0 go build -ldflags="-X 'main.version=$VERSION'" -o $_out
fi
}

Expand Down
10 changes: 7 additions & 3 deletions scripts/netclient-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,11 @@ case $(uname | tr A-Z a-z) in
arm*)
dist=netclient-$CPU_ARCH
;;
mipsle)
mipsle)
dist=netclient-mipsle
;;
mips*)
dist=netclient-$CPU_ARCH
;;
*)
fatal "$CPU_ARCH : cpu architecture not supported"
Expand Down Expand Up @@ -240,6 +243,8 @@ if [ "${OS}" = "OpenWRT" ] || [ "${OS}" = "TurrisOS" ]; then
else
wget $curl_opts -O netclient.service.tmp https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/openwrt-daemon.sh
fi
elif [ "${OS}" = "OpenWRT" ] && [ "$CPU_ARCH" = "mips" ]; then
wget $curl_opts -O netclient.service.tmp https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/openwrt-daemon.sh
else
cat << 'END_OF_FILE' > ./netclient.service.tmp
#!/bin/sh /etc/rc.common
Expand Down Expand Up @@ -292,5 +297,4 @@ END_OF_FILE
/etc/init.d/netclient start
else
rm -f netclient
fi

fi

0 comments on commit df04e4c

Please sign in to comment.