{"id":1533,"date":"2011-04-25T21:22:57","date_gmt":"2011-04-25T21:22:57","guid":{"rendered":"http:\/\/www.hamzy.net\/blog2\/?p=1533"},"modified":"2011-04-25T21:22:57","modified_gmt":"2011-04-25T21:22:57","slug":"synology_packages","status":"publish","type":"post","link":"http:\/\/www.hamzy.net\/blog2\/?p=1533","title":{"rendered":"Synology packages"},"content":{"rendered":"<p>\nGiven 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 <a href=\"http:\/\/download.synology.com\/download\/ds\/userguide\/Synology%20NAS%20Server%203rd-Party%20Apps%20Integration%20Guide.pdf\">3rd party developer&#8217;s guide<\/a>.  I&#8217;ve looked at the Source Forge site for the <a href=\"http:\/\/sourceforge.net\/projects\/dsgpl\/files\/\">Synology NAS GPL Source<\/a>.   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?\n<\/p>\n<p>\nThe first thing that I tried to do was to download the source to GNU&#8217;s screen program.  I then tried compiling it on a different computer.\n<\/p>\n<blockquote>\n<p>\n[root@hamzy2 tmp]# wget -O gcc420_glibc236_pineview.tgz &#8216;http:\/\/downloads.sourceforge.net\/project\/dsgpl\/DSM%203.1%20Tool%20Chains\/Intel%20&#215;86%20Linux%202.6.32\/gcc420_glibc236_pineview.tgz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fdsgpl%2Ffiles%2FDSM%25203.1%2520Tool%2520Chains%2FIntel%2520&#215;86%2520Linux%25202.6.32%2F&amp;ts=1303738007&amp;use_mirror=cdnetworks-us-1&#8217;<br \/>\n[root@hamzy2 tmp]# tar zxpf gcc420_glibc236_pineview.tgz -C \/usr\/local\/<br \/>\n[root@hamzy2 tmp]# \/usr\/local\/i686-linux-gnu\/bin\/i686-linux-gnu-gcc sysinfo.c -o sysinfo<br \/>\n[root@hamzy2 tmp]# wget http:\/\/ftp.gnu.org\/gnu\/screen\/screen-4.0.3.tar.gz<br \/>\n[root@hamzy2 tmp]# tar xvf screen-4.0.3.tar.gz<br \/>\n[root@hamzy2 tmp]# cd screen-4.0.3<br \/>\n[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=&#8221;-I\/usr\/local\/i686-linux-gnu\/include&#8221; LDFLAGS=&#8221;-L\/usr\/local\/i686-linux-gnu\/lib&#8221; .\/configure &#8211;host=i686-linux-gnu &#8211;target=i686-linux-gnu &#8211;build=i686-pc-linux &#8211;prefix=\/usr\/local<br \/>\nconfigure: error: in `\/tmp\/screen-4.0.3&#8242;:<br \/>\nconfigure: error: cannot run test program while cross compiling<br \/>\nSee `config.log&#8217; for more details.\n<\/p>\n<\/blockquote>\n<p>\nArgh!  I can&#8217;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&#8217;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.\n<\/p>\n<p>\nMy 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&#8217;s autoconfiguration program.\n<\/p>\n<blockquote>\n<p>\nMark_Hamzy_II> cd \/volume1\/homes\/admin<br \/>\nMark_Hamzy_II> wget -O gcc420_glibc236_pineview.tgz &#8216;http:\/\/downloads.sourceforge.net\/project\/dsgpl\/DSM%203.1%20Tool%20Chains\/Intel%<br \/>\n20&#215;86%20Linux%202.6.32\/gcc420_glibc236_pineview.tgz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fdsgpl%2Ffiles%2FDSM%25203.1%2520Tool<br \/>\n%2520Chains%2FIntel%2520&#215;86%2520Linux%25202.6.32%2F&amp;ts=1303738007&amp;use_mirror=cdnetworks-us-1&#8242;<br \/>\nMark_Hamzy_II> tar zxpf gcc420_glibc236_pineview.tgz<br \/>\nMark_Hamzy_II> wget http:\/\/ftp.gnu.org\/gnu\/screen\/screen-4.0.3.tar.gz<br \/>\nMark_Hamzy_II> tar xvf screen-4.0.3.tar.gz<br \/>\nMark_Hamzy_II> cd screen-4.0.3<br \/>\nMark_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=&#8221;-I..\/i686-linux-gnu\/include&#8221; LDFLAGS=&#8221;-L..\/i686-linux-gnu\/lib&#8221; .\/configure &#8211;prefix=\/usr\/local<br \/>\nFloating point exception (core dumped)\n<\/p>\n<\/blockquote>\n<p>\nWHAT? A floating point exception during autoconf?!  I didn&#8217;t think a shell script did math&#8230;\n<\/p>\n<p>\nBut then I read about how Synology maintains a repository of packages <a href=\"http:\/\/forum.synology.com\/wiki\/index.php\/Overview_on_modifying_the_Synology_Server,_bootstrap,_ipkg_etc\">here<\/a>.  And screen was included!\n<\/p>\n<blockquote>\n<p>\nMark_Hamzy_II> wget http:\/\/ipkg.nslu2-linux.org\/feeds\/optware\/syno-i686\/cross\/unstable\/syno-i686-bootstrap_1.2-7_i686.xsh<br \/>\nMark_Hamzy_II> sh syno-i686-bootstrap_1.2-7_i686.xsh<br \/>\nMark_Hamzy_II> ipkg update<br \/>\nMark_Hamzy_II> ipkg upgrade<br \/>\nMark_Hamzy_II> ipkg install screen\n<\/p>\n<\/blockquote>\n<p>\nNow that was really easy!  Why didn&#8217;t I try that before?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;s guide. I&#8217;ve looked at the Source Forge site for the Synology NAS GPL [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1533","post","type-post","status-publish","format-standard","hentry","category-complaints"],"_links":{"self":[{"href":"http:\/\/www.hamzy.net\/blog2\/index.php?rest_route=\/wp\/v2\/posts\/1533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.hamzy.net\/blog2\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hamzy.net\/blog2\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hamzy.net\/blog2\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hamzy.net\/blog2\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1533"}],"version-history":[{"count":0,"href":"http:\/\/www.hamzy.net\/blog2\/index.php?rest_route=\/wp\/v2\/posts\/1533\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.hamzy.net\/blog2\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hamzy.net\/blog2\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1533"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hamzy.net\/blog2\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}