WD Cloud runs Debian Linux on ARM. When you build application for other architecture you need to have cross-building. I have successfully built package on Ubuntu 14 by following this post with a few note,
If you see error message like
1
Err http://ftp.debian.org wheezy-updates Release.gpg Could not resolve 'ftp.debian.org
Then, copy /etc/resolv.conf into buld/etc, e.g.,
1
sudo cp /etc/resolv.conf build/etc
Please check here for a list of Wd Cloud firmware images.
Summary of cross-building with wheezy for WD Cloud firmware version 4 or above
# required for cross-building apt-get install qemu-user-static apt-get install binfmt-support
# folder for building mkdir wdmc-build cd wdmc-build
# download location can be found in http://support.wdc.com/product/download.asp?groupid=904&lang=en wget http://download.wdc.com/gpl/gpl-source-wd_my_cloud-04.01.03-421.zip
# override build/etc/apt/sources.list sudo echo"deb http://security.debian.org/ wheezy/updates main contrib non-free" > build/etc/apt/sources.list sudo echo"deb-src http://security.debian.org/ wheezy/updates main contrib non-free" >> build/etc/apt/sources.list sudo echo"deb http://ftp.debian.org/debian wheezy-updates main contrib non-free" >> build/etc/apt/sources.list sudo echo"deb-src http://ftp.debian.org/debian wheezy-updates main contrib non-free" >> build/etc/apt/sources.list sudo echo"deb http://ftp.debian.org/debian wheezy main contrib non-free" >> build/etc/apt/sources.list sudo echo"deb-src http://ftp.debian.org/debian wheezy main contrib non-free" >> build/etc/apt/sources.list # optional until you need to use backports packages sudo echo"deb http://ftp.debian.org/debian wheezy-backports main contrib non-free" >> build/etc/apt/sources.list sudo echo"deb http://ftp.debian.org/debian wheezy-backports main contrib non-free" >> build/etc/apt/sources.list
sudo cp /etc/resolv.conf build/etc
Then you can build by running build.sh with package name, e.g,
lang=bash
1
./build.sh joe
It will download the source package from the repository, cross-compile it and build a deb file. The process could take over 10 minutes. Once it is success you can scp the .deb file to your router and install it with dpkg -i
Building Node.JS Manually
It is a little tricky to build nodejs because the source is not in the repository. I have tried to use binary from http://nodejs.org/dist/v0.12.0/node-v0.12.0-linux-x86.tar.gz but it is Killed for failed with cannot execute binary file You can follow the scripts to build it manually,
# now the build environment is ready wget http://nodejs.org/dist/v0.12.0/node-v0.12.0.tar.gz tar vfxz node-v0.12.0.tar.gz cd node-v0.12.0 ./configure make
# go back to original environment exit
The binary is ready in build/root/node-v0.12.0/node for you to upload to the WD Cloud. You can upload to /usr/local/bin in your WD Cloud