Cross Compiling Transmission 2.82 on My Cloud

Original guide by sled0815 (http://community.wd.com/t5/forums/forumtopicprintpage/board-id/mycloud/message-id/2313/print-single-message/true/page/1)

This is a guide to compile transmission 2.82 for the WD My Cloud 2/3/4 TB.

PLAIN TEXT VERSION: https://gist.github.com/sled/7745097

Because I didn't want to install the build tools and dependencies on my NAS I chose to setup a cross-compiler toolchain on my x86_64 Ubuntu 12.04 machine and create a .deb package that can be installed on the NAS. Furthermore the cross compiler can be used to compile anything for the My Cloud (printer drivers, ….)

However you need to turn on SSH on your NAS and accept the possibility that you might void your warranty by installing transmission on your NAS. I don't take any responsibility for anything you do with this guide, your NAS and/or transmission.

Host System: Ubuntu 12.04 LTS
Target System: Western Digital My Cloud, Concerto 2000 (ARMv7l, Cortex-A9)

If you are too lazy (and trust me (haha)), you can get the binary from my dropbox: transmission_2.82-1_armhf.deb (MD5: b543074596e6e02ffca02152fe274bf8). So you can jump directly to my second post where I show you how to install the package and configure transmission on the My Cloud

Install Dependencies for crosstool-ng

NOTE: I already had the build-essential package and everything else installed therefore I didn't need to install any dependencies.

I took the depency list from http://smdaudhilbe.wordpress.com/2013/04/26/steps-to-create-cross-compiling-toolchain-using-crosstoo

However, there are many guides available about how to install crosstool-ng on ubuntu.

IMPORTANT: All steps that follow now are to be executed on your local machine and NOT on the My Cloud!

sudo apt-get install autoconf automake libtool libexpat1-dev ncurses-dev bison flex patch curl cvs texinfo build-essential subversion gawk python-dev gperf g++

Create a Working Directory

Note: Replace with sled with your username

mkdir /home/sled/ARM  
cd /home/sled/ARM

Install crosstool-ng

cd /home/sled/ARM
wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.19.0.tar.bz2

Extract:

tar xjvf crosstool-ng-1.19.0.tar.bz2

Remove downloaded file to keep everything tidy:

rm crosstool-ng-1.19.0.tar.bz2

Go into crosstool-ng folder:

cd crosstool-ng-1.19.0

Configure and Make:

./configure --prefix=/usr/local
make
sudo make install

Tidy up:

cd /home/sled/ARM
rm -R crosstool-ng-1.19.0

Creating a cross-compiler

cd /home/sled/ARM
mkdir toolchain
cd toolchain

Option A: Use my config file:


Setup a basic config file by running `ct-ng menuconfig` and exit directly with saving.

Now download my .config file and replace the hidden .config file (/home/sled/ARM/toolchain/.config)

https://gist.github.com/sled/7736747

Important: Adjust the paths beginning with /home/sled accordingly with a simple text editor.

Option B: Configure manually:


ct-ng menuconfig

Leave everything as is and configure as follows:

Paths and misc options --->
  [*] Try features marked as EXPERIMENTAL
  ( ) Local tarballs directory
        -> set to /home/sled/ARM/toolchain/src
  ( ) Working directory
        -> set to /home/sled/ARM/toolchain/.build
  ( ) Prefix directory
        -> set to /home/sled/ARM/toolchain/x-tools/${CT_TARGET} 

Target options --->
  ( ) Target Architecture 
        -> choose "arm"
  ( ) Endianness
        -> make sure it's little endian
  ( ) Bitness 
        -> make sure it's 32-bit
  ( ) Architecture Level
        -> set to armv7-a
  ( ) Tune for CPU
        -> set to cortex-a9
  ( ) Use specific FPU
        -> set to neon
  ( ) Floating point:
        -> choose hardware (FPU)
  ( ) Target CFLAGS:
        -> set to -mfpu=neon -mfloat-abi=hard
  ( ) Default instruction set mode
        -> set to thumb
  -*- Use EABI
  [*] append 'hf' to the tuple (EXPERIMENTAL) (NEW)
        -> choose it

Operating System --->
  Target OS 
    -> choose linux

C-Compiler --->
  C compiler (gcc) -->
    [*] Show Linaro versions
      gcc version (linaro-4.8-2013.06-1) -->
    [*] C++

C-library --->
  C library (eglibc) --->
    eglibc version (2_17)

Exit and Save config file (it's hidden and called .config)

Option C: Configure manually as option B and A did not worked (unable to generate the cross compiler):
tested with

version of cross toolng =1.19
linux mint 17.2

load a similar config (cat /proc/cpuinfo gives us cpu : APM82181)

ct-ng powerpc-405-linux-gnu

remove the unecessary compiler (fortran and java) and tool (gdb)
and select the latest MPFR version as the one selected will not compile

ct-ng menuconfig

or just take mine

#
# Automatically generated make config: don't edit
# crosstool-NG 1.19.0 Configuration
# Sat Nov  7 20:33:33 2015
#
CT_CONFIGURE_has_xz=y
CT_CONFIGURE_has_cvs=y
CT_CONFIGURE_has_svn=y
CT_MODULES=y

#
# Paths and misc options
#

#
# crosstool-NG behavior
#
# CT_OBSOLETE is not set
# CT_EXPERIMENTAL is not set
# CT_DEBUG_CT is not set

#
# Paths
#
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/.build"
CT_PREFIX_DIR="${HOME}/x-tools/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
CT_INSTALL_DIR_RO=y
CT_STRIP_ALL_TOOLCHAIN_EXECUTABLES=y

#
# Downloading
#
# CT_FORBID_DOWNLOAD is not set
# CT_FORCE_DOWNLOAD is not set
CT_CONNECT_TIMEOUT=10
# CT_ONLY_DOWNLOAD is not set
# CT_USE_MIRROR is not set

#
# Extracting
#
# CT_FORCE_EXTRACT is not set
CT_OVERIDE_CONFIG_GUESS_SUB=y
# CT_ONLY_EXTRACT is not set
CT_PATCH_BUNDLED=y
# CT_PATCH_LOCAL is not set
# CT_PATCH_BUNDLED_LOCAL is not set
# CT_PATCH_LOCAL_BUNDLED is not set
# CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set
# CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set
# CT_PATCH_NONE is not set
CT_PATCH_ORDER="bundled"

#
# Build behavior
#
CT_PARALLEL_JOBS=0
CT_LOAD=""
CT_USE_PIPES=y
CT_EXTRA_CFLAGS_FOR_BUILD=""
CT_EXTRA_LDFLAGS_FOR_BUILD=""
CT_EXTRA_CFLAGS_FOR_HOST=""
CT_EXTRA_LDFLAGS_FOR_HOST=""
# CT_CONFIG_SHELL_SH is not set
# CT_CONFIG_SHELL_ASH is not set
CT_CONFIG_SHELL_BASH=y
# CT_CONFIG_SHELL_CUSTOM is not set
CT_CONFIG_SHELL="${bash}"

#
# Logging
#
# CT_LOG_ERROR is not set
# CT_LOG_WARN is not set
# CT_LOG_INFO is not set
CT_LOG_EXTRA=y
# CT_LOG_ALL is not set
# CT_LOG_DEBUG is not set
CT_LOG_LEVEL_MAX="EXTRA"
# CT_LOG_SEE_TOOLS_WARN is not set
CT_LOG_PROGRESS_BAR=y
CT_LOG_TO_FILE=y
CT_LOG_FILE_COMPRESS=y

#
# Target options
#
CT_ARCH="powerpc"
CT_ARCH_SUPPORTS_32=y
CT_ARCH_SUPPORTS_WITH_ABI=y
CT_ARCH_SUPPORTS_WITH_CPU=y
CT_ARCH_SUPPORTS_WITH_TUNE=y
CT_ARCH_SUPPORTS_WITH_FLOAT=y
CT_ARCH_DEFAULT_32=y
CT_ARCH_ABI=""
CT_ARCH_CPU="405"
CT_ARCH_TUNE="405"
CT_ARCH_32=y
CT_ARCH_BITNESS=32
# CT_ARCH_FLOAT_HW is not set
#CT_ARCH_FLOAT_SW=y
#modif cd
CT_ARCH_FLOAT_HW=y
CT_TARGET_CFLAGS="-mfpu=neon -mfloat-abi=hard"
#end modif cd
CT_TARGET_CFLAGS=""
CT_TARGET_LDFLAGS=""
# CT_ARCH_alpha is not set
# CT_ARCH_arm is not set
# CT_ARCH_avr32 is not set
# CT_ARCH_blackfin is not set
# CT_ARCH_m68k is not set
# CT_ARCH_mips is not set
CT_ARCH_powerpc=y
# CT_ARCH_s390 is not set
# CT_ARCH_sh is not set
# CT_ARCH_sparc is not set
# CT_ARCH_x86 is not set
CT_ARCH_alpha_AVAILABLE=y
CT_ARCH_arm_AVAILABLE=y
CT_ARCH_avr32_AVAILABLE=y
CT_ARCH_blackfin_AVAILABLE=y
CT_ARCH_m68k_AVAILABLE=y
CT_ARCH_microblaze_AVAILABLE=y
CT_ARCH_mips_AVAILABLE=y
CT_ARCH_powerpc_AVAILABLE=y
CT_ARCH_s390_AVAILABLE=y
CT_ARCH_sh_AVAILABLE=y
CT_ARCH_sparc_AVAILABLE=y
CT_ARCH_x86_AVAILABLE=y
CT_ARCH_SUFFIX=""

#
# Generic target options
#
# CT_MULTILIB is not set
CT_ARCH_USE_MMU=y

#
# Target optimisations
#
#CT_ARCH_FLOAT="soft"
CT_ARCH_FLOAT="hard"
#fin modif cd
#
# powerpc other options
#
CT_ARCH_powerpc_ABI=""
CT_ARCH_powerpc_ABI_DEFAULT=y
# CT_ARCH_powerpc_ABI_SPE is not set

#
# Toolchain options
#

#
# General toolchain options
#
CT_FORCE_SYSROOT=y
CT_USE_SYSROOT=y
CT_SYSROOT_NAME="sysroot"
CT_SYSROOT_DIR_PREFIX=""
# CT_STATIC_TOOLCHAIN is not set
CT_TOOLCHAIN_PKGVERSION=""
CT_TOOLCHAIN_BUGURL=""

#
# Tuple completion and aliasing
#
CT_TARGET_VENDOR="405"
CT_TARGET_ALIAS_SED_EXPR=""
CT_TARGET_ALIAS=""

#
# Toolchain type
#
CT_CROSS=y
# CT_CANADIAN is not set
CT_TOOLCHAIN_TYPE="cross"

#
# Build system
#
CT_BUILD=""
CT_BUILD_PREFIX=""
CT_BUILD_SUFFIX=""

#
# Misc options
#
# CT_TOOLCHAIN_ENABLE_NLS is not set

#
# Operating System
#
CT_KERNEL_SUPPORTS_SHARED_LIBS=y
CT_KERNEL="linux"
CT_KERNEL_VERSION="2.6.31.14"
# CT_KERNEL_bare_metal is not set
CT_KERNEL_linux=y
CT_KERNEL_bare_metal_AVAILABLE=y
CT_KERNEL_linux_AVAILABLE=y
# CT_KERNEL_V_3_10 is not set
# CT_KERNEL_V_3_9 is not set
# CT_KERNEL_V_3_8 is not set
# CT_KERNEL_V_3_7 is not set
# CT_KERNEL_V_3_6 is not set
# CT_KERNEL_V_3_5 is not set
# CT_KERNEL_V_3_4 is not set
# CT_KERNEL_V_3_3 is not set
# CT_KERNEL_V_3_2 is not set
# CT_KERNEL_V_3_1 is not set
# CT_KERNEL_V_3_0 is not set
# CT_KERNEL_V_2_6_39 is not set
# CT_KERNEL_V_2_6_38 is not set
# CT_KERNEL_V_2_6_37 is not set
# CT_KERNEL_V_2_6_36 is not set
# CT_KERNEL_V_2_6_33 is not set
# CT_KERNEL_V_2_6_32 is not set
CT_KERNEL_V_2_6_31=y
# CT_KERNEL_V_2_6_27 is not set
# CT_KERNEL_LINUX_CUSTOM is not set
CT_KERNEL_windows_AVAILABLE=y

#
# Common kernel options
#
CT_SHARED_LIBS=y

#
# linux other options
#
CT_KERNEL_LINUX_VERBOSITY_0=y
# CT_KERNEL_LINUX_VERBOSITY_1 is not set
# CT_KERNEL_LINUX_VERBOSITY_2 is not set
CT_KERNEL_LINUX_VERBOSE_LEVEL=0
CT_KERNEL_LINUX_INSTALL_CHECK=y

#
# Binary utilities
#
CT_ARCH_BINFMT_ELF=y
CT_BINUTILS="binutils"
CT_BINUTILS_binutils=y

#
# GNU binutils
#
# CT_BINUTILS_V_2_22 is not set
# CT_BINUTILS_V_2_21_53 is not set
# CT_BINUTILS_V_2_21_1a is not set
# CT_BINUTILS_V_2_20_1a is not set
CT_BINUTILS_V_2_19_1a=y
# CT_BINUTILS_V_2_18a is not set
CT_BINUTILS_VERSION="2.19.1a"
CT_BINUTILS_2_19_or_later=y
CT_BINUTILS_2_18_or_later=y
CT_BINUTILS_HAS_HASH_STYLE=y
CT_BINUTILS_HAS_PKGVERSION_BUGURL=y
CT_BINUTILS_FORCE_LD_BFD=y
CT_BINUTILS_LINKER_LD=y
CT_BINUTILS_LINKERS_LIST="ld"
CT_BINUTILS_LINKER_DEFAULT="bfd"
CT_BINUTILS_EXTRA_CONFIG_ARRAY=""
CT_BINUTILS_FOR_TARGET=y
CT_BINUTILS_FOR_TARGET_IBERTY=y
CT_BINUTILS_FOR_TARGET_BFD=y

#
# binutils other options
#

#
# C compiler
#
CT_CC="gcc"
CT_CC_VERSION="4.3.2"
CT_CC_CORE_PASSES_NEEDED=y
CT_CC_gcc=y
# CT_CC_GCC_SHOW_LINARO is not set
# CT_CC_V_4_8_1 is not set
# CT_CC_V_4_8_0 is not set
# CT_CC_V_4_7_3 is not set
# CT_CC_V_4_7_2 is not set
# CT_CC_V_4_7_1 is not set
# CT_CC_V_4_7_0 is not set
# CT_CC_V_4_6_4 is not set
# CT_CC_V_4_6_3 is not set
# CT_CC_V_4_6_2 is not set
# CT_CC_V_4_6_1 is not set
# CT_CC_V_4_6_0 is not set
# CT_CC_V_4_5_3 is not set
# CT_CC_V_4_5_2 is not set
# CT_CC_V_4_5_1 is not set
# CT_CC_V_4_5_0 is not set
# CT_CC_V_4_4_7 is not set
# CT_CC_V_4_4_6 is not set
# CT_CC_V_4_4_5 is not set
# CT_CC_V_4_4_4 is not set
# CT_CC_V_4_4_3 is not set
# CT_CC_V_4_4_2 is not set
# CT_CC_V_4_4_1 is not set
# CT_CC_V_4_4_0 is not set
# CT_CC_V_4_3_6 is not set
# CT_CC_V_4_3_5 is not set
# CT_CC_V_4_3_4 is not set
# CT_CC_V_4_3_3 is not set
CT_CC_V_4_3_2=y
# CT_CC_V_4_3_1 is not set
# CT_CC_V_4_2_4 is not set
# CT_CC_V_4_2_2 is not set
CT_CC_GCC_4_2_or_later=y
CT_CC_GCC_4_3=y
CT_CC_GCC_4_3_or_later=y
# CT_CC_GCC_USE_GRAPHITE is not set
# CT_CC_GCC_USE_LTO is not set
CT_CC_GCC_HAS_PKGVERSION_BUGURL=y
CT_CC_GCC_USE_GMP_MPFR=y
# CT_CC_LANG_FORTRAN is not set
CT_CC_SUPPORT_CXX=y
CT_CC_SUPPORT_FORTRAN=y
CT_CC_SUPPORT_JAVA=y
CT_CC_SUPPORT_ADA=y
CT_CC_SUPPORT_OBJC=y
CT_CC_SUPPORT_OBJCXX=y

#
# Additional supported languages:
#
CT_CC_LANG_CXX=y
# CT_CC_LANG_JAVA is not set

#
# gcc other options
#
CT_CC_ENABLE_CXX_FLAGS=""
CT_CC_CORE_EXTRA_CONFIG_ARRAY=""
CT_CC_EXTRA_CONFIG_ARRAY=""
# CT_CC_GCC_SYSTEM_ZLIB is not set

#
# Optimisation features
#

#
# Settings for libraries running on target
#
CT_CC_GCC_ENABLE_TARGET_OPTSPACE=y
# CT_CC_GCC_LIBMUDFLAP is not set
# CT_CC_GCC_LIBGOMP is not set
# CT_CC_GCC_LIBSSP is not set

#
# Misc. obscure options.
#
CT_CC_CXA_ATEXIT=y
# CT_CC_GCC_DISABLE_PCH is not set
CT_CC_GCC_SJLJ_EXCEPTIONS=m
CT_CC_GCC_LDBL_128=m

#
# C-library
#
CT_LIBC="glibc"
CT_LIBC_VERSION="2.9"
# CT_LIBC_eglibc is not set
CT_LIBC_glibc=y
# CT_LIBC_uClibc is not set
CT_LIBC_eglibc_AVAILABLE=y
CT_LIBC_glibc_AVAILABLE=y
# CT_LIBC_GLIBC_V_2_17 is not set
# CT_LIBC_GLIBC_V_2_16_0 is not set
# CT_LIBC_GLIBC_V_2_15 is not set
# CT_LIBC_GLIBC_V_2_14_1 is not set
# CT_LIBC_GLIBC_V_2_14 is not set
# CT_LIBC_GLIBC_V_2_13 is not set
# CT_LIBC_GLIBC_V_2_12_2 is not set
# CT_LIBC_GLIBC_V_2_12_1 is not set
# CT_LIBC_GLIBC_V_2_11_1 is not set
# CT_LIBC_GLIBC_V_2_11 is not set
# CT_LIBC_GLIBC_V_2_10_1 is not set
CT_LIBC_GLIBC_V_2_9=y
# CT_LIBC_GLIBC_V_2_8 is not set
CT_LIBC_mingw_AVAILABLE=y
CT_LIBC_newlib_AVAILABLE=y
CT_LIBC_none_AVAILABLE=y
CT_LIBC_uClibc_AVAILABLE=y
CT_LIBC_SUPPORT_THREADS_ANY=y
CT_LIBC_SUPPORT_NPTL=y
CT_THREADS="nptl"

#
# Common C library options
#
CT_THREADS_NPTL=y
CT_LIBC_XLDD=y
CT_LIBC_glibc_familly=y
CT_LIBC_GLIBC_EXTRA_CONFIG_ARRAY=""
CT_LIBC_GLIBC_CONFIGPARMS=""
CT_LIBC_GLIBC_EXTRA_CFLAGS=""
CT_LIBC_EXTRA_CC_ARGS=""
# CT_LIBC_DISABLE_VERSIONING is not set
CT_LIBC_OLDEST_ABI=""
# CT_LIBC_GLIBC_FORCE_UNWIND is not set
CT_LIBC_GLIBC_USE_PORTS=y
CT_LIBC_ADDONS_LIST=""
# CT_LIBC_LOCALES is not set
# CT_LIBC_GLIBC_KERNEL_VERSION_NONE is not set
CT_LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS=y
# CT_LIBC_GLIBC_KERNEL_VERSION_CHOSEN is not set
CT_LIBC_GLIBC_MIN_KERNEL="2.6.31.14"

#
# glibc other options
#

#
# WARNING !!!                                            
#

#
#   For glibc >= 2.8, it can happen that the tarballs    
#

#
#   for the addons are not available for download.       
#

#
#   If that happens, bad luck... Try a previous version  
#

#
#   or try again later... :-(                            
#

#
# Debug facilities
#
CT_DEBUG_dmalloc=y
CT_DMALLOC_V_5_5_2=y
CT_DMALLOC_VERSION="5.5.2"
CT_DEBUG_duma=y
CT_DUMA_A=y
CT_DUMA_SO=y
CT_DUMA_V_2_5_15=y
CT_DUMA_VERSION="2_5_15"
# CT_DEBUG_gdb is not set
# CT_DEBUG_ltrace is not set
# CT_DEBUG_strace is not set

#
# Companion libraries
#
CT_COMPLIBS_NEEDED=y
CT_GMP_NEEDED=y
CT_MPFR_NEEDED=y
CT_COMPLIBS=y
CT_GMP=y
CT_MPFR=y
# CT_GMP_V_5_1_1 is not set
# CT_GMP_V_5_0_2 is not set
# CT_GMP_V_5_0_1 is not set
CT_GMP_V_4_3_2=y
# CT_GMP_V_4_3_1 is not set
# CT_GMP_V_4_3_0 is not set
CT_GMP_VERSION="4.3.2"
CT_MPFR_V_3_1_2=y
# CT_MPFR_V_3_1_0 is not set
# CT_MPFR_V_3_0_1 is not set
# CT_MPFR_V_3_0_0 is not set
# CT_MPFR_V_2_4_2 is not set
# CT_MPFR_V_2_4_1 is not set
# CT_MPFR_V_2_4_0 is not set
CT_MPFR_VERSION="3.1.2"

#
# Companion libraries common options
#
# CT_COMPLIBS_CHECK is not set
#

Build the cross compiler:

ct-ng build

Take a break and have a coffee, it will take about 45 minutes If anything fails, try to fix it and run `ct-ng clean` before you try to build it again

The output from the build process:

sled@sled-MacBookPro:~/ARM/toolchain$ ct-ng build
[INFO ]  Performing some trivial sanity checks
[INFO ]  Build started 20131201.171932
[INFO ]  Building environment variables
[INFO ]  =================================================================
[INFO ]  Retrieving needed toolchain components' tarballs
[INFO ]  Retrieving needed toolchain components' tarballs: done in 0.06s (at 00:01)
[INFO ]  =================================================================
[INFO ]  Extracting and patching toolchain components
[INFO ]  Extracting and patching toolchain components: done in 0.14s (at 00:02)
[INFO ]  =================================================================
[INFO ]  Installing GMP for host
[INFO ]  Installing GMP for host: done in 46.41s (at 00:48)
[INFO ]  =================================================================
[INFO ]  Installing MPFR for host
[INFO ]  Installing MPFR for host: done in 22.68s (at 01:11)
[INFO ]  =================================================================
[INFO ]  Installing ISL for host
[INFO ]  Installing ISL for host: done in 23.08s (at 01:34)
[INFO ]  =================================================================
[INFO ]  Installing CLooG for host
[INFO ]  Installing CLooG for host: done in 7.89s (at 01:42)
[INFO ]  =================================================================
[INFO ]  Installing MPC for host
[INFO ]  Installing MPC for host: done in 9.45s (at 01:51)
[INFO ]  =================================================================
[INFO ]  Installing binutils for host
[INFO ]  Installing binutils for host: done in 71.76s (at 03:03)
[INFO ]  =================================================================
[INFO ]  Installing pass-1 core C compiler
[INFO ]  Installing pass-1 core C compiler: done in 355.79s (at 08:59)
[INFO ]  =================================================================
[INFO ]  Installing kernel headers
[INFO ]  Installing kernel headers: done in 9.18s (at 09:08)
[INFO ]  =================================================================
[INFO ]  Installing C library headers & start files
[INFO ]  Installing C library headers & start files: done in 24.26s (at 09:32)
[INFO ]  =================================================================
[INFO ]  Installing pass-2 core C compiler
[INFO ]  Installing pass-2 core C compiler: done in 528.41s (at 18:21)
[INFO ]  =================================================================
[INFO ]  Installing C library
[INFO ]  Installing C library: done in 396.35s (at 24:57)
[INFO ]  =================================================================
[INFO ]  Installing final compiler
[INFO ]  Installing final compiler: done in 695.28s (at 36:32)
[INFO ]  =================================================================
[INFO ]  Cleaning-up the toolchain's directory
[INFO ]    Stripping all toolchain executables
[INFO ]  Cleaning-up the toolchain's directory: done in 4.41s (at 36:37)
[INFO ]  Build completed at 20131201.175609
[INFO ]  (elapsed: 36:36.90)
[INFO ]  Finishing installation (may take a few seconds)...

Once you are complete you will find the complete toolchain under /home/sled/ARM/toolchain/x-tools/arm-unknown-linux-gnueabihf, there's also a version for the target system so you could copy it to your my cloud and compile stuff directly on my cloud without installing any build tools, but we won't do this for transmission. Also this toolchain can be used to compile other stuff than transmission.

Preparing to compile transmission

We emulate the root folder / on the my cloud by creating a new folder called mycloud

mkdir /home/sled/ARM/mycloud

This means we get a folder structure like /home/sled/ARM/mycloud/usr/local/bin etc.

We create a folder to hold the source code for transmission and its dependencies

mkdir /home/sled/ARM/src

Compiling dependencies for transmission

We need a handful of dependencies for transmission:

  • libevent
  • zlib
  • openssl
  • libcurl

The order is important because cURL depends on OpenSSL etc..

Compiling libevent

Download and extract:

cd /home/sled/ARM/src
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar xvfz libevent-2.0.21-stable.tar.gz

Go into libevent source folder:

cd libevent-2.0.21-stable

Setup Environment Variables:

export PATH="/home/sled/ARM/toolchain/x-tools/arm-unknown-linux-gnueabihf/bin:$PATH"
export cross=arm-unknown-linux-gnueabihf-
export CC="${cross}gcc"
./configure --host="arm-unknown-linux-gnueabihf" --prefix="/home/sled/ARM/mycloud/usr/local"
make

NOTE: You should see "arm-unknown-linux-gnueabihf-gcc" several times in the output if you only see "gcc" then it didn't use the cross-compiler, make sure the environment variables are set properly.

make install

Compiling zlib

IMPORTANT: Close your old terminal tab and open a new one and set the environment variables again to make sure the correct ones are being used…

Download and extract:

cd /home/sled/ARM/src
wget http://zlib.net/zlib-1.2.8.tar.gz
tar xvfz zlib-1.2.8.tar.gz

Go into zlib source folder:

cd zlib-1.2.8

Setup Environment Variables:

export PATH="/home/sled/ARM/toolchain/x-tools/arm-unknown-linux-gnueabihf/bin:$PATH"
export cross=arm-unknown-linux-gnueabihf-
export CC="${cross}gcc"
./configure --prefix="/home/sled/ARM/mycloud/usr/local"
make

NOTE: You should see "arm-unknown-linux-gnueabihf-gcc" several times in the output if you only see "gcc" then it didn't use the cross-compiler, make sure the environment variables are set properly.

make install

Compiling OpenSSL

IMPORTANT: Close your old terminal tab and open a new one and set the environment variables again to make sure the correct ones are being used…

Download and extract:

cd /home/sled/ARM/src
wget http://www.openssl.org/source/openssl-1.0.0k.tar.gz
tar xvfz openssl-1.0.0k.tar.gz

Go into OpenSSL source folder

cd openssl-1.0.0k

Setup Environment Variables:

export PATH="/home/sled/ARM/toolchain/x-tools/arm-unknown-linux-gnueabihf/bin:$PATH"
export cross=arm-unknown-linux-gnueabihf-
./Configure linux-generic32 --prefix=/home/sled/ARM/mycloud/usr/local shared zlib-dynamic -I"/home/sled/ARM/mycloud/usr/local/include"

IMPORTANT: Configure begins with capital letter here!

make CC="${cross}gcc" AR="${cross}ar r" RANLIB="${cross}ranlib"

NOTE: You should see "arm-unknown-linux-gnueabihf-gcc" several times in the output if you only see "gcc" then it didn't use the cross-compiler, make sure the environment variables are set properly.

make install

Compiling cURL

IMPORTANT: Close your old terminal tab and open a new one and set the environment variables again to make sure the correct ones are being used…

Download and extract:

cd /home/sled/ARM/src
wget http://curl.haxx.se/download/curl-7.33.0.tar.gz
tar xvfz curl-7.33.0.tar.gz

Go into cURL source folder:

cd curl-7.33.0

Setup Environment Variables:

export PATH="/home/sled/ARM/toolchain/x-tools/arm-unknown-linux-gnueabihf/bin:$PATH"
export cross=arm-unknown-linux-gnueabihf-
export CC="${cross}gcc"
./configure --prefix="/home/sled/ARM/mycloud/usr/local" --target=arm-unknown-linux-gnueabihf --host=arm-unknown-linux-gnueabihf --with-zlib="/home/sled/ARM/mycloud/usr/local" --with-ssl="/home/sled/ARM/mycloud/usr/local"

Make sure its configured with the following options:

curl version:     7.33.0
  Host setup:       arm-unknown-linux-gnueabihf
  Install prefix:   /home/sled/ARM/mycloud/usr/local
  Compiler:         arm-unknown-linux-gnueabihf-gcc
  SSL support:      enabled (OpenSSL)
  SSH support:      no      (--with-libssh2)
  zlib support:     enabled

Now make it:

make

NOTE: You should see "arm-unknown-linux-gnueabihf-gcc" several times in the output if you only see "gcc" then it didn't use the cross-compiler, make sure the environment variables are set properly.

make install

Compiling Transmission (finally)

IMPORTANT: Close your old terminal tab and open a new one and set the environment variables again to make sure the correct ones are being used…

Download and extract:

cd /home/sled/ARM/src
wget http://download.transmissionbt.com/files/transmission-2.82.tar.xz
tar xvfJ transmission-2.82.tar.xz

Go into transmission source folder:

cd transmission-2.82

Setup Environment Variables:

export PATH="/home/sled/ARM/toolchain/x-tools/arm-unknown-linux-gnueabihf/bin:$PATH"
export cross=arm-unknown-linux-gnueabihf-
./configure --host="arm-unknown-linux-gnueabihf" --prefix=/usr/local --without-gtk --disable-libnotify --disable-mac --disable-wx --disable-beos --enable-utp --disable-nls --enable-inotify --enable-utp --enable-lightweight --enable-cli --enable-daemon --with-zlib="/home/sled/ARM/mycloud/usr/local" PKG_CONFIG="/usr/bin/pkg-config" PKG_CONFIG_PATH="/home/sled/ARM/mycloud/usr/local/lib/pkgconfig" CPPFLAGS=-DTR_EMBEDDED
make CC="${cross}gcc" AR="${cross}ar" RANLIB="${cross}ranlib"

Now we create a nice little .deb package using checkinstall

(If you don't have checkinstall, install it using `apt-get install checkinstall`)

sudo checkinstall --install=no

Checkinstall will ask you a few questions that I filled in as follows:

--- SNIP START ---
The package documentation directory ./doc-pak does not exist. 
Should I create a default set of package docs?  [y]: n

Please write a description for the package.
End your description with an empty line or EOF.
>> Transmission
>> a lightweight BitTorrent client
>> 

This package will be built according to these values (most important is to set the Architecture to armhf, otherwise it won't install): 

0 -  Maintainer: [ Simon - <schmsimo@gmail.com> ]
1 -  Summary: [ Transmission ]
2 -  Name:    [ transmission ]
3 -  Version: [ 2.82 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ checkinstall ]
7 -  Architecture: [ armhf ]
8 -  Source location: [ transmission-2.82 ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ transmission ]
12 - Conflicts: [  ]
13 - Replaces: [  ]
--- SNIP END --

When you are done the output should be:

--- SNIP START ---
**********************************************************************

 Done. The new package has been saved to

 /home/sled/ARM/src/transmission-2.82/transmission_2.82-1_armhf.deb
 You can install it in your system anytime using: 

      dpkg -i transmission_2.82-1_armhf.deb

**********************************************************************

--- SNIP END ---
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License