Is your old account not working? Don't panic, please register again!

*New 11.4 series Release:
2020-05-29: XigmaNAS 11.4.0.4.8453 - released!

*New 12.2 series Release:
2021-05-31: XigmaNAS 12.2.0.4.8458- released!

We really need "Your" help on XigmaNAS Language https://translations.launchpad.net/xigmanas packages. Please help us today!

XigmaNAS talks on IRC https://web.libera.chat/#xigmanas, ircs://irc.libera.chat:6697 (TLS) or irc://irc.libera.chat:6667 (plain text)

[HOWTO] - MC on OLD FreeNAS

Only Admin's or Moderators can move thread's to this sub-forum.
Nobody should start a new thread on this sub-forum.
Anybody can reply to a thread on this sub-forum.
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
Hiji56
Advanced User
Advanced User
Posts: 170
Joined: Feb 13th, '21, 11:33
Status: Offline

[HOWTO] - MC on OLD FreeNAS

#1

Post by Hiji56 »

"
by ldkraemer»05 Jul 2012 18:37
Danmero:
Base on my understanding MC will not be implemented in FreeNAS.
* FreeNAS should be manage from WebGUI only.
* For CLI application you should know/find howto add/install.
Options:
* Use ""full"" platform and use pkg-add to install MC.
* For ""embedded"" platform take a look at: 847. A lightweight Midnight Commander clone on FreeNAS (plug-in)
Danmero first script - 32 Bit:
#!/bin/sh
# filename: mcommander.sh
# author: Dan Merschi
# date: 2008-01-10
# purpose: Install Midnight Commander Light on FreeNAS(embedded version).
# Note: Check the end of the page.
#
#----------------------- Set variables ------------------------------------------------------------------
DIR=`echo $0 | awk '{sub(""\/[^\/]*$"",""""); print $0}'`
URL=""""ftp://ftp.freebsd.org/pub/FreeBSD/ports ... stable/All"""";
FILE=""mc-light-4.1.40.p9_7.tbz"";
#----------------------- Set Error's --------------------------------------------------------------------
_msg() { case $ in
0) echo ""The script will exit now.""; exit 0 ;;
1) echo ""No route to server, or file do not exist on server""; _msg 0 ;;
2) echo ""Can't find ${FILE} on ${DIR}""; _msg 0 ;;
3) echo ""MC Light installed and ready! (ONLY USE DURING A SSH SESSION)""; exit 0 ;;
4) echo ""Always run this script using the full path: /mnt/.../directory/mcommander.sh""; _msg 0 ;;
esac ; exit 0; }
#----------------------- Check for full path ------------------------------------------------------------
if [ ! `echo $0 |cut -c1-5` = ""/mnt/"" ]; then _msg 4 ; fi
cd $DIR;
#----------------------- Download and decompress files if don't exist -----------------------------------
if [ ! -d ${DIR}/bin ]; then
if [ ! -e ${DIR}/${FILE} ]; then fetch ${URL}/${FILE} || _msg 1; fi
if [ -f ${DIR}/${FILE} ] ; then tar xzf ${DIR}/${FILE} || _msg 2; rm ${DIR}/+* ; rm -R ${DIR}/man ; fi
if [ ! -d ${DIR}/bin ] ; then _msg 4 ; fi
fi
#----------------------- If don't exist, creat root directory and root files ----------------------------
if [ ! -d ${DIR}/root ]; then mkdir $DIR/root && cd $DIR/root && touch edit.pos history hotlist ini; fi
#----------------------- Create symlinks ----------------------------------------------------------------
if [ ! -e /usr/local/share/mc ]; then ln -s ${DIR}/share/mc /usr/local/share; fi
if [ ! -d /root/.mc/cedit ]; then mkdir -p /root/.mc/cedit; fi
for i in `ls $DIR/bin/`
do if [ ! -f /usr/bin/${i} ]; then ln -s ${DIR}/bin/$i /usr/bin ; fi; done
for i in `ls $DIR/share/mc/syntax/`
do if [ ! -e /root/.mc/cedit/${i} ]; then ln -s $DIR/share/mc/syntax/${i} /root/.mc/cedit/; fi; done
for i in `ls $DIR/root`
do if [ ! -f /root/.mc/${i} ]; then ln -s $DIR/root/$i /root/.mc/ ; fi; done
_msg 3 ; exit 0;
#----------------------- End of Script ------------------------------------------------------------------
# 1. Keep this script in his own directory.
# 2. chmod the script u+x,
# 3. Always run this script using the full path: /mnt/share/directory/mcommander/bin/mc
# 4. You can add this script to WebGUI: Advanced: Commands as Post command (see 3).
# 5. To run Midnight Commander Light from shell type 'mc'.
Danmero - updated script:
The updated script should work on both FreeNAS 6.9.x & 0.7.x (FreeBSD 6.x and 7.x) and both i386 & AMD64 platform.
Code: Select all

Code: Select all

#!/bin/sh
# filename:     mcommander.sh
# author:       Dan Merschi
# date:         2009--07-28 ; Add multiplatform support
# purpose:      Install Midnight Commander Light on FreeNAS(embedded version).
# Note:         Check the end of the page.
#
#----------------------- Set variables ------------------------------------------------------------------
DIR=`dirname $0`;
PLATFORM=`uname -m`
RELEASE=`uname -r | cut -d- -f1`
URL=""ftp://ftp.freebsd.org/pub/FreeBSD/releases/${PLATFORM}/${RELEASE}-RELEASE/packages/All""
FILE=""mc-light-4.1.40.p9_7.tbz"";
#----------------------- Set Error's --------------------------------------------------------------------
_msg() { case $ in
  0) echo ""The script will exit now.""; exit 0 ;;
  1) echo ""No route to server, or file do not exist on server""; _msg 0 ;;
  2) echo ""Can't find ${FILE} on ${DIR}""; _msg 0 ;;
  3) echo ""MC Light       installed and ready! (ONLY USE DURING A SSH SESSION)""; exit 0 ;;
  4) echo ""Always run this script using the full path: /mnt/.../directory/mcommander.sh""; _msg 0 ;;
