[GUIDE] Build-Essential working on v3 firmware!

(WARNING: DO NOT ATTEMPT ON v4 FIRMWARE)

  Disclaimer:  I take no responsibility for your device getting bricked as a result of proceeding with this, so take caution!

Hi,

Decided to do an experiment today.  After bumping across http://snapshot.debian.org/ followed by some extensive repo switching on /etc/apt/sources.list, I managed to find a working repo entry that will play nice in installing build-essential on myCloud v3 (last version) firmware.

/etc/apt/sources.list entry:

deb http://snapshot.debian.org/archive/debian/20131130T095229Z/ sid main

Because release list is expired, you need to write the following to allow apt-get to process this repo:

apt-get -o Acquire::Check-Valid-Until=false update

Once complete, simply write

apt-get install build-essential

# or alternatively (I used apt-get, but aptitude was useful for tracing dependencies)

aptitude install build-essential

At this point, it should be safe to install, as long nfs-common-kernel or whatever (usually as a result of being made to upgrade/downgrade your version of libc6 which this  WILL NOT do) is not on the list (which as far as I know is one of the causes of the bricking since it was manually installed by WD).  The whole idea is to install the bleeding-edge (of the time) build-essential environment such that libc6 etc. have the same version as that installed on the myCloud firmware.

Sample log (note: your list may vary since I have already previously installed other applications):

EDIT: Update - Log output installing build-essential straight from a FACTORY RESET v3: https://dl.dropboxusercontent.com/u/1287967/build-essential-mycloud_FACTORY-v3-sid%202013-11-30%20T%2009-52-29.txt

Obviously what this means is now it is indeed possible to build from source directly from the myCloud, without having to set up a separate Linux environment to doing any cross-compilation!  So far I haven’t seen any issues

Hope this helps anyone!

EDIT:  Output installing clang right after, from the same repo. 

https://dl.dropboxusercontent.com/u/1287967/clang-mycloud_v3-sid%202013-11-30%20T%2009-52-29.txt

1 Like

Bit of an update.  After installing build-essential on sid 2013-11-30, as of 2015-04-28,  I’ve been spending a bit of time updating packages from current sid.

apt-get update gcc is safe to upgrade to GCC 4.9.2 since it does not depend on a libc6 upgrade (which upgrading libc6 WILL brick your myCloud on reboot, due to WD’s custom NFS configuration being marked for upgrade in the process).

Unfortunately g++ is stuck at 4.8.2 as a result, since that requires libc6 upgrade.

At this stage there is no safe way to upgrade libc6 on stock v3.  Boost 1.55 will install no dramas though (provided build-essential from Debian sid 2013-11-30 repo is already installed).  Having already rebooted the machine and starting up just fine, if you really want to be safe, doing apt-get install’s from sid 2013-11-30 is probably much safer than the current update repositories.

EDIT:  Took a risk and tried to upgrade libc6 on jessie.  Bricked it (to the point ls wouldn’t work at all haha) and started fresh again.  Following the general steps above, in the event you encounter an overwrite operation being errored out by dpkg, consider the following instead:

apt-get -o Dpkg::Options::="--force-overwrite" <install whatever or upgrade>

I can tell you that no amount of overwriting will save you if you try to update libc6 though, once you start getting libc.so reference errors.  Upgrading libc6 is usually considered a dangerous operation on its own even in normal Linux world anyway.

EDIT: apt-get upgrade on this repo isn’t safe either.  Please don’t try that.

1 Like

Thank you very much for for the information and tutorial alongside the security warnings.