{"id":40,"date":"2013-04-13T12:59:37","date_gmt":"2013-04-13T04:59:37","guid":{"rendered":"http:\/\/blog.boviner.com\/?p=40"},"modified":"2013-04-13T13:18:47","modified_gmt":"2013-04-13T05:18:47","slug":"setting-up-a-proper-linux-environment-on-synology-ds412","status":"publish","type":"post","link":"https:\/\/tongwing.woon.sg\/blog\/setting-up-a-proper-linux-environment-on-synology-ds412\/","title":{"rendered":"Setting up a proper Linux environment on Synology DS412+"},"content":{"rendered":"<p>We recently got a <a href=\"http:\/\/www.synology.com\/products\/product.php?product_name=DS412%2B&#038;lang=us\" target=\"_blank\">Synology DS412+<\/a> as an office NAS. First thing to do is to set up a proper Linux environment on the device.<\/p>\n<p>Gaining root on Synology NAS is easy &#8211; just log in as root with the same password as admin. However, most (all?) commands are mapped to <a href=\"http:\/\/www.busybox.net\/about.html\" target=\"_blank\">BusyBox<\/a>, which provides watered-down version of many *nix commands. Good thing is there&#8217;s an active modding community and it&#8217;s also sanctioned by Synology. A good place to start is <a href=\"http:\/\/forum.synology.com\/wiki\/index.php\/Overview_on_modifying_the_Synology_Server,_bootstrap,_ipkg_etc\" target=\"_blank\">here<\/a>.  <\/p>\n<p>First install the bootstrap<\/p>\n<pre>cd \/tmp\r\nwget http:\/\/ipkg.nslu2-linux.org\/feeds\/optware\/syno-i686\/cross\/unstable\/syno-i686-bootstrap_1.2-7_i686.xsh\r\nchmod u+x syno-i686-bootstrap_1.2-7_i686.xsh\r\n.\/syno-i686-bootstrap_1.2-7_i686.xsh<\/pre>\n<p>Then install optware-devel, which installs many of the common *nix tools and binaries for building programs from tar source.<\/p>\n<pre>\/opt\/bin\/ipkg install optware-devel\r\n<\/pre>\n<p>Unfortunately, installation fails halfway &#8216;cos wget-ssl which is included in optware-devel conflicts with the wget installed. <\/p>\n<pre># ipkg install -verbose_wget wget-ssl\r\nInstalling wget-ssl (1.12-2) to root...\r\nNothing to be done\r\nAn error ocurred, return value: 1.\r\nCollected errors:\r\nERROR: The following packages conflict with wget-ssl:\r\n         wget<\/pre>\n<p>Someone posted a solution <a href=\"http:\/\/blog.debruin.org\/post\/2012\/03\/19\/Minor-optware-flaw-with-optware-devel-package\" target=\"_blank\">here<\/a> and <a href=\"http:\/\/forum.synology.com\/enu\/viewtopic.php?f=40&#038;t=35322\" target=\"_blank\">here<\/a>, but both are for arm-based devices. Digging further, I found the source of the i686 packages <a href=\"http:\/\/ipkg.nslu2-linux.org\/feeds\/optware\/syno-i686\/cross\/unstable\/\" target=\"_blank\">here<\/a> and with that the problem is resolved.<\/p>\n<pre>cd \/tmp\r\nwget 'http:\/\/ipkg.nslu2-linux.org\/feeds\/optware\/syno-i686\/cross\/unstable\/libidn_1.25-1_i686.ipk'\r\nwget 'http:\/\/ipkg.nslu2-linux.org\/feeds\/optware\/syno-i686\/cross\/unstable\/wget-ssl_1.12-2_i686.ipk'\r\nipkg remove wget\r\nipkg install libidn_1.25-1_i686.ipk\r\nipkg install wget-ssl_1.12-2_i686.ipk\r\n\r\nexport PATH=\/opt\/bin:$PATH\r\nipkg update\r\nipkg install optware-devel\r\n<\/pre>\n<p>The export step is important, &#8216;cos it will make ipkg use the new wget.<\/p>\n<p>A few other things to finish up, <\/p>\n<ul>\n<li>ipkg install util-linux<\/li>\n<li>install bash, vim, screen<\/li>\n<li>change default root shell to \/opt\/bin\/bash, <\/li>\n<li>add \/opt\/bin to PATH in .profile, <\/li>\n<li>set PS1=&#8217;\\h:\\w\\$ &#8216;<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>We recently got a Synology DS412+ as an office NAS. First thing to do is to set up a proper Linux environment on the device. Gaining root on Synology NAS is easy &#8211; just log in as root with the same password as admin. However, most (all?) commands are mapped to BusyBox, which provides watered-down [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/posts\/40"}],"collection":[{"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/comments?post=40"}],"version-history":[{"count":21,"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/posts\/40\/revisions"}],"predecessor-version":[{"id":63,"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/posts\/40\/revisions\/63"}],"wp:attachment":[{"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/media?parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/categories?post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/tags?post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}