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


#80

Hi, I am obtaining the .deb of several applications, amule, mc, … with the last firmware, 04.01.02-417, to confirm it is posible, before its aplication.

I use a new virtual machine and I have obtained good results with 64k-wheezy, but when I work with the 64k-jessie I obtain this error

debian_output_dir=debian_output_dir
umount2: Invalid argument
umount: /root/wdmc-build/64k-jessie/build/proc: not mounted
umount2: Invalid argument
umount: /root/wdmc-build/64k-jessie/build/dev/pts: not mounted
umount2: Invalid argument
umount: /root/wdmc-build/64k-jessie/build/dev: not mounted
chroot: failed to run command `/bin/bash': No such file or directory

in the instruction

./setup.sh bootstrap/jessie-bootstrap_5.14.14_armhf.tar.gz build

Please, can you help me?


#81

The errors you report are not necessarily errors. I avoided them by patching the scripts, I had not yet time to update the guide with the patched scripts. Also, I should better have a look to the latest firmware to see if they changed anything.

Anyway, ignore those errors: unless the build process fails for other reasons, you can go on to build from the jessie repository.

UPDATE : after better looking at your error messages, the last one (from chroot) is suspect and I guess the build process stops after it. I’m not sure right now why it happens, however if you have some patience I may try to post here the patched scripts within some weeks (it’s holiday time ;-))


#82

Mauromol, thanks for your answer.
First at all, I have a lot of time and patience because I don´t need to change the firmware now.

Sorry for don´t say that the error is the last line

chroot: failed to run command `/bin/bash': No such file or directory

It is when setup.sh execute, 8 lines before the end,    

sudo chroot $debian_output_dir /bin/bash -x <<'EOF'

and 

  debian_output_dir = /root/wdmc-build/64k-jessie/build 


#83

Hi there, I’m getting the following when trying to install gcj-jre-headless:

The following packages have unmet dependencies:
 gcj-jre-headless : Depends: gcj-4.7-jre-headless (>= 4.7.2-1~) but it is not installable

Any ideas?


#84

edthepenguin wrote:

Hi there, I’m getting the following when trying to install gcj-jre-headless:

 

The following packages have unmet dependencies:
gcj-jre-headless : Depends: gcj-4.7-jre-headless (>= 4.7.2-1~) but it is not installable

 

Any ideas?

You have to build package gcj-4.7-jre-headless and install it before gcj-jre-headless.


#85

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.


#86

peretro wrote:

Sorry for don´t say that the error is the last line

chroot: failed to run command `/bin/bash’: No such file or directory

 

I’m not sure why this happens to you. What I can suggest is to try to follow my last message to download and use my patched scripts and binutils and see if they fix this problem. If you still get that error… sorry, the best I can suggest is to try to follow again my original guide from scratch and then download and use my patched scripts… good luck!


#87

@Nazar78

For someone who has the setup of building V4 compatible apps for the wd cloud. What source files would be needed to make a V3 app compatible with V4? more specfically im talking about “Flexget”. Its a python app, no deb. However i did manage to collect all the files/packages that were needed and installe during flexget’s install on my V3 wd drive.

Could these collected files be used to make V4 compatible Flexget app?

Thanks


#88

Which Debian packages are needed by Flexget?


#89

It doesn’t use Debs rather .tars and Python packagaes
They are all in this zip

https://www.dropbox.com/s/mvq6ucwado0cdcv/flex_all_packages.zip?dl=0


#90

They are quite a lot… you should review them one by one. Consider that, in general:

  • python libraries and applications are architecture independent, so they can be used in the new firmware without any change; however you must build and install the required python version (I’m not sure ti’s already available on the package provided by WD, you should test… if I remember well, I had to build python for installing pyLoad)
  • if any other tar contains native binary applications of applications that needs to be compiled, then they should be (re)compiled for the new firmware; if you want/need to (re)compile them on the unit itself, then you should build (following this guide) and install on the unit all the required compilers and this may become a complex task; if I remember well, Nazar did something about this by cross compiling Transmission from its tar source, so maybe you could inspire from his work (make a search on this forum)

#91

mauromol wrote:


peretro wrote:

Sorry for don´t say that the error is the last line

chroot: failed to run command `/bin/bash’: No such file or directory

 


 

I’m not sure why this happens to you. What I can suggest is to try to follow my last message to download and use my patched scripts and binutils and see if they fix this problem. If you still get that error… sorry, the best I can suggest is to try to follow again my original guide from scratch and then download and use my patched scripts… good luck!

Ok, I am going to follow your message and I will retry to obtain the .deb of several applications, with the last firmware.

Thanks again.


#92

Hi, 

could you please share the packages you created to install amule?

Many Thanks,

 KV


#93

king_virduk wrote:

Hi, 

could you please share the packages you created to install amule?

Many Thanks,

 

 KV


    The .deb files that you need to install amule-daemon are in:
    https://www.dropbox.com/s/d7hxwcx6pw2ry07/Amule-wd-v04.01.00.408.tar.gz?dl=0

    I used the procedure of mauromol describe in this message and was obtained with the v04.01.00.408 firmware files.

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


#94

Could I use this to build a package of an application that is not available through apt-get (i.e: nzbget 14.0)?


#95

Do you think that it is possible to build package from a Raspberry Pi ? (running on Raspbian?)

I need to install something to monitor my network usage on my WDMyCloud (such as ntopng or equivalent). So if someone has compiled such kind of application you could also just share it :) 


#96

what about ps3netsrv ?

https://github.com/dirkvdb/ps3netsrv–


#97

Hi, thanks a lof for the guide! I would have been totally lost without it.

I have created a Vagrant / VirtualBox based virtual machine and scriptsto automate all that you described, shared at GitHub (it supports only 64k Wheezy and Jessie). The main part is the  install.sh script. (Those interested in the background of this project: see Backup WD MyCloud to S3/Glacier with duplicity (build instructions included).)

Best regards, Jakub


#98

Hi, I have experienced the same problem temporarily for Jessie (but not wheezy). When I run my install.sh for the first time, it failed with this error but later it was ok. When I compared the “ok” and freshly prepared build directories, they  differed in the fresh one missing usr/bin/qemu-arm-static (in /wdmc-build/64k-jessie/build); copying it over fixed the problem.

However I am not able to replicate the problem anymore, even if I start from scratch (I use a virtual machine for the builds so it is easy to destroy and start anew).

Have a look at my setup and install.sh script here: https://github.com/jakubholynet/blog/tree/master/miniprojects/mycloud-duplicity-backup/mycloud-build-vm


#99

Could not someone share some precompiled binaries, especially ImageMagick?

I am completely unfamiliar with the compilation process, and haven’t got resources to do it.