Skip to content

Commit

Permalink
Add support for different architectures along with mips+endianness
Browse files Browse the repository at this point in the history
  • Loading branch information
adyanth committed May 29, 2021
1 parent e6612c0 commit 0897f11
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Get data
id: data
run: |
echo "##[set-output name=version;]v$(grep version= usr/bin/tailscaled | grep -oE '[[:digit:]]+.[[:digit:]]+.[[:digit:]]+')-$(git rev-parse --short HEAD)"
echo "##[set-output name=version;]v$(grep tailscale_version= usr/bin/tailscaled | grep -oE '[[:digit:]]+.[[:digit:]]+.[[:digit:]]+')-$(git rev-parse --short HEAD)"
echo "##[set-output name=commit;]$(git rev-parse HEAD)"
- name: Generate tar archive
run: ./generate-tar.sh ${{ steps.data.outputs.version }}
Expand Down
9 changes: 7 additions & 2 deletions usr/bin/tailscale
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/sh

endianness=`echo -n I | hexdump -o | awk '{ print (substr($2,6,1)=="1")?"le":""; exit}'`
version="1.8.5_mips"${endianness}
arch=`uname -m`
if [ "$arch" == "mips" ]; then
endianness=`echo -n I | hexdump -o | awk '{ print (substr($2,6,1)=="1") ? "le" : ""; exit }'`
fi

tailscale_version="1.8.5"
version="${tailscale_version}_${arch}${endianness}"

if [ ! -f /tmp/tailscale ]; then
echo "Downloading Tailscale ${version} .."
Expand Down
9 changes: 7 additions & 2 deletions usr/bin/tailscaled
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/sh

endianness=`echo -n I | hexdump -o | awk '{ print (substr($2,6,1)=="1")?"le":""; exit}'`
version="1.8.5_mips"${endianness}
arch=`uname -m`
if [ "$arch" == "mips" ]; then
endianness=`echo -n I | hexdump -o | awk '{ print (substr($2,6,1)=="1") ? "le" : ""; exit }'`
fi

tailscale_version="1.8.5"
version="${tailscale_version}_${arch}${endianness}"

if [ ! -f /tmp/tailscaled ]; then
echo "Downloading Tailscale ${version} .."
Expand Down

0 comments on commit 0897f11

Please sign in to comment.