Results 1 to 1 of 1

Thread: CVS Server running on a Javelin S4 box

  1. #1
    Join Date
    Jul 2011
    Posts
    8

    Default CVS Server running in a Javelin S4 box

    I needed a CVS repository for my coding, and wished it running in a small server that would not be a burden even on 24/7 instead of running on my bulky Linux machine, and my wish came true finally. I got a Patriot Javelin S4 NAS box at $170 after rebate from Fry's and had a chance to look into its internals with the help from the posts by BadIntensions and ruben00.


    After trying their suggestions, I was in confidence that the CVS server can run on the S4 and I could have a repository on the NAS box itself. I verified that the ipkg repository having the CVS package. I could register the CVS pserver to the inetd at the start up using the Optware infrastructure that ruben00 made. I could make the CVS server running in my Javelin S4 NAS box and it took about 28 minutes to import the 330M bytes stock 2.6 Linux kernel tree and about 5 minutes to check it out using my CentOS 5 Linux PC with Intel Core2 Duo CPU. Not bad!

    Code:
    [sksprp@pogo ~/tmp/linux-2.6.27]$ du -s .
    330588  .
    [sksprp@pogo ~/tmp/linux-2.6.27]$ time cvs -d :pserver:sksprp@192.168.1.10:/opt/cvsrepo -q import -I! -m "linux kernel 2.6.27" sandbox/linux-2.6 BV_gnu TV_linux_2-6-27
    ...
    No conflicts created by this import
    
    real    27m45.007s
    user    0m0.350s
    sys     0m1.398s
    [sksprp@pogo ~/tmp/linux-2.6.27]$ cd ..
    [sksprp@pogo ~/tmp]$ time cvs -d :pserver:sksprp@192.168.1.10:/opt/cvsrepo -q co -d kernel sandbox/linux-2.6
    ...
    
    real    5m12.195s
    user    0m5.333s
    sys     0m9.480s
    [sksprp@pogo ~/tmp]$
    Here, I'll try my best to list down what I have done to make it happen. But, before I start I have to say, as it is common to all community supported stuffs, I have no responsibility at all on what you may cause while you try this. It is all yours, good or bad. You've warned! And, good luck!

    1. I assume that you have a freshly purchased Javelin S4 NAS box. While I was looking inside, I have noticed the /data/ directory is the only writable non-volatile internal storage, and it contains backup of some configuration files. I didn't try myself, but I guessed since there is no factory default reset function provided, I could wipe out setups by creating an empty file /data/etc/abnormal or just removing the /data/etc/ directory then reboot the box. It would regenerate the /data/ directory with default values. If someone would try this, then let us know the result.
    2. Create groups using the web interface. I used to create users and boxes groups. All human user accounts will belong to the users group, and all machinery accounts such as your media player will belong to the boxes group.
    3. Create user accounts and assign them to the users group. Later I'll assign the users group to the CVS repository, so only one belongs to the users group can use the CVS service if you follow this instruction.
    4. Install BadIntensions' Rooter plugin. Download the rooter.zip to your PC and unzip it. You will get the file rooter.ppg. Follow the manual to install the plugin.
    5. Install ruben00's Optware plugin. (if the link doesn't work then follow the link in the ruben00's Optware on the Javelin S4? Possible? Yes it is!! post) Download the Optware.zip to your PC and unzip it. You will get the file Optware.ppg. Follow the manual to install the plugin.
    6. And, reboot the box to make the rooter and Optware plugins effective.
    7. Telnet to the box using the port number 2380 with the user name root without the password as described in the BadIntensions' thread. Later, if you log in to the S4 with your own account, you can use the sudo su - command to be the super user.
    8. First, modify the Rooter, so you can login to the S4 without using the root account following the next boot. Replace the file /APP/Rooter/bin/rooter_rootme with the following. Please make sure you know the pw of the admin or you have created your own user account using the web interface. In this example, I have my user account sksprp, so replace it with yours.
      Code:
      #!/usr/bin/perl
      
      $app_path = $ENV{'APP_PATH'};
      print "APP_PATH = $app_path\n";
      $action = $ARGV[0];
      
      #print "Rooter Rooting...\n";
      #system("/VOLUME1/PLUGINAPP/Rooter/bin/busybox passwd -d root");
      #print "Rooted...?";
      
      # modified to let admin can login
      system("/bin/echo 'admin' >> /etc/telnet.user");
      system("/bin/echo 'sksprp' >> /etc/telnet.user");
      system("/VOLUME1/PLUGINAPP/Rooter/bin/busybox chattr +i /etc/telnet.user");
      system("/bin/echo 'admin ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers");
      system("/bin/echo 'sksprp ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers");
      system("/VOLUME1/PLUGINAPP/Rooter/bin/busybox chattr +i /etc/sudoers");
    9. The wget utility to bring a file using the HTTP protocol was broken. To fix this, please execute mkdir -p /opt/tmp; mv /opt/lib/libpthread* /opt/tmp/; /promise/lib/ldconfig command chains. To verify the fix, just try the wget command. If you get its help message then you are good. If your network is using a proxy server then you may need to set the environment variable http_proxy or modify the /opt/etc/wgetrc file to make the wget utility working.
    10. Now you can install the dropbear ssh server/client package from the Optware web site using the ipkg utility. First execute the ipkg update command to get the package list. And then execute the ipkg install dropbear command to install the dropbear package. You can reboot the S4 box or execute the /opt/etc/init.d/S51dropbear script to start the service. Type ps ax | grep dropbear command to see if it is running. If you have reboot the box and logged in with your account, then please make sure to be the super user to continue this instruction with the sudo su - command.

    Up to this point is to refine what BadIntensions and ruben00 have done to get the ssh running in the box and setting the Optware environment. Following steps will set the CVS repository and the pserver.

    1. Install the CVS package by the ipkg install cvs command.
    2. Create the CVS repository using the mkdir -p /opt/tmp; mkdir -p /opt/cvsrepo; chown -R :users /opt/cvsrepo; chmod g+ws /opt/cvsrepo; cvs -d /opt/cvsrepo init command chains. The CVS will use the system accounts and its pw, so you can maintain CVS user accounts using the Javelin S4's user account web page. Any user belongs to the group users can use the CVS.
    3. Create the file /opt/etc/init.d/S61cvspserver as following to start the cvspserver inetd service at bootup.
      Code:
      #!/bin/sh
      
      CVSPSERVER_ENABLE="yes"
      [ -e /opt/etc/default/cvspserver ] && . /opt/etc/default/cvspserver
      
      if [ "$CVSPSERVER_ENABLE" = "no" ]; then
          exit
      fi
      
      echo "cvspserver 2401/tcp  #cvs pserver by /opt/etc/init.d/cvspserver" >> /etc/services
      echo "cvspserver 2401/udp  #cvs pserver by /opt/etc/init.d/cvspserver" >> /etc/services
      echo "cvspserver stream tcp nowait root /opt/bin/cvs cvs -T /opt/tmp -f --allow-root=/opt/cvsrepo pserver" >> /etc/inetd.conf
      pidof inetd >/dev/null && killall -HUP inetd 2>/dev/null
    4. Finally reboot the system to make all changes effective. To access the CVS repository or the pserver you just have created in your cute small Javelin S4 NAS box from your CVS client machine, you have to set the environment variable CVSROOT using the export CVSROOT="pserver:YourAccountName@YourS4HostnameOrI pAddr:/opt/cvsrepo" command, or put the line into your ~/.bashrc file.
    5. Enjoy the small foot print CVS Server in your NAS! Don't forget to login to the CVS using the cvs login command in your client side, and do happy coding!


    Let me know if you find a missing step or an information.


    Thanks a lot to BadIntensions, ruben00 and Optware team for their efforts!
    Last edited by sungwookk; 07-19-2012 at 07:06 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •