HOWTO: Install Crashplan on FFP 0.7 arm

Marvell Kirkwood based
Post Reply
normsland
Posts: 69
Joined: Sun Mar 31, 2013 10:07 am

HOWTO: Install Crashplan on FFP 0.7 arm

Post by normsland » Sun Mar 31, 2013 11:38 am

I haven't found this on any other thread. There's probably a nice funplug way of doing this but... just thought I'd let you know how I got Crashplan installed on FFP on my Zyxel NSA325.

Here are the instructions on how to get Crashplan, installed and setup on FFP 0.7 arm.
You need to login via ssh to NAS with root privileges and follow these steps.

=== Preparation ===
1. Install cpio. The CrashPlan installation script requires the command cpio.

Code: Select all

#slacker -Ui cpio
2. Install nano

Code: Select all

slacker -Ui nano
=== Installation ===
1. Download CrashPlan. If a new version has been released in the meantime you can download it from the http://www.crashplan.com/consumer/download.html CrashPlan download page.

Code: Select all

#cd /ffp/tmp/
#wget http://download.code42.com/installs/linux/install/CrashPlan/CrashPlan_4.4.1_Linux.tgz
2. Extract CrashPlan.

Code: Select all

#tar -xvf CrashPlan_4.4.1_Linux.tgz
3. Fix and start the installation script.

Code: Select all

#cd CrashPlan-install
#sed -i "s/\/bin\/bash/\/ffp\/bin\/bash/" install.sh
#./install.sh
4. During installation the script will ask a few questions. The first question is whether the JRE (Java Runtime Environment) shall be downloaded and installed. The request should be acknowledged by entering y.

No Java VM could be found in your path
Would you like to download the JRE and dedicate it to CrashPlan? (y/n) [y] y
jre will be downloaded

5. In the next step the installation asks if you agree with the EULA (end user license agreement). Acknowledge by entering y if you want to proceed.

You must review and agree to the EULA before installation.

Press enter to read the EULA.

Do you accept and agree to be bound by the EULA? (yes/no) yes

6. Then, a few installation paths can be adjusted. I've chosen the path "/ffp/crashplan" to install Crashplan but you can change this to wherever you like.
What directory do you wish to install CrashPlan to? [/usr/local/crashplan] /ffp/crashplan
/ffp/crashplan does not exist. Create /ffp/crashplan? (y/n) [y] y

What directory do you wish to link the CrashPlan executable to? [/usr/local/bin] /ffp/bin

What directory do you wish to store backups in? [/ffp/crashplan/manifest]
/ffp/crashplan/manifest does not exist. Create /ffp/crashplan/manifest? (y/n) [y] y

What directory contains your SYSV init scripts? [/etc/init.d] /ffp/start

What directory contains your runlevel init links? [/etc/rc.d] /ffp/start

7. Finally, the installation script shows the selected paths and asks for affirmation. When everything is correct acknowledge by entering y.
8.. When you see the following line the script is finished.

Installation is complete. Thank you for installing CrashPlan for Linux

9. We cannot use the java package downloaded by Crashplan. Therefore you will need to download the "ARMv5 Linux – Headless EABI" from Oracle http://www.oracle.com/technetwork/java/ ... index.html and copy it to /ffp/crashplan

10. Now you need to delete the Crashplan Java version that was installed and install the oracle ARMv5 Linux version and rename the oracle directory as 'jre'

Code: Select all

#cd /ffp/crashplan
#rm -r jre
#tar -xvf <oracle jre.tar.gz>
#mv <installed oracle jre directory name> jre
#rm <oracle jre.tar.gz>
11. Now you need to replace libjtux.so in /ffp/crashplan/

Code: Select all

#cd /ffp/crashplan/
#mv libjtux.so libjtux.so.bak
#wget http://dl.dropbox.com/u/11784090/libjtux.so
12. Now you need to replace jna.jar in /ffp/crashplan/lib/

Code: Select all

#cd lib/
#mv jna.jar jna.jar.bak
#wget http://dl.dropbox.com/u/50398581/crashplan%20on%20NAS/jna-3.2.5.jar
#ln -s jna-3.2.5.jar jna.jar
13. Now you need to add libffi.so (required for jna and not available by default):

Code: Select all

#slacker -Uia br2:libffi
#ln -s  /ffp/lib/libffi.so.6 /ffp/lib/libffi.so.5
14. Now you need to replace libmd5.so with a working version

Code: Select all

#cd /ffp/crashplan
#mv libmd5.so libmd5.so.old
#wget http://dl.dropbox.com/u/11784090/libmd5.so
15. Now /ffp/crashplan/bin/CrashPlanEngine has to be adjusted to the ffp environment.

Code: Select all

#sed -i "s/\/bin\/bash/\/ffp\/bin\/bash/" /ffp/crashplan/bin/CrashPlanEngine
#sed -i "s/ps -eo 'pid,cmd'/ps w/" /ffp/crashplan/bin/CrashPlanEngine
16. Since Crashplan version 3.6.3, code42 (developers of Crashplan) have increased the Java maximum heap size to 1024mb from 512mb to cope with backup sets larger than 2TB. However this is value too big for the average ffp NAS. This user has over 90,000 files, 80GB and finds that a maximum heap of 192mb is sufficient. Therefore you need to edit the run.conf.

Code: Select all

#nano -w /ffp/crashplan/bin/run.conf
Change the SRV_JAVA_OPTS line with value -Xmx1024m to a smaller value eg -Xmx192m

Code: Select all

SRV_JAVA_OPTS="-Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashP
lan -Xms20m -Xmx192m -Djava.net.preferIPv4Stack=true -Dsun.net.inetaddr.ttl=300
-Dnetworkaddress.cache.ttl=300 -Dsun.net.inetaddr.negative.ttl=0 -Dnetworkaddres
s.cache.negative.ttl=0 -Dc42.native.md5.enabled=false"
17.Now rename Crashplan to startup on boot (and create symlink for updates)

Code: Select all

#cd /ffp/start
#mv crashplan crashplan.sh
#ln -s /ffp/start/crashplan.sh /ffp/start/crashplan
Now reboot your NAS. Almost there :)

=== Operation Test ===
1. Crashplan should start along with ffp. If you SSH back in to your NAS you should be able to see the status of Crashplan.

Code: Select all

# /ffp/start/crashplan.sh status
2. To check whether CrashPlan connected to its assigned TCP Ports use <tt>netstat</tt>.

Code: Select all

# netstat -an | grep 424
tcp 0 0 0.0.0.0:4242 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:4243 0.0.0.0:* LISTEN
=== Configuration ===
As a NAS doesn't have a screen we will need to configure Crashplan in headless mode. Therefore, the configuration of CrashPlan is done remotely from a computer on which CrashPlan is already installed. Suggested version is Crashplan 4.4.1 available here https://download2.code42.com/installs/w ... .1_Win.exe
Instructions how to do this can be found on the CrashPlan support page http://support.crashplan.com/doku.php/h ... ess_client.
I found it necessary to stop the Crashplan service "/ffp/start/crashplan.sh stop" and edit "/ffp/crashplan/conf/my.service.xml" file from:
127.0.0.1 to 0.0.0.0
and then edit the local /crashplan/ui.properties file on my Windows client:
ServiceHost=IP-OF-YOUR-CP-SERVER

As of Crashplan version 4.30 onwards. Code42 have increased the security been the headless client and the server so we need to do a few more steps to get our Windows clients to work. On your ffp NAS run the following and copy the output of the following on a notepad somewhere

Code: Select all

cat /var/lib/crashplan/.ui_info  ; echo
The command will output a line similar to the following (everyone’s will be different):
4243,13d436c0-230a-4242-b258-574e60e62a9f,0.0.0.0

On your Windows machine. Go in to an Administrative command prompt Start menu->Enter cmd in to the search box. Right click on cmd and "Run as Administrator". Paste/enter the following:

Code: Select all

C:\>del C:\ProgramData\CrashPlan\.ui_info
Now grab that copied text from notepad. Replace 0.0.0.0 with the IP-OF-YOUR-CP-SERVER

Code: Select all

C:\>echo 4243,some-GUID,IP-OF-YOUR-CP-SERVER > C:\ProgramData\CrashPlan\.ui_info
Example below:

Code: Select all

echo 4243,13d436c0-230a-4242-b258-574e60e62a9f,192.168.0.2 > C:\ProgramData\CrashPlan\.ui_info
The Windows Crashplan UI should now connect.


== Final Configuration IMPORTANT ===

It seems like it is working, but you are not done yet!
Log in to Crashplan, configure your backup sets etc...

The OS seems to wipe clean /var/lib at each reboot. The problem is that's where crashplan stores your login information!
To solve the problem:

Code: Select all

cp -p /var/lib/crashplan/.identity /ffp/crashplan/
cp -p /var/lib/crashplan/.ui_info /ffp/crashplan/
nano -w  /ffp/crashplan/bin/CrashPlanEngine
and add:

Code: Select all

mkdir -p /var/lib/crashplan
cp -p /ffp/crashplan/.identity /var/lib/crashplan/
cp -p /ffp/crashplan/.ui_info /var/lib/crashplan/
after:

Code: Select all

echo "Using standard startup"
cd $TARGETDIR

=== Thanks ===

Without Fezzawinkle on OpenStora forums none of this would have been possible for me. http://www.openstora.com/phpBB3/viewtop ... 8156#p8156
Vincesoft for dls and the identify problems solved. Thanks! http://vincesoft.blogspot.com/2011/11/h ... omega.html
Chris Nelson for the Crashplan 4.30 .ui_info fix http://chrisnelson.ca/2015/07/02/fixing ... -synology/
Mijzelf, thanks for adding the prerequisite cpio to his repository.
Last edited by normsland on Sat Dec 26, 2015 4:53 pm, edited 21 times in total.

normsland
Posts: 69
Joined: Sun Mar 31, 2013 10:07 am

Re: HOWTO: Install Crashplan on FFP 0.7 arm

Post by normsland » Sun Mar 31, 2013 11:39 am

=== Updates ===
Crashplan from time to time release updates which breaks crashplan on ffp. Their upgrade script uses arguments with the mv command that isn't compatible with busybox. The usual signs that this has happened is that you'll notice that crashplan hasn't started or backed up for x days, and you check /ffp/crashplan/log/history.log.0

Code: Select all

I 01/08/15 05:08PM Backup scheduled to always run
I 01/08/15 05:09PM Upgrades available at central.crashplan.com:443
I 01/08/15 05:09PM Downloading a new version of CrashPlan.
I 01/08/15 05:10PM Download of upgrade complete - version 1388728800370.
I 01/08/15 05:10PM Installing upgrade - version 1388728800370
I 01/08/15 05:10PM Upgrade installed - version 1388728800370
I 01/08/15 05:10PM CrashPlan stopped, version 3.6.4, GUID <SOME_NUMBER>
To fix it within the /ffp/crashplan directory you will find an upgrade directory. Within there you need to "ls -l" and look for a numeric directory, here's an example below:

Code: Select all

drwxr-xr-x 4 root root    4096 Oct 20 13:12 1388642400364.1413616221975
-rw-r--r-- 1 root root 6634785 Oct 17 17:23 1388642400364.jar
Within the numeric directory you need to update the upgrade.sh to work with ffp.

Code: Select all

sed -i "s/\/bin\/bash/\/ffp\/bin\/bash/" upgrade.sh
sed -i "s/mv -fv/\/ffp\/bin\/mv -fv/" upgrade.sh
sed -i "s/\/bin\/ps/\/ffp\/bin\/ps/" upgrade.sh
Next we need to make the upgrade.sh executable

Code: Select all

chmod +x upgrade.sh
Then run the script

Code: Select all

./upgrade.sh
Wait for the script execution to complete (anything up to 5mins). Then check the relevant upgrade log in /ffp/crashplan/log for any errors. The script should upgrade crashplan correctly and crashplan should restart.

After the upgrade to Crashplan 4.4.1, code42 tweaked the headless configuration and replaced a whole lot of files. Please follow this post for more details.

After the upgrade to Crashplan 4.3.0, code42 made the headless configuration more secure. Please follow this post for more details.

After the upgrade to Crashplan 4.2.0, I found it necessary to update the identity file for this release.

Code: Select all

cp -p /var/lib/crashplan/.identity /ffp/crashplan/
Don't forget to upgrade your Crashplan user interface to the latest version as per the "Configuration" section in the first post and copy across your .ui_info

Code: Select all

cp -p /var/lib/crashplan/.ui_info /ffp/crashplan/
Last edited by normsland on Sat Nov 07, 2015 1:02 pm, edited 8 times in total.

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: HOWTO: Install Crashplan on FFP with OPTWARE

Post by Mijzelf » Sun Mar 31, 2013 1:04 pm

Nice! Little question, where is optware involved? Is it only needed for cpio?

normsland
Posts: 69
Joined: Sun Mar 31, 2013 10:07 am

Re: HOWTO: Install Crashplan on FFP with OPTWARE

Post by normsland » Sun Mar 31, 2013 2:06 pm

Hi Mijzelf, yes optware is only needed for cpio. I noticed it was available ffp 0.5 but couldn't find it in 0.7. Thanks

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: HOWTO: Install Crashplan on FFP with OPTWARE

Post by Mijzelf » Sun Mar 31, 2013 5:30 pm

I added cpio to my repository.

normsland
Posts: 69
Joined: Sun Mar 31, 2013 10:07 am

Re: HOWTO: Install Crashplan on FFP

Post by normsland » Mon Apr 01, 2013 9:25 am

Thanks Mijzelf that's one less step. Done a replace on the word "opt" in the instructions too :D

DualPlatform
Posts: 23
Joined: Sun Nov 18, 2012 2:32 pm

Re: HOWTO: Install Crashplan on FFP

Post by DualPlatform » Mon Apr 01, 2013 12:27 pm

Excellent! Thanks for the detailed writeup.

oxygenoxy
Posts: 2
Joined: Mon Apr 01, 2013 2:40 pm

Re: HOWTO: Install Crashplan on FFP

Post by oxygenoxy » Mon Apr 01, 2013 2:43 pm

I've followed the steps but I can't get the java to work. (I'm using fun_plug 0.5 btw).
root@DNS:/mnt/HD_a2/ffp/crashplan/jre/bin# ldd ./java
checking sub-depends for '/ffp/lib/libpthread.so.0'
checking sub-depends for 'not found'
checking sub-depends for 'not found'
checking sub-depends for 'not found'
checking sub-depends for '/ffp/lib/libc.so.0'
libpthread.so.0 => /ffp/lib/libpthread.so.0 (0x00000000)
libjli.so => not found (0x00000000)
libdl.so.2 => not found (0x00000000)
libc.so.6 => not found (0x00000000)
libc.so.0 => /ffp/lib/libc.so.0 (0x00000000)
/ffp/lib/ld-uClibc.so.0 => /ffp/lib/ld-uClibc.so.0 (0x00000000)
How do I solve the missing library issue?

normsland
Posts: 69
Joined: Sun Mar 31, 2013 10:07 am

Re: HOWTO: Install Crashplan on FFP

Post by normsland » Mon Apr 01, 2013 3:14 pm

Do you have a copy of the libs in the path below? You have extracted jvm correctly?

Code: Select all

/ffp/crashplan/jre/bin# find / -name libjli.so
/e-data/<some number>/ffproot/ffp/crashplan/jre/lib/arm/jli/libjli.so

oxygenoxy
Posts: 2
Joined: Mon Apr 01, 2013 2:40 pm

Re: HOWTO: Install Crashplan on FFP

Post by oxygenoxy » Tue Apr 02, 2013 3:10 am

Forgot to add that I'm using fun_plug 0.5 on DNS323. I extracted the JRE that I downloaded from Oracle. That's all to it to installing right? Is there any file I need to add so that the system will search /ffp/crashplan/jre/lib/arm/jli/ for library files?
$ pwd
/mnt/HD_a2/ffp/crashplan/jre/bin
$ ./java
./java: No such file or directory
$ ldd ./java
checking sub-depends for '/ffp/lib/libpthread.so.0'
checking sub-depends for 'not found'
checking sub-depends for 'not found'
checking sub-depends for 'not found'
checking sub-depends for '/ffp/lib/libc.so.0'
libpthread.so.0 => /ffp/lib/libpthread.so.0 (0x00000000)
libjli.so => not found (0x00000000)
libdl.so.2 => not found (0x00000000)
libc.so.6 => not found (0x00000000)
libc.so.0 => /ffp/lib/libc.so.0 (0x00000000)
/ffp/lib/ld-uClibc.so.0 => /ffp/lib/ld-uClibc.so.0 (0x00000000)
$ find /ffp/crashplan/ -name libjli.so
/ffp/crashplan/jre/lib/arm/jli/libjli.so

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: HOWTO: Install Crashplan on FFP

Post by Mijzelf » Tue Apr 02, 2013 7:12 am

I'm afraid it won't work on an (unmodified) DNS323. That box has an OABI kernel, and I don't think the JVM will run on it.

normsland
Posts: 69
Joined: Sun Mar 31, 2013 10:07 am

Re: HOWTO: Install Crashplan on FFP

Post by normsland » Tue Apr 02, 2013 9:38 am

Hi oxygenoxy. I think Mijzelf is correct. The download on Oracle's site does specify "ARMv5 Linux - Headless EABI, SoftFP ABI, Little Endian2". Sorry.

KlausKleber
Posts: 2
Joined: Mon May 06, 2013 10:57 am

Re: HOWTO: Install Crashplan on FFP 0.7 arm

Post by KlausKleber » Mon May 06, 2013 11:05 am

Hello,

thanks for the work. But I have problems with the installation at the very beginning.

Code: Select all

#cd CrashPlan-install
#sed -i "s/\/bin\/bash/\/ffp\/bin\/bash/" install.sh
#./install.sh
After the last row I receive this error:
-sh: ./install.sh: /ffp/ffp/ffp/ffp/ffp/ffp/ffp/ffp/ffp/ffp/ffp/bin/bash: bad interpreter: No such file or directory
But the install.sh is in that directory.

Can anyone help me fixing that issue?

Big thanks in advance!

normsland
Posts: 69
Joined: Sun Mar 31, 2013 10:07 am

Re: HOWTO: Install Crashplan on FFP 0.7 arm

Post by normsland » Mon May 06, 2013 2:59 pm

KlausKleber wrote:After the last row I receive this error:
-sh: ./install.sh: /ffp/ffp/ffp/ffp/ffp/ffp/ffp/ffp/ffp/ffp/ffp/bin/bash: bad interpreter: No such file or directory
Works fine for me. So don't know what has gone wrong there. Manually change the install.sh file (eg nano -w install.sh) so that the first line of the file is

Code: Select all

#!/ffp/bin/bash

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: HOWTO: Install Crashplan on FFP 0.7 arm

Post by Mijzelf » Mon May 06, 2013 6:43 pm

I suppose the 'sed' line is applied more than once. And each time it exchanges /bin/bash by /ffp/bin/bash, so that accumulates. Maybe it's better to perform

Code: Select all

sed -i "s/!\/bin\/bash/!\/ffp\/bin\/bash/" install.sh

Post Reply