Adding support for OpenWrt-mips arch

This commit is contained in:
shanker JJ
2022-10-23 16:36:16 +09:00
parent 7e5e621cec
commit df04e4c28a
2 changed files with 8 additions and 4 deletions

View File

@@ -20,7 +20,7 @@ function build
build $_goarch $_goose 5 && build $_goarch $_goose 6 && build $_goarch $_goose 7 build $_goarch $_goose 5 && build $_goarch $_goose 6 && build $_goarch $_goose 7
else else
echo $_out 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 fi
} }

View File

@@ -148,8 +148,11 @@ case $(uname | tr A-Z a-z) in
arm*) arm*)
dist=netclient-$CPU_ARCH dist=netclient-$CPU_ARCH
;; ;;
mipsle) mipsle)
dist=netclient-mipsle dist=netclient-mipsle
;;
mips*)
dist=netclient-$CPU_ARCH
;; ;;
*) *)
fatal "$CPU_ARCH : cpu architecture not supported" fatal "$CPU_ARCH : cpu architecture not supported"
@@ -240,6 +243,8 @@ if [ "${OS}" = "OpenWRT" ] || [ "${OS}" = "TurrisOS" ]; then
else else
wget $curl_opts -O netclient.service.tmp https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/openwrt-daemon.sh wget $curl_opts -O netclient.service.tmp https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/openwrt-daemon.sh
fi 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 else
cat << 'END_OF_FILE' > ./netclient.service.tmp cat << 'END_OF_FILE' > ./netclient.service.tmp
#!/bin/sh /etc/rc.common #!/bin/sh /etc/rc.common
@@ -293,4 +298,3 @@ END_OF_FILE
else else
rm -f netclient rm -f netclient
fi fi