Mc

From WL-HDD Wiki

Jump to: navigation, search
WL-HDD Contents
What is the WL-HDD
Features
Pro's/con's
Reviews
Hacking
Inserting the HDD
Hacking Guides
Basic setup guides
Packages guides
Requests
Troubleshooting
This Wiki
Credits
Editing help
Contact Me

Contents

[edit] mc

Mc is an acronym for GNU Midnight Commander [1] - a free open source file manager for unix-like operating systems. this guide describes how to install and tune up mc to run with following features:

  • Ability to turn panels on/off;
  • Full support of funstional keys (F1-F12) and navigation keys (like Home-End);
  • Full mouse support.

[edit] Prerequisites

To complete this guide, the following is assumed:

You are running Oleg's firmware (1.9.2.7-6b or later)
You have harddisk partitions up and running with an extended filesystem mounted to /opt
You have installed the Ipkg package system.
You have configured your partitions to automount.
You have installed PuTTY telnet and ssh client

Tip: If you're new to PuTTY, see Configuring PuTTY below for confuguration tips.

[edit] Installing mc

First of all: Now (oct 2207) mc is only available from Oleg's repository, but since all packages in this repository are compiled with new version of uclibc-opt pckage, you should reinstall all installed packages from that repository, or they may be incompatible.

[edit] Switch to Oleg's repository

echo "src optware http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable" > /etc/ipkg.conf
echo "dest root /" >> /etc/ipkg.conf
echo "/etc/ipkg.conf" >> /usr/local/.files

[edit] Install uclibc-opt and reinstall all installed packages from Oleg's repository

ipkg update
ipkg install uclibc-opt 
awk '/^Package:/{system("ipkg install -force-reinstall -force-defaults " $2)}' /opt/lib/ipkg/status

[edit] Install mc

ipkg install mc

[edit] Setup .profile

First, we have to configure the router. To make mc run we need to setup some environment variables. The easiest way to do it is to create a .profile file in your home directory (usually /root). It should contain following lines:

export TERMINFO="/opt/share/terminfo"
export TERM="xterm"

You can do it with any text editor like nano OR just execute following:

cd $HOME
echo 'export TERMINFO="/opt/share/terminfo"' > .profile
echo 'export TERM="xterm"' >> .profile

Note: if you use windows telnet to access your router instead of PuTTY, then .profile should look like the following, or mc may look horrible or even hung up:

export TERMINFO="/opt/share/terminfo"
export TERM="linux"

But you'll loose many sweet PuTTY features like mouse, turning off panels etc.

After this close your PuTTY/telnet and login to router again for changes to take effect. Do not reboot router, because we didn't save changes yet.

[edit] Configuring PuTTY

[edit] Create new connection

Session->Host Name->192.168.1.1
Session->Protocol->Telnet (or SSH, if you've installed it)

Or. if you already have a saved connection, just click it and Push Load

[edit] Configure functional keys

Terminal->Keyboard->The Function Keys->Xterm R6

[edit] Save changes

Session->Saved Sessions-><name your session>->Save

[edit] Checking if it works

Now you can check if everything is ok. Double click saved session to open it. Login to router. Run mc by typing

mc

Press Ctrl-O to turn file panels on and off. Press F1 to see help. Use your mouse to select menu commands

[edit] Save it all

If everything is OK, we need to save changes to all of the above. ~/.profile and /etc/ipkg.conf is in the internal flash memory of the WL-HDD and will by default be lost on a reboot. To save to flash and keep your changes, enter the following.

flashfs save
flashfs commit
flashfs enable
Retrieved from "http://wlhdd.co.uk/wiki/Mc"
Personal tools