esac ; exit 0; }
#----------------------- Check for full path ------------------------------------------------------------
if [ ! `echo $0 |cut -c1-5` = ""/mnt/"" ]; then _msg 4 ; fi
cd $DIR;
#----------------------- Download and decompress files if don't exist -----------------------------------
if [ ! -d ${DIR}/bin ]; then
  if [ ! -e ${DIR}/${FILE} ]; then fetch ${URL}/${FILE} || _msg 1; fi
  if [ -f ${DIR}/${FILE} ]  ; then tar xzf ${DIR}/${FILE} || _msg 2; rm ${DIR}/+* ; rm -R ${DIR}/man ; fi
  if [ ! -d ${DIR}/bin ] ; then _msg 4 ; fi
fi
#----------------------- If don't exist, creat root directory and root files ----------------------------
  if [ ! -d ${DIR}/root ]; then mkdir $DIR/root && cd $DIR/root && touch edit.pos history hotlist ini; fi
#----------------------- Create symlinks ----------------------------------------------------------------
  if [ ! -e /usr/local/share/mc ]; then ln -s ${DIR}/share/mc /usr/local/share; fi
  if [ ! -d /root/.mc/cedit ]; then mkdir -p /root/.mc/cedit; fi
for i in `ls $DIR/bin/`
   do if [ ! -f /usr/bin/${i} ]; then ln -s ${DIR}/bin/$i /usr/bin ; fi; done
for i in `ls $DIR/share/mc/syntax/`
   do if [ ! -e /root/.mc/cedit/${i} ]; then ln -s $DIR/share/mc/syntax/${i} /root/.mc/cedit/; fi; done
for i in `ls $DIR/root`
   do if [ ! -f  /root/.mc/${i} ]; then ln -s $DIR/root/$i /root/.mc/ ; fi; done
_msg 3 ; exit 0;
#----------------------- End of Script ------------------------------------------------------------------
# 1. Keep this script in his own directory.
# 2. chmod the script u+x,
# 3. Always run this script using the full path: /mnt/share/directory/mcommander/bin/mc
# 4. You can add this script to WebGUI: Advanced: Commands as Post command (see 3).
# 5. To run Midnight Commander Light from shell type 'mc'.
""http://forums.nas4free.org/viewtopic.php?f=70&t=187"" target=""_blank"" rel=""noreferrer"" title=""Opens in new window"" class=""elonw"">Updated mc Script for NAS4Free by ginggs
Will mc now work ""forever"" or just until the next reboot?
Until next reboot, Just run the script... which means you can put it to postinit.
Old Package location:
64 Bit: ""ftp://ftp.freebsd.org/pub/FreeBSD/relea ... 0.p9_7.tbz""
Updated Package Location Version 9.0:
32 Bit: ""ftp://ftp.freebsd.org/pub/FreeBSD/relea ... ckages/All""
64 Bit: ""ftp://ftp.freebsd.org/pub/FreeBSD/relea ... ckages/All""
FileName:
mc-light-4.1.40.p9_8.tbz
Execution Path = /mnt/store/.apps/mcommander/bin/mc
ALL Credit goes to Danmero & ginggs for scripts that work with NAS4Free!
Copied to NAS4Free 07-05-2012 - Larry
Updated 07-12-2012 after testing NAS4Free-x86-embedded-9.0.0.1.141.img - Embedded
Last edited by ldkraemer on 15 Jul 2012 00:42, edited 10 times in total.
"
"
by ldkraemer»05 Jul 2012 18:43
Getting an error message of:
Code: Select all

Code: Select all

    /libexec/ld-elf.so.1: Shared object ""libcrypt.so.5"" not found, required by ""mc""
can be corrected by searching for the latest libcrypt.so.* and creating a symbolic link to it.
Code: Select all

Code: Select all

    cd /
    find lib*
    cd /lib
    ls -alt
    ln -s /path/to/real/file /path/to/non-existant/file
For NAS4Free-x86-embedded-9.0.0.1.141.img - EMBEDDED I needed two symbolic links that would survive a re-boot:
Code: Select all

Code: Select all

cd lib
ln -s libcrypt.so.5 libcrypt.so.4
ln -s libncurses.so.8 libncurses.so7
REF:
""https://www.xigmanas.com/oldforums/view ... &t=212""
for downloading the file p910nd-NAS4Free.zip with the information for the symbolic links already created.
Then to execute the software, use the full path to mc from root ( / ), logged in as root.
Code: Select all

Code: Select all

    /mnt/mysata/apps/mcommander/bin/mc
NOTES - for updating mc when a new version is released:
To update mc on FreeNAS system:
1. Login with ssh
2. su root
3. cd /mnt/mysata/apps/mcommander
4. rm -r share
5. rm -r bin
6. rm -r root
7. Make sure the updated file is saved in /mnt/mysata/apps/mcommander
8. run from / the script: /mnt/mysata/apps/mcommander/mcommander.sh
Execute mc (as root) with (/path/to/apps/mcommander/bin/mc):
Code: Select all

Code: Select all

/mnt/mysata/apps/mcommander/bin/mc
Copied to NAS4Free 07-05-2012 - by Larry
"
Post Reply