Skip to content

Instantly share code, notes, and snippets.

@97-109-107
Forked from marlun78/ds214-ipkg-install
Last active August 29, 2015 14:12
Show Gist options
  • Save 97-109-107/8eb48211b9284952bf84 to your computer and use it in GitHub Desktop.
Save 97-109-107/8eb48211b9284952bf84 to your computer and use it in GitHub Desktop.

How to install ipkg on a Synology DS214

After a couple of days of trying to get ipkg woking on my DS214 I found this article by trepmag. It is written for the DS213j, but it’s been working for me and others for the DS214 too.

I have done some minor changed to clarify some things, but if you are a Linux guy (unlike me) my changes might be of no use to you.

Guide

SSH

You need to have enabled ssh on your DiskStation. Then open up your terminal and type:

$ ssh root@[your-ds-ip]

Read more about how to setup SSH on your DiskStation here.

Create optware root directory

$ mkdir /volume1/@optware
$ mkdir /opt
$ mount -o bind /volume1/@optware /opt

Setup ipkg

$ feed=http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable
$ ipk_name=`wget -qO- $feed/Packages | awk '/^Filename: ipkg-opt/ {print $2}'`
$ wget $feed/$ipk_name
$ tar -xOvzf $ipk_name ./data.tar.gz | tar -C / -xzvf -
$ mkdir -p /opt/etc/ipkg
$ echo "src cross $feed" > /opt/etc/ipkg/feeds.conf

(Source: http://www.nslu2-linux.org/wiki/Optware/HomePage)

Set PATH

Open /etc/profile:

$ vi /etc/profile

Type i to enable insertion mode. See more vi-commands here.

Add /opt/bin:/opt/sbin: to the PATH variable. Then press ESC and press ZZ to save and exit.

If you are signed in as root as I was, you need to do the same to the /root/.profile file - then:

$ source /root/.profile

Create init scripts

The following steps will allow to automatically bind the /volume1/@optware directory to /opt and trigger the /opt/etc/init.d/* scripts.

Create the /etc/rc.local (chmod 755):

$ touch /etc/rc.local
$ chmod 755 /etc/rc.local
$ vi /etc/rc.local

Insert:

#!/bin/sh

# Optware setup
[ -x /etc/rc.optware ] && /etc/rc.optware start

Then press ESC and press ZZ to save and exit.

Create the /etc/rc.optware file (chmod 755):

$ touch /etc/rc.optware
$ chmod 755 /etc/rc.optware
$ vi /etc/rc.optware

Insert:

#! /bin/sh

if test -z "${REAL_OPT_DIR}"; then
# next line to be replaced according to OPTWARE_TARGET
REAL_OPT_DIR=/volume1/@optware
fi

case "$1" in
    start)
        echo "Starting Optware."
        if test -n "${REAL_OPT_DIR}"; then
            if ! grep ' /opt ' /proc/mounts >/dev/null 2>&1 ; then
                mkdir -p /opt
                mount -o bind ${REAL_OPT_DIR} /opt
            fi	
        fi
	[ -x /opt/etc/rc.optware ] && /opt/etc/rc.optware
    ;;
    reconfig)
	true
    ;;
    stop)
        echo "Shutting down Optware."
	true
    ;;
    *)
        echo "Usage: $0 {start|stop|reconfig}"
        exit 1
esac

exit 0

(source: a working optware env)

If each line is indented more than the previous line, toggle to following command in vi:

press ':'

type 'set noai'

press 'enter'

Finaly

Reboot the DiskStation and you should be done!

As I said, I’m not a Linux guy, so if you spot a misstake, please let me know.

I hope this helps! Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment