Synology packages

Given that the Synology NAS server runs a Linux distribution, I thought it would be cool to add some packages to it. Given what I had read, it sounded like an easy enough thing to do. I read the 3rd party developer’s guide. I’ve looked at the Source Forge site for the Synology NAS GPL Source. The DS411+ uses Intel Atom D510/Intelx86/LittleEndian/2.6.32 which needs gcc421_glibc236_x86.tgz. The DS411j uses Marvell 6281/ARM/LittleEndian/2.6.32 which needs gcc421_glibc25_88f628x.tgz. Piece of cake, right?

The first thing that I tried to do was to download the source to GNU’s screen program. I then tried compiling it on a different computer.

[root@hamzy2 tmp]# wget -O gcc420_glibc236_pineview.tgz ‘×86%20Linux%202.6.32/gcc420_glibc236_pineview.tgz?×86%2520Linux%25202.6.32%2F&ts=1303738007&use_mirror=cdnetworks-us-1’
[root@hamzy2 tmp]# tar zxpf gcc420_glibc236_pineview.tgz -C /usr/local/
[root@hamzy2 tmp]# /usr/local/i686-linux-gnu/bin/i686-linux-gnu-gcc sysinfo.c -o sysinfo
[root@hamzy2 tmp]# wget
[root@hamzy2 tmp]# tar xvf screen-4.0.3.tar.gz
[root@hamzy2 tmp]# cd screen-4.0.3
[root@hamzy2 screen-4.0.3]# env CC=/usr/local/i686-linux-gnu/bin/i686-linux-gnu-gcc LD=/usr/local/i686-linux-gnu/bin/i686-linux-gnu-ld RANLIB=/usr/local/i686-linux-gnu/bin/i686-linux-gnu-ranlib CFLAGS=”-I/usr/local/i686-linux-gnu/include” LDFLAGS=”-L/usr/local/i686-linux-gnu/lib” ./configure –host=i686-linux-gnu –target=i686-linux-gnu –build=i686-pc-linux –prefix=/usr/local
configure: error: in `/tmp/screen-4.0.3′:
configure: error: cannot run test program while cross compiling
See `config.log’ for more details.

Argh! I can’t run tests when cross compiling?! Sigh. A good product includes a suite of testcases that verifies if a program still works correctly. And I can’t run them on a different computer than what is being built. That seems flawed. You should be able to build completely and THEN run the testing testcases on the target computer to verify everything works.

My second attempt was to compile the GNU screen source code on the actual NAS machine itself. After all, it is a computer running Linux. Should be really easy with GNU’s autoconfiguration program.

Mark_Hamzy_II> cd /volume1/homes/admin
Mark_Hamzy_II> wget -O gcc420_glibc236_pineview.tgz ‘
Mark_Hamzy_II> tar zxpf gcc420_glibc236_pineview.tgz
Mark_Hamzy_II> wget
Mark_Hamzy_II> tar xvf screen-4.0.3.tar.gz
Mark_Hamzy_II> cd screen-4.0.3
Mark_Hamzy_II> env CC=../i686-linux-gnu/bin/i686-linux-gnu-gcc LD=../i686-linux-gnu/bin/i686-linux-gnu-ld RANLIB=../i686-linux-gnu/bin/i686-linux-gnu-ranlib CFLAGS=”-I../i686-linux-gnu/include” LDFLAGS=”-L../i686-linux-gnu/lib” ./configure –prefix=/usr/local
Floating point exception (core dumped)

WHAT? A floating point exception during autoconf?! I didn’t think a shell script did math…

But then I read about how Synology maintains a repository of packages here. And screen was included!

Mark_Hamzy_II> wget
Mark_Hamzy_II> sh syno-i686-bootstrap_1.2-7_i686.xsh
Mark_Hamzy_II> ipkg update
Mark_Hamzy_II> ipkg upgrade
Mark_Hamzy_II> ipkg install screen

Now that was really easy! Why didn’t I try that before?