[GUIDE] Building packages for the new firmware... someone tried it?

Success! I’ll post the build guide here later when time permits… also a separate thread on transmission simplified install guide on v4 firmware…


Cross Compiling Transmission v2.84 with 64K page size memory patch

Ok here’s a straight forward guide. It’s not universal, only in cases where WD’s script breaks or fails (from their v4 GPL source here: packages/build_tools/debian/build-armhf-package.sh).

As reported by many, apparently the build instructions provided by WD for their latest 4.00.00-607 firmware for 64K page size memory, link above, is somewhat having issues with producing certain debs which resulted with compiler segmentation faults. I did not yield good results trying to rebuild the 64K binutils. As also reported in this thread by mauromol here, changing the compiler versions does not help either.

So there’s no other choice but to cross-compile manually. Note that this guide is only for WD’s latest v4 firmware and may be compatible with their further releases if they decide to stick to 64K page size memory builds. To get started, we need to get the package sources and build all shared dependencies manually, may vary from each build project but the end results with be just one *.dep file to be installed on the target system (WDMyCloud).

Build guide below is for latest transmission v2.84. Almost similar with any other guides you can find online for transmission builds, but this is make it work for 64K page memory target. Assuming anyone trying to compile this have some basic knowledge in Linux and fully aware of the usual WD’s warranty void clauses including disclaimer from any damages that may resulted from this guide, prepare below (download links are underlined):-


  • +permanent - Changes to the host will last. Useful for other build plan projects.

  • +temporary - Per-session. Changes are lost i.e. after terminal close.

  • Each command ends with a semicolon “;” though not needed at every end, it is clearer. Yes you can see multi semicolon in a line, it’s called one-liner. So if setup and done correctly, you could just easily copy each code box as a whole including the last blank line, then paste in the terminal to execute.

Setup the host:

  • Ubuntu i386 - 64-bit won’t work! I use Ubuntu 14.04 LTS Desktop (32-bit) setup with dynamic 30GB space VHD. Lookup online guides on how to achieve this Linux setup, VM or standalone. I’ve tried my best to validate this build guide with a clean install system and ensure every command are in order that you could just run it as a script.

  • GCC Linaro 4.7 Toolchain 64K page size memory - You can either:-
    a) build your own from WD’s v4 GPL source (577MB), under packages/build_tools/compilers,

b) or use their pre-built binaries within the downloaded GPL source above, under packages/build_tools/compilers/gcc-linaro-arm-linux-gnueabihf-4.7-64k-2013.01-20130116_linux.tar.bz2),

c) or download the 82MB gcc-linaro archive from me, link at the steps.

Prepare the host:

  • Install permanent necessities for builds on the first time:

    sudo apt-get -y install build-essential intltool checkinstall;

  • Setup temporary environments for this session:

    export PATH=$HOME/Desktop/WDMyCloud/toolchain/bin:$PATH;
    export PREFIX=$HOME/Desktop/WDMyCloud/usr/local;
    export HOST=arm-linux-gnueabihf;
    export CC=${HOST}-gcc;

  • Create permanent work space and source path under home root and change to`em:

    mkdir -p ~/Desktop/WDMyCloud/src;cd ~/Desktop/WDMyCloud/src;

  • Get the GCC Linaro 4.7 Toolchain, patched with 64K page memory size. If you builded your own or extracted from WD’s GPL, place it in this “./src” path. Else get them from me from my dropbox using:

    wget dl.dropbox.com/s/tq3kgmzvgu25w9s/gcc-linaro-arm-linux-gnueabihf-4.7-64k-2013.01-20130116_linux.tar.bz2;

  • Get the latest transmission 2.84 source. If you have specific version, place it in this “./src” path. Else get it using:

    wget download-origin.transmissionbt.com/files/transmission-2.84.tar.xz;

  • Get the rest of the dependencies required by transmission:

    apt-get -d source zlib openssl curl libevent;

  • Extract all the archives we have in the “./src” path:

    for i in ls *.tar.*|grep -v debian;do tar xf $i;done;

  • Move the extracted linaro toolchain to a permanent path:

    mv -f gcc-linaro-arm-linux-gnueabihf-4.7-64k-2013.01-20130116_linux …/toolchain;

Build the packages:

  • Work on the dependencies then transmission itself. After make install, you can reuse them for other build plan projects. If you encounter make errors, you’ll need to run below after making changes and/or reconfigurations:

    make clean;

  • zlib:

    cd zlib-*;
    ./configure --prefix=$PREFIX;
    make CC=“${HOST}-gcc” AR=“${HOST}-ar” RANLIB=“${HOST}-ranlib”;
    make install;

  • openssl:

    cd …/openssl-*;
    ./Configure --prefix=$PREFIX zlib-dynamic -I$PREFIX/include linux-generic32 shared;
    make CC=“${HOST}-gcc” AR=“${HOST}-ar r” RANLIB=“${HOST}-ranlib”;
    make install_sw;

  • curl:

    cd …/curl-*;
    ./configure --prefix=$PREFIX --host=$HOST --target=$HOST --with-ssl=$PREFIX/lib --with-zlib=$PREFIX;
    make CC=“${HOST}-gcc” AR=“${HOST}-ar” RANLIB=“${HOST}-ranlib”;
    make install;

  • libevent:

    cd …/libevent-*;
    ./configure --prefix=$PREFIX --host=$HOST --target=$HOST;
    make CC=“${HOST}-gcc” AR=“${HOST}-ar” RANLIB=“${HOST}-ranlib”;
    make install;

  • transmission:

    cd …/transmission-*;
    ./configure --prefix=/usr/local --host=$HOST --target=$HOST --enable-lightweight --with-zlib=$PREFIX PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig;
    make CC=“${HOST}-gcc” AR=“${HOST}-ar” RANLIB=“${HOST}-ranlib”;

  • Create the Debian package armhf 64K page size memory:

    echo transmission | sudo checkinstall --install=no --arch=armhf --nodoc;

Install on the 64K target system: