Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: howto: expanding corza's linux functionality (via telnet)

  1. #1
    Join Date
    Nov 2009
    Posts
    6

    Cool howto: expanding corza's linux functionality (via telnet)

    Ahoy,

    NOTE: This howto is for people who have already enabled telnet on their Corza device ( see http://www.patriotmem.com/forums/showthread.php?t=1977 )

    The Corza includes basic linux tools but almost none of the most useful (and standard) utilities that are needed for day-to-day usage via the shell. I've prepared a package of binaries that includes some of the most commonly used and useful utilities that can be installed without modification to any of the existing Corza system files.


    To install the linux pack first download: http://www.cubicvr.org/corza/corza_linux_ext.tgz (13.5M)

    Then upload this file to your Corza NAS unit under the public/ folder via FTP / Samba / etc.

    Once uploaded telnet to your Corza as usual, i.e:


    Code:
    macbook:~ ccliffe$ telnet corza-nas.local
    Trying 192.168.2.22...
    Connected to corza-nas.local.
    Escape character is '^]'.
    
    CORZA-NAS.gateway.2wire.net login: root
    Password: <your admin password>
    
    
    BusyBox v1.00-rc3 (2009.05.07-19:45+0000) Built-in shell (ash)
    Enter 'help' for a list of built-in commands.
    
    CORZA-NAS>

    Next change to your HD storage mount point:

    Code:
    CORZA-NAS> cd /mnt/md1/
    Then unpack the corza linux pack from there:

    Code:
    CORZA-NAS> tar -xvzf public/corza_linux_ext.tgz
    linux
    linux/usr
    linux/usr/bin
    linux/usr/bin/wget
    ...etc..
    
    CORZA-NAS>
    It will create a subfolder called linux/ on your hard-drive that will contain necessary binaries and libraries compiled for ARMV4L (Corza's processor).

    Once unpacked you can now initialize your linux environment -- please note that you should not run env_setup from the current directory (i.e. do NOT run ./env_setup.sh), please supply the full path in order for the script to properly initialize your environment.

    Code:
    CORZA-NAS> /mnt/md1/linux/env_setup.sh
    bash-3.00#

    If env_setup.sh worked correctly upon your next login bash will be launched automatically, however you should note that if you reboot your Corza device you will need to re-run the env_setup.sh. Most telnet clients provide the option to create a macro that can be run if you frequently need to reboot your corza device (if so read the next section and I may have a fix for you via telnet)


    At this point you will now be running bash and have many new commands available (hit tab and confirm if you want to see them all), most notable tools that are provided in this pack are:

    bash - Bourne again shell, most common linux shell most users will be comfortable with, has the added advantage of fixing the default terminal size restriction
    nano - vi and vim were too large to include, pico has licensing issues so nano is a great alternative
    wget - if it's on the web and you need to get it this is the tool to have ('curl' is also available for hardcore users)
    links - handy text-based web browser with cookies, javascript, downloading and more
    iptraf - real-time network traffic monitor
    ncftp - handy for downloading directly from ftp
    rsync - High performance industry standard tool for mirroring files
    svn - Subversion revision management tool (I'm working on getting it running as an SVN server as well)
    git - GIT revision management tool
    ssh - OpenSSH for making remote SSH connections
    scp - OpenSSH file copy tool
    lame - Included just for performance test fun, it's the standard open-source MP3 encoder for raw audio files.
    find - useful on it's own or in combination with grep for doing quick file queries in the shell, using 'ls -R' was getting to be a pain
    tailf - useful for watching log files, also available is the standard 'tail' command
    sqlite - sqlite database tools
    unzip - unarchiver for .ZIP files
    unarj - unarchiver for .ARJ files (sorry tried to find unpacker for .RAR but no luck, working on it!)
    diff - file comparison utility




    Fixing the torrentflux looping login screen / Accessing MySQL:

    Frequently on my Corza unit TorrentFlux will fail to login and just return me to the login screen. Nothing short of a reboot would solve this problem until I discovered in the log that it had simply run out of space for storing temporary session files.

    This won't always resolve the issue, sometimes I still need a reboot -- either way if you're just interested in accessing the system's MySQL installation you will find it helpful as well:


    Fix #1) MySQL BinLogs - TorrentFlux uses MySQL and apparently MySQL is using binlogs to record history, I found upwards of 30mb of historical MySQL data since the initial configuration of my Corza unit, the best way to clear this information is to use MySQL's standard commands.

    First open a new MySQL session: (yes the MySQL root password really is 123456)

    Code:
    CORZA-NAS> mysql -u root -p
    Enter password: 123456
    
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 846 to server version: 4.1.22-log
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql> PURGE MASTER LOGS BEFORE CURRENT_DATE;
    Query OK, 0 rows affected (0.10 sec)
    
    mysql> quit
    Bye
    bash-3.00#

    Fix #2) syslogd - The syslog daemon appears to lock some file handles and take up more space than it should (log files being deleted instead of properly rotated and managed?)

    To restart syslogd run the following command:

    Code:
    CORZA-NAS> /etc/rc.d/S12syslog.sh restart
    stop syslogd
    start syslogd
    CORZA-NAS>
    One of those two if not both should allow you to proceed to login to TorrentFlux, I am experimenting with adding them to a cron task and including it in the env_setup.sh script but am not confident to send out that particular piece at the moment.


    Please enjoy the pack and let me know if you have questions or suggestions.


    ---
    Charles J. Cliffe, CubicVR 3D Engine: http://www.cubicvr.org/
    Last edited by cjcliffe; 12-01-2009 at 07:50 AM.

  2. #2
    Join Date
    Dec 2009
    Posts
    2

    Default

    Thanks for the additional utilities! What cross-compiler toolchain did you use to build these?

  3. #3
    Join Date
    Nov 2009
    Posts
    6

    Default

    Tried using the toolchain at first but while searching I found an easier option (although I am still tinkering with getting gcc running on the Corza unit itself). I was able to obtain the individual packages and dependencies from one of my favorite linux distributions: Gentoo.

    You can find the same files as I did by doing a google search for: "armv4l linux gentoo packages"

    Cheers,
    -CJ

  4. #4
    Join Date
    Dec 2009
    Posts
    4

    Default

    Hi, I'm getting this error:

    Code:
    CORZA-NAS> tar -xvzf public/corza_linux_ext.tgz
    tar: Invalid gzip magic
    CORZA-NAS>

  5. #5
    Join Date
    Nov 2009
    Posts
    9

    Default

    try to download it again

    OK, I replace unit and I'm giving it another shot,

    well i found out that

    Link Up (0x796d) MII REG 10 = 0x3800
    1000M/Full

    it looks like it is 1 Gb interface, but speed remains the same with the new firmware, any comments from other posters?

  6. #6
    Join Date
    Nov 2009
    Posts
    9

    Default

    fantastic work, many thanx.

  7. #7
    Join Date
    Dec 2009
    Posts
    4

    Default

    Still not working... something is wrong with the file

  8. #8
    Join Date
    Oct 2009
    Posts
    1

    Default

    Quote Originally Posted by cjcliffe View Post
    Ahoy,

    NOTE: This howto is for people who have already enabled telnet on their Corza device ( see http://www.patriotmem.com/forums/showthread.php?t=1977 )

    The Corza includes basic linux tools but almost none of the most useful (and standard) utilities that are needed for day-to-day usage via the shell. I've prepared a package of binaries that includes some of the most commonly used and useful utilities that can be installed without modification to any of the existing Corza system files.


    To install the linux pack first download: http://www.cubicvr.org/corza/corza_linux_ext.tgz (13.5M)

    Then upload this file to your Corza NAS unit under the public/ folder via FTP / Samba / etc.

    Once uploaded telnet to your Corza as usual, i.e:


    Code:
    macbook:~ ccliffe$ telnet corza-nas.local
    Trying 192.168.2.22...
    Connected to corza-nas.local.
    Escape character is '^]'.
    
    CORZA-NAS.gateway.2wire.net login: root
    Password: <your admin password>
    
    
    BusyBox v1.00-rc3 (2009.05.07-19:45+0000) Built-in shell (ash)
    Enter 'help' for a list of built-in commands.
    
    CORZA-NAS>

    Next change to your HD storage mount point:

    Code:
    CORZA-NAS> cd /mnt/md1/
    Then unpack the corza linux pack from there:

    Code:
    CORZA-NAS> tar -xvzf public/corza_linux_ext.tgz
    linux
    linux/usr
    linux/usr/bin
    linux/usr/bin/wget
    ...etc..
    
    CORZA-NAS>
    It will create a subfolder called linux/ on your hard-drive that will contain necessary binaries and libraries compiled for ARMV4L (Corza's processor).

    Once unpacked you can now initialize your linux environment -- please note that you should not run env_setup from the current directory (i.e. do NOT run ./env_setup.sh), please supply the full path in order for the script to properly initialize your environment.

    Code:
    CORZA-NAS> /mnt/md1/linux/env_setup.sh
    bash-3.00#

    If env_setup.sh worked correctly upon your next login bash will be launched automatically, however you should note that if you reboot your Corza device you will need to re-run the env_setup.sh. Most telnet clients provide the option to create a macro that can be run if you frequently need to reboot your corza device (if so read the next section and I may have a fix for you via telnet)


    At this point you will now be running bash and have many new commands available (hit tab and confirm if you want to see them all), most notable tools that are provided in this pack are:

    bash - Bourne again shell, most common linux shell most users will be comfortable with, has the added advantage of fixing the default terminal size restriction
    nano - vi and vim were too large to include, pico has licensing issues so nano is a great alternative
    wget - if it's on the web and you need to get it this is the tool to have ('curl' is also available for hardcore users)
    links - handy text-based web browser with cookies, javascript, downloading and more
    iptraf - real-time network traffic monitor
    ncftp - handy for downloading directly from ftp
    rsync - High performance industry standard tool for mirroring files
    svn - Subversion revision management tool (I'm working on getting it running as an SVN server as well)
    git - GIT revision management tool
    ssh - OpenSSH for making remote SSH connections
    scp - OpenSSH file copy tool
    lame - Included just for performance test fun, it's the standard open-source MP3 encoder for raw audio files.
    find - useful on it's own or in combination with grep for doing quick file queries in the shell, using 'ls -R' was getting to be a pain
    tailf - useful for watching log files, also available is the standard 'tail' command
    sqlite - sqlite database tools
    unzip - unarchiver for .ZIP files
    unarj - unarchiver for .ARJ files (sorry tried to find unpacker for .RAR but no luck, working on it!)
    diff - file comparison utility




    Fixing the torrentflux looping login screen / Accessing MySQL:

    Frequently on my Corza unit TorrentFlux will fail to login and just return me to the login screen. Nothing short of a reboot would solve this problem until I discovered in the log that it had simply run out of space for storing temporary session files.

    This won't always resolve the issue, sometimes I still need a reboot -- either way if you're just interested in accessing the system's MySQL installation you will find it helpful as well:


    Fix #1) MySQL BinLogs - TorrentFlux uses MySQL and apparently MySQL is using binlogs to record history, I found upwards of 30mb of historical MySQL data since the initial configuration of my Corza unit, the best way to clear this information is to use MySQL's standard commands.

    First open a new MySQL session: (yes the MySQL root password really is 123456)

    Code:
    CORZA-NAS> mysql -u root -p
    Enter password: 123456
    
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 846 to server version: 4.1.22-log
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql> PURGE MASTER LOGS BEFORE CURRENT_DATE;
    Query OK, 0 rows affected (0.10 sec)
    
    mysql> quit
    Bye
    bash-3.00#

    Fix #2) syslogd - The syslog daemon appears to lock some file handles and take up more space than it should (log files being deleted instead of properly rotated and managed?)

    To restart syslogd run the following command:

    Code:
    CORZA-NAS> /etc/rc.d/S12syslog.sh restart
    stop syslogd
    start syslogd
    CORZA-NAS>
    One of those two if not both should allow you to proceed to login to TorrentFlux, I am experimenting with adding them to a cron task and including it in the env_setup.sh script but am not confident to send out that particular piece at the moment.


    Please enjoy the pack and let me know if you have questions or suggestions.


    ---
    Charles J. Cliffe, CubicVR 3D Engine: http://www.cubicvr.org/
    Hi
    Worked a treat with 2 minor alterations for my set up
    ie
    1) CORZA-NAS> cd /mnt/md1/ changed to CORZA-NAS> cd /mnt/ide1/ plus any other references to MD1 as I am not using raid.
    2) File downloaded to unpack was corza_linux_ext.tar hence command line changed to suit

    Thanks for all your work.

  9. #9
    Join Date
    Mar 2010
    Posts
    1

    Default

    sounda good to me
    Latest information on Prana Framework and I/O history Graph along with the Camtasia for Mac and Magellan 4040

  10. #10
    Join Date
    Mar 2010
    Posts
    17

    Default

    Thank you for the easy to follow instructions! Installing telnet and this package went without a hitch and you really should have been the one to write the Corza set up manual!

    I am not a linux user, just a end user who needed to set up his NAS for business & home use who appreciates having all the functionality enabled for when I do have time to learn more. Having everything loaded also means I can get those IT guys I bump into to give me usable tips for working with this NAS now that I have a shell that is similar to what they use on their servers every day. Thanks!

    EDIT: For those who may be in my shoes (familiar with ancient DOS... but not linux; this site has a great definition table of linux commands: http://ss64.com/bash/
    Last edited by lunghd; 03-12-2010 at 01:47 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
  •