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

Here is the patched scripts I’m using to build packages.

Improvements over the ones provided by WD:

  • in setup.sh the detection of the host system architecture is broken in WD scripts; this causes two problems: QEMU executable is not copied properly on the chrooted system, and hence package compiling often segfaults (manual solution provided in my original guide); also, some special mount points are not mounted and unmounted properly on each build attempt, producing annoying warnings
  • in build-armhf-package.sh, the installation of the patched binutils was skipping binutils-dev package, which may be required by other packages on building (it happened to me); this may cause the download of a non-patched binutils-dev package, with the risk to obtain a non-properly built package

To use these patched scripts, download this file:

https://www.dropbox.com/s/tnhzrtbinolmais/WD%20MyCloud%2064k%20build%20patched%20scripts.tgz?dl=0

and unpack it in the folder of the build environment you’re using (ex.: 64k-wheezy). For instance:

# cd /root/wdmc-build/64k-wheezy
# wget https://www.dropbox.com/s/tnhzrtbinolmais/WD%20MyCloud%2064k%20build%20patched%20scripts.tgz?dl=0
# cp setup.sh setup.sh.backup
# cp build-armhf-package.sh build-armhf-package.sh.backup
# tar xzvf WD\ MyCloud\ 64k\ build\ patched\ scripts.tgz?dl=0

This will backup the original scripts as .backup and unpack the patched scripts.

Now proceed as usual.

IMPORTANT: as usual, USE AT YOUR OWN RISK! No warranty of any kind!

NOTE : Another important thing to note is that to build jessie packages it might be required to build a new patched version of binutils, becase the one provided by WD has become old: if a package you want to build depends on a newer version of binutils, it might download the newer unpatched version of binutils and hence produce an invalid package (i.e.: a package that won’t run properly on the My Cloud).

Follow the instructions in ./binutils/README-binutils-64k-pagesize.txt to know how to build a newer patched version (the procedure is very much similar to the one used to build standard packages).

For your convenience, I built version 2.24.51.20140903-1 some months ago (the one provided by WD in the sources for firmware version 4.00.00-607 was 2.24.51.20140425-1), here it is the link to download it:

https://www.dropbox.com/s/znsnscpsugqtlkb/binutils-armhf-64k.tar.gz?dl=0

Simply download it inside ./bintuils directory by replacing the original tar.gz file with the same name (*) provided by WD (make a backup of it before overwriting, for safety) and build packages in the usual way. This version might have become old meanwhile, but it’s certainly newer than the original one provided by WD.

(*) beware, if using wget it seems like the downloaded file has “?dl=0” suffix appended to its name. Remove it after downloading!

IMPORTANT: as usual, USE AT YOUR OWN RISK! No warranty of any kind!

Please note that all that I’m saying was tested with firmware versions 4.00.00-607 and 4.00.01-623 and the build environment was set up with the GPL source code package for firmware version 4.00.00-607 provided by WD (I checked there are no changes to these files in the GPL source code package for firmware version 4.00.01-623). I have not checked yet whether source code packages for newer firmware versions have differences regarding the build procedure of custom packages, nor I have tested my own built packages on these newer firmware versions to see if they still work, because I haven’t updated my MyCloud unit yet.

Hope this helps.

Mauro.