{"id":314,"date":"2008-04-14T13:34:11","date_gmt":"2008-04-14T12:34:11","guid":{"rendered":"http:\/\/www.spikesoft.ch\/?p=314"},"modified":"2011-05-25T09:55:37","modified_gmt":"2011-05-25T08:55:37","slug":"svn-on-nslu2","status":"publish","type":"post","link":"https:\/\/www.spikesoft.ch\/?p=314","title":{"rendered":"SVN on NSLU2"},"content":{"rendered":"<p><strong>Goals<\/strong><\/p>\n<ul>\n<li>Have a central repository at home that manage the code I produce<\/li>\n<li>Use material that I allready had or that is inexpensive<\/li>\n<li>Consume minimal power<\/li>\n<\/ul>\n<p><strong>Hardware<\/strong><\/p>\n<ul>\n<li>A <a href=\"http:\/\/www.linksys.com\/servlet\/Satellite?c=L_Product_C2&amp;childpagename=US%2FLayout&amp;cid=1115416906769&amp;pagename=Linksys%2FCommon%2FVisitorWrapper\" target=\"_blank\">Cisco NSLU2<\/a> (in my case overclocked to 266Mhz but that&#8217;s not necessary)<\/li>\n<li>A <a href=\"http:\/\/www.kingston.com\/flash\/datatraveler.asp\" target=\"_blank\">Kingston 4Gb USB2 DataTraveler<\/a> flash key plugged into the port 2 of the NSLU2 (mandatory according to the documentation)<\/li>\n<\/ul>\n<p><strong>Disclaimer<\/strong><\/p>\n<p><span style=\"color: #ff0000;\">As always if something goes wrong and you destroy your hardware or lose some data, I cannot be held responsible.<\/span> This said it worked for me \ud83d\ude09<\/p>\n<p><strong>Prerequisite<\/strong><\/p>\n<p>Your NSLU2 is correctly configured for your network. That is in the Web Interface under Tab <em>Administration<\/em>, sub-tab <em>LAN<\/em>, the <em>IP address<\/em>, <em>network mask<\/em>, <em>gateway<\/em> and <em>primary DNS server<\/em> fields are set.<\/p>\n<p><strong>Step-by-step guide<\/strong><\/p>\n<p>Installing the modified firmware:<\/p>\n<ol>\n<li>Download the latest <a href=\"http:\/\/www.slug-firmware.net\/u-dls.php\" target=\"_blank\">Unslung firmware <\/a>(currently 6.10 Beta)<\/li>\n<li>Install UpSlug2 on your Mac. If you don&#8217;t know how to install UpSlug2, on Mac follow the directions given <a href=\"http:\/\/www.nslu2-linux.org\/wiki\/Main\/UpSlug2onOSX\" target=\"_blank\">here<\/a><\/li>\n<li>You can find the UpSlug2 under the following path <code>\/usr\/local\/sbin<\/code><\/li>\n<li>Shutdown the NSLU2<\/li>\n<li>Press and hold the reset button and at the same time press the power buton<\/li>\n<li>At the moment when the Ready\/Status LED turn solid red, release the reset button<\/li>\n<li>You know that the NSLU2 is in upgrade mode when the Ready\/Status LED in blinking red and green<\/li>\n<li>If you have more that one network interface (for example one ethernet and one wifi), you have to determine the one you use to connect to your NSLU2 (use <code>ifconfig<\/code> to see which interface get the ip address from your DHCP server for example)<\/li>\n<li>\n<pre>sudo .\/upslug2 --device en0<\/pre>\n<p>You should see your NSLU2 listed. (As mentionned in point 8 the <code>--device<\/code> is only needed to specify your network interface)<\/li>\n<li>Flash the NSLU2 with the Unslung firmware\n<pre>sudo .\/upslug2 --device en0\r\n--image=\"\/&lt;path_to_the_firmware&gt;\/Unslung-6.10-beta.bin<\/pre>\n<\/li>\n<\/ol>\n<p>Installing the necessary packages on the NSLU2:<\/p>\n<ol>\n<li>In the Web interface under tab <em>Administration<\/em>, sub-tab <em>Disk<\/em> (accessed by cliking on the <em>Advanced<\/em> sub-tab), format the USB2 flash key by cliking on the button <em>Format Disk 2<\/em><\/li>\n<li> You know have to move the data from the internal flash to your USB flash key. This operation is called unslinging. In the Web interface under Tab <em>Home<\/em>, sub-tab <em>Manage Telnet<\/em>, click the button <em>Enable Telnet<\/em><\/li>\n<li>Telnet your NSLU2 with the login &#8220;root&#8221; and password &#8220;uNSLUng&#8221;<\/li>\n<li> Enter\n<pre>unsling disk2<\/pre>\n<p>and give a new password for the root account<\/li>\n<li>Reboot and reactivate telnet as described at point 2<\/li>\n<li>Telnet the NSLU2 and perform the\n<pre>ipkg update<\/pre>\n<\/li>\n<li>Install openssh so you don&#8217;t have to use telnet anymore\n<pre>ipkg install openssh<\/pre>\n<\/li>\n<li>Logout and login with ssh. Now you don&#8217;t have to enable telnet anymore. From now on we&#8217;ll use ssh that is more secure<\/li>\n<li>In the Web interface under tab <em>Administration<\/em> and sub-tab <em>Users<\/em> create a new user that is named &#8220;svn&#8221;. Be sure that you have checked the <em>Create Private Folder (Share) <\/em>check box<\/li>\n<li>Back to the ssh session install svn\n<pre>ipkg install svn<\/pre>\n<\/li>\n<li> If you&#8217;re lazy like me and don&#8217;t know how to use vi then install nano\n<pre>ipkg install nano<\/pre>\n<\/li>\n<\/ol>\n<p>Configure SVN:<\/p>\n<ol>\n<li>Create the <code>\/svn\/repositories<\/code> directory with\n<pre>mkdir \/svn\/diretories<\/pre>\n<\/li>\n<li>Prepare the svn repository for your project\n<pre>svnadmin create \/svn\/repositories\/&lt;projet_name&gt;<\/pre>\n<\/li>\n<li>(<span style=\"color: #339966;\">OPTIONAL<\/span>) If you want to migrate a previous svn repository, then copy via the svn share the dump that you produce with\n<pre>svnadmin dump &lt;repos_path&gt; &gt; project.dump<\/pre>\n<p>(on the old svn instance). In the NSLU2 perform a<\/p>\n<pre>svnadmin load \/svn\/repositories\/&lt;project_name&gt; &lt; project.dump<\/pre>\n<p>You can now delete the <code>project.dump<\/code> file.<\/li>\n<li>Edit the <code>\/svn\/repositories\/&lt;project_name&gt;\/conf\/svnserve.conf<\/code> such that the following lines appears\n<pre>anon-access = none    #no anonymous can login\r\nauth-access = write   #authenticated user are allowed to write\r\npassword-db = passwd  #use the passwd file for authentication<\/pre>\n<\/li>\n<li>Modify the <code>\/svn\/repositories\/&lt;project_name&gt;\/conf\/passwd<\/code> file according to the example provided in the file<\/li>\n<li>Create a diversion script to start the <code>svnserve<\/code> deamon. We will make a <code>\/etc\/rc.d\/rc.svn<\/code> diversion&#8217;s script with the following content\n<pre>#!\/bin\/sh\r\n\r\n\/opt\/bin\/svnserve -d\r\n\r\necho `date '+%Y\/%m\/%d %k:%m:%S'` \" : svnserve start\" &gt;&gt; \/var\/log\/svnserve.log\r\n<\/pre>\n<\/li>\n<li>Correct the script&#8217;s premission with\n<pre>chmod ugo+rx rc.svn<\/pre>\n<\/li>\n<li>Add the svnserve to your startup sequence. In order to do so add the following line\n<pre>\/bin\/echo  \"Starting svn server:\"; ( . \/etc\/rc.d\/rc.svn )\r\n<\/pre>\n<p>to your <code>rc.1<\/code> diversion&#8217;s script. You can put it almost anywhere in this diversion but I recommend put it near the end. In my case I have it after the start of the <code>rc.bootdisk<\/code>&#8216;s diversion.<\/li>\n<li>Reboot the NSLU2 to see if your <code>rc.svn<\/code> is taken into account<\/li>\n<li>The URL to connect to your svn server is something like <code>svn:\/\/&lt;user_name_from_passwd&gt;@&lt;server_address&gt;\/svn\\<\/code><br \/>\n<code>\/repositories\/&lt;projet_name&gt;<\/code><\/li>\n<\/ol>\n<p>Additional informations:<\/p>\n<ul>\n<li>You have access to the linux hierarchy via the shared element named <em>ADMIN 2<\/em>. If you use the standard admin\/admin password you can see the file there but cannot modify them.<\/li>\n<li>The public share is located at <code>\/share\/flash\/data\/public<\/code> and has a mount point in the unix hierarchy at <code>\/public<\/code>. The same apply to the svn share.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Goals Have a central repository at home that manage the code I produce Use material that I allready had or that is inexpensive Consume minimal power Hardware A Cisco NSLU2 (in my case overclocked to 266Mhz but that&#8217;s not necessary) &hellip; <a href=\"https:\/\/www.spikesoft.ch\/?p=314\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,9,5],"tags":[],"class_list":["post-314","post","type-post","status-publish","format-standard","hentry","category-macintosh","category-programmation","category-unix"],"_links":{"self":[{"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=\/wp\/v2\/posts\/314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=314"}],"version-history":[{"count":4,"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=\/wp\/v2\/posts\/314\/revisions"}],"predecessor-version":[{"id":608,"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=\/wp\/v2\/posts\/314\/revisions\/608"}],"wp:attachment":[{"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}