I picked up a Synology DS415play, a couple weeks ago. I’ve been looking for a good way to store family memories, as well as have device-indepentet on-site storage and redundancy.
The Synology DiskStation is a Linux-based NAS, and I couldn’t stand that the default shell was
ash. How to fix?
Finding the bootstrap file for the Intel Atom CE5335 was a bit of a challenge, since Synology doesn’t use it as widely used as some other CPUs in their lineup. Fortunately the thread I linked above has a relatively recent (Nov 2014) bootstrap for a DS214play, which uses the same CPU. I guessed it would be the same, and it was.
I’m going to assume that if you’re reading this, you are thinking of doing the same on your DiskStation, and that you have an ill-defined-but-higher-than-zero knowledge of both *nix systems and how to Google.
First, you’ll need to
ssh into the NAS as root (root’s password is the same as the admin user password).
You’ll need to execute the following commands, command by command:
$ cd /volume1/@tmp $ wget http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/syno-i686-bootstrap_1.2-7_i686.xsh $ chmod +x syno-i686-bootstrap_1.2-7_i686.xsh $ sh syno-i686-bootstrap_1.2-7_i686.xsh $ rm syno-i686-bootstrap_1.2-7_i686.xsh
Line by line, the above does the following:
- Change into the Synology’s temp directory
- Download the bootstrap script
- Make the script executable
- Run the script
- Remove the script
At this point you have ipkg, the package manager, installed, but your shell doesn’t know about the folder it’s installed in. You’ll need to add
/opt/sbin/ to the
PATH in your
While you’re in your
.profile, you might see a line that says
HOME=/root/. I changed mine to
HOME=~/, since I want this .profile to be portable between users. I’ve copied it to the admin user when I finished, so I have the same experience when I’ve connected as admin and root.
Now, if you type
ipk and hit
[tab] it should autocomplete to
So, let’s install
$ ipkg install bash`
Bam. You’ll get some output, then you should have
Now, I needed conventions for getting into bash when I connect to the device. Again, the Synology forums came to the rescue.
Add the following to the end of your
if [[ -x /opt/bin/bash ]]; then exec /opt/bin/bash fi
The above checks if
/opt/bin/bash is executable. If it is, the command will execute
/opt/bin/bash. If it is not, it doesn’t execute /opt/bin/bash, therefore leaving you in
Add the following to
PS1='\u@\h:\W \$ ' export SHELL=/opt/bin/bash
The top line you may want to adjust to your taste. That’s how I like my prompt to look. Here’s a good tool to help you build the prompt that suits you.
The second line sets the
SHELL variable to /opt/bin/bash. Remember that
.bashrc is only read by bash when bash is started, so the
SHELL only gets set if bash is called.
Now before you close your current SSH session, start a second. You should get your new, fancy bash prompt. Success!
Once you have that good feeling, copy
/volume1/homes/admin/, and start another ssh session, this time connecting as admin. If that works, you’re set.
I find that if I start a project like this by thinking about (and sometimes outlining) a post like this as I go, I have a better understanding of what I’m doing. Often, if I can’t follow the thread from beginning to the end, I don’t actually begin the project because I feel like I don’t understand the process well enough. ↩