Wednesday, March 23, 2011

Synology DS210j IPKG Bootstrap

The Synology DiskStation series of NAS devices offers some pretty sophisticated machinery for quite affordable prices. In order to take advantage of the true potential of this miniature Linux file server, though, you need access to the rich set of open-source software already built for it. The easiest way to do this is via the IPKG package management system.

There's an excellent wiki article by Synology on how to install IPKG on your NAS. I found it very easy to do on my DS210j. Note that modifying your NAS in this manner could potentially leave it in an unstable state. You can always restore your device to factory settings, but that might necessitate a full reformat of your drives. Always ensure you have a backup plan should things to horribly horribly wrong.

First you should verify which CPU your NAS has. For example, the DS210j uses the Marvel Kirkwood mv6281 ARM processor. This determines which of the bootstrap packages to use. In our case we want this one. The easiest thing is to copy that link to your clipboard.

Next we'll connect to the NAS via SSH. Ensure you have SSH enabled by connecting to the browser interface and going to Control Panel -> Network Services -> Terminal and make sure the "Enable SSH service" is checked.

Of course, you'll also need SSH software on your computer. If you have a Mac, it's already available in the Terminal application. If you're in Windows, then install Cygwin with the OpenSSH package, or PuTTY.

Connect to your NAS with a username of "root". The password will be the same as your "admin" password. Once connected you should be presented with a command temrinal, similar to this. In this case, my NAS is called 'hushhush' (in memory of a great SF bar long since closed):

hushhush>

We want to download the bootstrap package from above, using the 'wget' command. Be sure to substitute the link you found above that corresponds to your model's CPU.

wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/syno-mvkw-bootstrap_1.2-7_arm.xsh

Once downloaded, we will execute the bootstrap code. Once executed, we can also delete it.

sh syno-mvkw-bootstrap_1.2-7_arm.xsh
rm syno-mvkw-bootstrap_1.2-7_arm.xsh

Now reboot your NAS, and login again via SSH. We will now update IPKG lists:

ipkg update
ipkg upgrade

And now you're done! You now have access to literally thousands of packages from the IPKG distributions. You can get a list of available packages via:

ipkg list

And to install a package, it's as simple as:

ipkg install <package>

Notes


  • If 'ipkg' can't be found, be sure "/opt/bin" is in your $PATH variable as exported in ~/.profile
  • After recent DSM updates some of the installation seems to have disappeared so you'll need to reinstall.
    1. Download the .xsh file as above and run it
    2. It will instruct you to delete some folders, reboot and re-run the script.
    3. !!BEFORE YOU DO THIS, BE SURE YOU DO NOT RELY ON BASH OR OTHER IPKG BINARIES TO LOG INTO ROOT ACCOUNT!!
    4. If your root user is cofigured to use bash via the /etc/passwd file then revert it to use ash before rebooting or you will not be able to log into your system!
    5. See my other post for info on how to safely use BASH for your ssh users.

1 comment:

  1. Thanks for this post. Should the ipkg command be part of the path or do we need to cd to a directory to use it?

    I found the answer.. For DSM 4 or greater you need to comment out the path and export path in the /root/.profile file

    ReplyDelete