Ernst Martin Witte's Homepage

Optware/ipkg (hopefully) right on Synology DS213+ with DSM 4.2

Welcome
Lego & Povray
KRadio
Optware/ipkg on DSM4.2
Junges Sinfonieorchester Aachen
Brucknerorchester Coburg
Photos

Initial Joy with Optware/ipkg

When setting up my new Synology DS213+, I was quite reluctant to find the ready-made Optware/ipkg packages as documented at

http://www.synology-wiki.de/index.php/IPKG

This worked very well for setting up my Canon MP610 not only for printing but also for scanning via saned according to these instructions:

http://www.synology-forum.de/showthread.html?14955-HOW-TO-Sane-Backend-auf-DS-einrichten
(unfortunately in German, but the command line examples are quite universal ;-) However, this HowTo already indicates that something might not be perfectly ok with the http://ipkg.nslu2-linux.org/ repositories for the DS213+/DSM4.2, as the libusb does not work properly. However, it is recommended to replace the libusb files by links to the Synology system libraries.

Disillusion: Perl is not working!

However, it soon came to the point I need a recent Perl installation, as my goal is a munin server running on the NAS. At this point I experienced the problems many others already reported:
root@nas:/volume1/public/optware.old/optware.svn/platforms# perl -e 'print "x\n"; '
perl: relocation error: /opt/lib/perl5/5.8.8/ppc-linux/CORE/libperl.so: symbol __eqdf2, version GLIBC_2.3.3 not defined in file libc.so.6 with link time reference
	    
The reason for this problem is that the the packages available on http://ipkg.nslu2-linux.org/ are built based on a quite outdated toolchain not matching DSM 4.2 any more.

Back to the roots!

Please note: This is work in progress, I'm not yet sure if this way will succeed in the end.

After realizing this fundamental issue that the ready-made packages are not matching my DSM 4.2 at all, and that recent/matching Optware packages will likely not be available online, I started digging into ways how to setup up own self-compiled Optware repository. I found the basic initial steps at:

http://www.openfsg.com/index.php/Crosscompile_with_Optware

For my personal use, I decided to use gitsvn instead of a plain svn:

 git svn clone http://svn.nslu2-linux.org/svnroot/optware/trunk optware.gitsvn
	    
In my case the cloning was interupted, but could be continued easily by
 cd optware.gitsvn
 git svn fetch
	    
Before now continuing with the instructions from http://www.openfsg.com/ some preparations for the right compilation for the Synology DS213+ with DSM 4.2 are necessary.
  • First we need the right toolchain. You can find all Synology NAS GPL Sources and ready-made tool chains on the Synology DS Sourceforge page: http://sourceforge.net/projects/dsgpl/. In my case with my DS213+ I'm using the DSM 4.2 Tool Chain for the PowerPC QorIQ Linux 2.6.32. In order to integrate this as new platform in my Optware clone, I created the file
    platforms/toolchain-syno-ds213-dsm42.mk
    	    

Tool/Library Versions in DSM 4.2 GPL Code

  • gcc: 4.3.2
  • binutils: 2.18.50 (fixme: only 2.18 and 2.18a officially exist)
  • glibc: 2.8
  • Kernel: 2.6.32.12
  • libusb: 0.1.12

Caveats

  • openldap: seems that something with the libtool is broken. After compilation, builds/openldap/libraries/libldap/.libs/libldap-2.3.so.0.2.31T (with the "T" at the end) exists which triggers some relink by libtool in case some other package depends on openldap. In my case, removing this file solves the problem.
  • binutils: configure with --disable-werror, needs upgrade to 2.18 to match DSM 4.2 / gcc 4.3.2
  • gcc: add libmpfr, compile with -j1, additional patches (documentation, etc.)
  • openssl: -j1
  • libusb: The Synology GPL Source Code for the 3201 branch (my DSM 4.2 kernel is labeled 3202) indicates libusb version 0.1.12. With this version natively compiled, the saned ist now working properly with the Optware libusb!
  • perl: I had to do the following preparations:
    • download perl source code (e.g. perl-5.16.3)
    • unpack + run configure on my nas
      ./Configure  -Dcc=gcc -Dprefix=/opt -Duseshrplib -Dd_dlopen -de
    • copy config.sh from this test directory to source/perl/5.16/config.sh-syno-ds213-dsm42, replace lns variable by the general system ln command.
    • ...many further patches, see patch set below

Current State

My current patch set can be found at:

optware-patches-ds213+-dsm4.2.tar.gz

Dedicated Working Packages

  • gcc 4.3.2 / binutils / ...
  • libusb
  • perl 5.16.3
  • sane-backends
  • most recent x11 client libraries
  • most recent libpango, libcairo, fontconfig, freetype, ...
  • most recent rrdtool
Further packages I use work well, but are not listed here since my focus was on perl so far... next steps will consider munin / apache.
Ernst Martin Witte
Letzte Änderung: 31.10.2016 14:27