Install Optware (IPKG) on QNAP TS-210 with QTS 4.x

With introduction of QTS 4.x:

  • there are a lot of changes in QNAP’s Control Panel, including the fact that “Application Servers” component is gone,
  • neither Optware nor IPKG or QPKG elements are available for download in the “App Center”.

This causes my “Installing Optware (IPKG) on QNAP TS-210” (6,5 year old!) article to be completely outdated.

Currently then only way to install Optware is to go through Manual instalation as described in QNAP Wiki.

Since I went through this guide and can confirm that it is working, I will be enough nasty to copy-paste that article here (removing stuff not related to QNAP TS-210 and fixing some bugs).

To go through these steps you need a shell access to your QNAP. Using the PuTTY is the most obvious answer.

But wait! There’s a much better way. QNAP introduced a gem called “shellinabox“, available in App Center (or here or here). I strongly recommend to use it, because with it, you need a web browser!

Install Optware

Create the required directories:

mkdir -p /share/MD0_DATA/optware/opt
mkdir /share/MD0_DATA/optware/ipkglib
cd /; ln -sf /share/MD0_DATA/optware/ipkglib /usr/lib/ipkg

Create a symbolic link to /opt:

rm -rf /opt
cd /; ln -sf /share/MD0_DATA/optware/opt /opt

Check, if /opt is correctly symlinked:

cd /
ls -la

You should see (among other results, i.e. folder contents):

opt -> /share/MD0_DATA/optware/opt/

Download and the IPKG file package:

cd /share/MD0_DATA/Download
wget http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/unstable/ipkg-opt_0.99.163-10_arm.ipk 
tar -xOvzf ipkg-opt_*_arm.ipk ./data.tar.gz | tar -C / -xzvf -

Change configuration file

Run Vi:

vi /opt/etc/ipkg.conf

Add following line to the end of file:

src cs05q3armel http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/stable

Save /opt/etc/ipkg.conf file and Quit VI. Hit Esc, type :qw and confirm with Enter.

Update Optware

Update the package list:

/opt/bin/ipkg update

You should see:

Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/stable/Packages 
Updated list of available packages in /opt/lib/ipkg/lists/cs05q3armel 
Successfully terminated.

Verify installation

Do this by installing Midnight Commander:

cd /share/MD0_DATA/optware 
/opt/bin/ipkg update 
/opt/bin/ipkg install slang 
/opt/bin/ipkg install mc --tmp-dir=/share/MD0_DATA/

Run Midnight Commander:

/opt/bin/mc

Alter path to lift the need of providing full paths:

PATH=$PATH:/opt/bin:/opt/sbin:"$PATH"

Preserve configuration

You will have to repeat some steps after each reboot of QNAP. To handle this we will modify autorun script.

Create (mount) autorun.sh:

mount /dev/mtdblock5 -t ext2 /tmp/config 
cd /tmp/config 

Run Vi:

vi autorun.sh

Add following lines to the end of file:

rm -rf /opt
ln -sf /share/MD0_DATA/optware/opt /opt
echo "export PATH=$PATH:/opt/bin:/opt/sbin" >> /etc/profile

Save autorun.sh file and Quit Vi. Hit Esc, type :qw and confirm with Enter.

Make autorun.sh executable and unmount it (very important!):

chmod +x autorun.sh
cd /
umount /dev/mtdblock5

For some reason sometimes Vi prevents you from modifying autorun.sh, opening it in some kind of weird read-only mode. You can avoid this by editing this file in mcedit that ships with Midnight Commander (assuming you did Optware verification and installed it).

Summary

That’s all folks! Reboot your QNAP to see, if everything works just fine after restart.

More details and some additional information can be found in the original article.

5 comments on “Install Optware (IPKG) on QNAP TS-210 with QTS 4.x

  1. Sam

    Wow! made my life sooooo much easier !! thanks a million ! Installed it on a T-112.

    Still i seem to have trouble getting ipkg to work after a reboot ?… Any ideas?

      1. Sam

        No problemo, thanks for taking the time to answer. For the moment, I’ll just avoid rebooting maybe ? lol
        Thanks again for a super article !

  2. Sam

    Found a fix to my problem. The default volume name on T-112 is HDA_DATA.
    Replaced MD0_DATA with HDA_DATA, and install / config persists after reboot. yay !
    Also checked “Run user defined processes during startup” in ControlPanel -> Hardware -> “General tab” on Firmware 4.3.3.
    Cheers !

  3. admin

    Yeah, you are correct. TS-112 (and other TS-1XX devices) is a single-bay NAS and uses HDA_DATA in QNAP’s terminology. While TS-210 is two-bay NAS and thus uses MD0_DATA (and MD1_DATA, under certain RAID configurations). This is mentioned in the original article, but I have removed this from here since this article is for TS-210 specifically. Great, that you managed to figure this out yourself and resolve your issue. Cheers!

Leave a Reply to admin Cancel reply