Skip to content

Instantly share code, notes, and snippets.

@juniorz
Last active March 16, 2016 18:23
Show Gist options
  • Save juniorz/119fb73646771f944fa3 to your computer and use it in GitHub Desktop.
Save juniorz/119fb73646771f944fa3 to your computer and use it in GitHub Desktop.
How to build tor for Intel© Edison

Building tor with Intel© Edison SDK

curl -fsSL https://gist.githubusercontent.com/juniorz/119fb73646771f944fa3/raw/build-tor | /bin/bash

Environment variables:

  • PREFIX - installation prefix. Defaults to /opt/edison
  • EDISON_SDK - path to Edison SDK. Defaults to /opt/poky-edison/1.6

### Using docker

docker run --rm -v juniorz/edison-ndk \
    /bin/bash -c "curl -fsSL https://gist.githubusercontent.com/juniorz/119fb73646771f944fa3/raw/build-tor | /bin/bash"

If you want to put the compiled binaries in your Edison, you may want to mount the /opt/edison volume to a path on your docker host, like:

docker run --rm -v `pwd`/edison-root:/opt/edison juniorz/edison-ndk \
    /bin/bash -c "curl -fsSL https://gist.githubusercontent.com/juniorz/119fb73646771f944fa3/raw/build-tor | /bin/bash"

(Yes, it works with docker-machine on Mac OS X as long as you run it from somewhere in your home directory)

#!/bin/bash
set -xe
EDISON_SDK=${EDISON_SDK:-"/opt/poky-edison/1.6"}
# TODO: verify fingerprint
mkdir /src
curl -qL https://www.torproject.org/dist/tor-0.2.6.10.tar.gz | tar xzvf - -C /src
cd /src/tor-0.2.6.10
patch ./configure <<'EOF'
--- tor-configure-original 2015-10-21 15:30:46.255321314 +0000
+++ tor-configure-modified 2015-10-21 15:33:02.419541175 +0000
@@ -7501,6 +7501,7 @@
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
+ runnable=yes
if test "$runnable" = yes; then
tor_cv_library_libevent_linker_option=$tor_tryextra
break
@@ -8046,6 +8047,7 @@
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
+ runnable=yes
if test "$runnable" = yes; then
tor_cv_library_openssl_linker_option=$tor_tryextra
break
@@ -8377,6 +8379,7 @@
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
+ runnable=yes
if test "$runnable" = yes; then
tor_cv_library_zlib_linker_option=$tor_tryextra
break
EOF
source $EDISON_SDK/environment-setup-core2-32-poky-linux
./configure --prefix=$PREFIX
make && make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment