How to install compiled programs on a Synology NAS

Synology is a hardware manufacturer of Network-attached storage (NAS) to SMB (Small to Medium Businesses) and SOHO (Small Office & Home Office) market. Their main competitors in the NAS market are: QNAP, Buffalo, Netgear, Drobo, ZyXel, Thecus, LaCie, Seagate and Western Digital.

I bought a Synology DiskStation DS211j and like many NAS on the market, it is a small computer powered by an ARM processor and runs the Linux operating system.

Since it runs Linux, you can install programs for Linux compiled for the ARM architecture. Read Synology’s disclaimer before proceeding

First you need to enable the terminal on your NAS. To enable it, follow the instructions below:

Go to Control Panel
Select Terminal
Check the box Enable SSH service and click on the OK button

After enabling the SSH service, you’ll need a terminal emulator. I use Putty. Login to your NAS as root and using your admin password to be presented to the command line.

login as: root
root@192.168.0.12’s password: type your admin password here and press Enter

BusyBox v1.16.1 (2011-03-24 02:15:54 CST) built-in shell (ash)
Enter ‘help’ for a list of built-in commands.

DiskStation>

You are presented to its shell (ash). You type the command and it will execute after you press Enter

DiskStation> uname -a
Linux DiskStation 2.6.32.12 #1605 Thu Mar 24 02:12:03 CST 2011 armv5tel GNU/Linux synology_88f6281_211j

To install the compiled programs, I’ll use a package manager called ipkg. To install we will get a bootstrap. A bootstrap is a script that installs ipkg.

Check what kind of CPU your NAS has. The programs are compiled to a specific CPU and won’t work if you don’t get the right script.

My Synology DS211j has a Marvell Kirkwood mv6281 1.2Ghz ARM Processor. Let’s go ahead and download a bootstrap that is known to work with this CPU. Download the script with wget following this table

DiskStation> cd /volume1/@tmp/
DiskStation> wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/syno-mvkw-bootstrap_1.2-7_arm.xsh
–19:58:04– http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/syno-mvkw-bootstrap_1.2-7_arm.xsh
=> `syno-mvkw-bootstrap_1.2-7_arm.xsh’
Resolving ipkg.nslu2-linux.org… 140.211.169.169
Connecting to ipkg.nslu2-linux.org|140.211.169.169|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 252,856 (247K) [text/plain]

100%[====================================>] 252,856 105.00K/s

19:58:08 (104.69 KB/s) – `syno-mvkw-bootstrap_1.2-7_arm.xsh’ saved [252856/252856]

Now we execute the script to install ipkg. There is an additional step if you have DSM 4.0+ as stated in their wiki (Step 8).

DiskStation> sh syno-mvkw-bootstrap_1.2-7_arm.xsh
Optware Bootstrap for syno-mvkw.
Extracting archive… please wait
bootstrap/
bootstrap/bootstrap.sh
bootstrap/ipkg-opt.ipk
bootstrap/ipkg.sh
bootstrap/optware-bootstrap.ipk
bootstrap/wget.ipk
1232+1 records in
1232+1 records out
Creating temporary ipkg repository…
Installing optware-bootstrap package…
Unpacking optware-bootstrap.ipk…Done.
Configuring optware-bootstrap.ipk…Modifying /etc/rc.local
Done.
Installing ipkg…
Unpacking ipkg-opt.ipk…Done.
Configuring ipkg-opt.ipk…WARNING: can’t open config file: /usr/syno/ssl/openssl.cnf
Done.
Removing temporary ipkg repository…
Installing wget…
Installing wget (1.12-2) to root…
Configuring wget
Successfully terminated.
Creating /opt/etc/ipkg/cross-feed.conf…
Setup complete.

The script will install a version that doesn’t have support to HTTPS. Remove the package and install the version that does

DiskStation> ipkg remove wget
Removing package wget from root…
Successfully terminated.
DiskStation> ipkg install wget-ssl
Installing wget-ssl (1.12-2) to root…
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/wget-ssl_1.12-2_arm.ipk
Installing libidn (1.25-1) to root…
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libidn_1.25-1_arm.ipk
Configuring libidn
Configuring wget-ssl
Successfully terminated.

After the setup is complete, we delete the script and reboot the NAS

DiskStation> rm syno-mvkw-bootstrap_1.2-7_arm.xsh

DiskStation> reboot

Wait a few minutes to restart it (you will hear a beep) and login back again.

Type the following command to add the commands from Optware to your PATH. You’ll have to add the directory where the Optware is installed before any other system command

DiskStation> vi ~/.profile
PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
export PATH

Update the list of programs that you can install by typing ipkg update

DiskStation> ipkg update
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/Packages.gz
Inflating http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/Packages.gz
Updated list of available packages in /opt/lib/ipkg/lists/cross
Successfully terminated.

You can now install any program you wish typing ipkg install <package name>

How to install pyLoad on a Synology DiskStation DS211j

Uninstall following the steps adapted from this BangBits blog post: Optware/ipkg on Synology DS211+

DiskStation> /etc/rc.optware stop
Shutting down Optware.
DiskStation> umount /opt
DiskStation> rm -rf /volume1/@optware/
DiskStation> rm -f /etc/rc.optware
DiskStation> rm -rf /opt
DiskStation> echo -e “#!/bin/sh\n” > /etc/rc.local
DiskStation> reboot