DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-05-18 22:04:55

abubin
Member
Registered: 2007-11-01
Posts: 59

changing default editor in fun_plug 0.5???

I just installed fun_plug 0.5 and configured ssh login.

I now want to change the default editor to use nano instead of vi.

Anyone can guide me as to how to install nano or any other packages not found in fonz's fun_plug packages folder?

Thanks in advance.

edit :

I have downloaded latest version of nano  - nano-2.0.7.tar.gz

From the nano website, it is said to compile nano, I need ncurses.

I downloaded and installed ncurses from fonz's funplug packages site. Installed it with "funpkg -i ncurses-5.6-4.tgz".

What's the next thing to do???

Last edited by abubin (2008-05-18 22:30:27)

Offline

 

#2 2008-05-19 11:33:43

abubin
Member
Registered: 2007-11-01
Posts: 59

Re: changing default editor in fun_plug 0.5???

I tried downloading gcc and other need packages from fonz's 0.5 site.

But when I do ./configure --prefix=/ffp/bin, I get these error :


checking for GNU gettext in libintl... no
checking how to run the C preprocessor... /lib/cpp
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.

Config.log :

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE_NAME "GNU nano"
#define PACKAGE_TARNAME "nano"
#define PACKAGE_VERSION "2.0.7"
#define PACKAGE_STRING "GNU nano 2.0.7"
#define PACKAGE_BUGREPORT "nano-devel@gnu.org"
#define PACKAGE "nano"
#define VERSION "2.0.7"
#define _GNU_SOURCE 1
#define _FILE_OFFSET_BITS 64
#define HAVE_ICONV 1
#define PKGDATADIR "/ffp/bin/share/nano"


Packages installed :

autoconf-2.61-2.tgz
make-3.81-3.tgz
binutils-2.18.50.0.1-4.tgz 
gawk-3.1.6-3.tgz           
gcc-4.1-2.tgz
ncurses-5.6-4.tgz
gettext-0.17-2.tgz
uclibc-0.9.29-3.tgz
libiconv-1.12-3.tgz

Seems to be missing c++. But AFAIK, gcc already includes c++, no???

Please help.....

Offline

 

#3 2008-05-19 22:48:38

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: changing default editor in fun_plug 0.5???

Code:

checking how to run the C preprocessor... /lib/cpp
configure: error: C preprocessor "/lib/cpp" fails sanity check

It says "preprocessor", not C++.

And it complains about /lib/cpp. If you had cared to check, you would have found out that /lib/cpp indeed does not exist, but /ffp/bin/cpp. I'm sure google would have told you to create a stupid link or to pass CPP=cpp to configure.

cd /lib
ln -s /ffp/bin/cpp

That's it.

Offline

 

#4 2008-05-24 18:39:45

jnor
New member
Registered: 2008-05-24
Posts: 2

Re: changing default editor in fun_plug 0.5???

Sorry but I still get:

Code:

checking how to run the C preprocessor... /lib/cpp
configure: error: C preprocessor "/lib/cpp" fails sanity check

also after I have sym linked cpp:

Code:

/mnt/HD_a2/ffp/pkg/build/nano-2.1.1 # ls -lah /lib/cpp
lrwxrwxrwx    1 root     root           12 May 24 13:26 /lib/cpp -> /ffp/bin/cpp

I'm sorry but I have little experience compiling Linux stuff.

Offline

 

#5 2008-05-25 21:24:09

langl3y
New member
Registered: 2008-05-25
Posts: 2

Re: changing default editor in fun_plug 0.5???

nano is available via ipkg
http://dns323.kood.org/howto:optware


root@dlink:~# ipkg list | grep nano
nano - 2.1.1-1 - A pico like editor
nanoblogger - 3.3-3 - A small weblog engine written in Bash for the command line


ipkg -install nano

Offline

 

#6 2008-07-04 02:17:06

infecticide
Member
Registered: 2008-06-26
Posts: 9

Re: changing default editor in fun_plug 0.5???

I didn't see instructions on how to set nano as the default editor.   I thought if you were to do the following:

$ set EDITOR=/ffp/bin/nano

it would work, but it doesn't.  I get this when I run crontab -e:

root@DNS-323:~# export EDITOR=/ffp/bin/nano
root@DNS-323:~# crontab -e
Received SIGHUP or SIGTERM
root@DNS-323:~#


EDIT:
So it would appear that this does indeed set nano as editor, but why is it giving this error?

Last edited by infecticide (2008-07-04 02:34:02)

Offline

 

#7 2008-07-05 01:09:28

marinalink
Member
Registered: 2008-04-13
Posts: 56

Re: changing default editor in fun_plug 0.5???

or just use the compiled nano for the DNS 323:
http://dns323.kood.org/forum/t2347-Ligh … piled.html

marinalink

Last edited by marinalink (2008-07-05 01:09:55)

Offline

 

#8 2008-07-05 01:21:56

infecticide
Member
Registered: 2008-06-26
Posts: 9

Re: changing default editor in fun_plug 0.5???

marinalink wrote:

or just use the compiled nano for the DNS 323:
http://dns323.kood.org/forum/t2347-Ligh … piled.html

marinalink

This is the version I have installed.

EDIT:

These are the packages I have installed:

DenyHosts-2.6-1.tgz     nano-2.0.7-ffp05.tgz    sudo-1.6.9p14.tgz
Python-2.5.2-2.tgz      ncurses-5.6-4.tgz       tcp_wrappers-7.6-3.tgz

Last edited by infecticide (2008-07-05 01:22:52)

Offline

 

#9 2008-09-18 18:02:00

Priet
Member
Registered: 2008-07-21
Posts: 12

Re: changing default editor in fun_plug 0.5???

infecticide wrote:

it would work, but it doesn't.  I get this when I run crontab -e:

root@DNS-323:~# export EDITOR=/ffp/bin/nano
root@DNS-323:~# crontab -e
Received SIGHUP or SIGTERM
root@DNS-323:~#


EDIT:
So it would appear that this does indeed set nano as editor, but why is it giving this error?

Did you ever find an answer for this?

I have the same problem. It doesn't matter whether I use the FunPlug or the Optware Nano package. Both give the same error sad

Offline

 

#10 2008-09-19 02:47:26

infecticide
Member
Registered: 2008-06-26
Posts: 9

Re: changing default editor in fun_plug 0.5???

I went with a different approach to get what I wanted.

I created a cronsetup.sh file in /ffp/start with the following contents:

Code:

#!/bin/sh

CRONTXT=/mnt/HD_a2/crontab.txt
# start with existing conrontab
/bin/crontab -l > $CRONTXT
# add the snapshot command
/bin/echo "00 2 * * * /mnt/HD_a2/.cron/infecticide_wwwdata" >> $CRONTXT
/bin/echo "05 2 * * * /mnt/HD_a2/.cron/infecticide_database" >> $CRONTXT
/bin/echo "10 2 * * * /mnt/HD_a2/.cron/infecticide_backups" >> $CRONTXT
/bin/echo "15 2 * * * /mnt/HD_a2/.cron/askahippy_wwwdata" >> $CRONTXT
/bin/echo "20 2 * * * /mnt/HD_a2/.cron/askahippy_database" >> $CRONTXT
/bin/echo "25 2 * * * /mnt/HD_a2/.cron/avatar_familypics" >> $CRONTXT
/bin/echo "30 2 * * * /mnt/HD_a2/.cron/avatar_downloads" >> $CRONTXT
/bin/echo "35 2 * * * /mnt/HD_a2/.cron/avatar_downloads" >> $CRONTXT

# install the new crontab
/bin/crontab $CRONTXT
# clean up
/bin/rm $CRONTXT

As you can see this file sets up the root cron file everytime the device starts up.   This is also a handy way to ensure your changes are presistant.   Just make sure you set the +x bit on the setupcron.sh script otherwise it won't run ;-)

Offline

 

#11 2008-09-19 10:37:30

Priet
Member
Registered: 2008-07-21
Posts: 12

Re: changing default editor in fun_plug 0.5???

I did something similar:

/ffp/start/crontab_add_scripts.sh:

Code:

#!/ffp/bin/sh

# PROVIDE: crontab_add_scripts

. /ffp/etc/ffp.subr

name="crontab_add_scripts"
start_cmd="crontab_add_scripts_start"
stop_cmd="crontab_add_scripts_stop"
restart_cmd="crontab_add_scripts_restart"

CRONORG="/mnt/HD_a2/home/root/crontab.org"
CRONCUSTOM="/mnt/HD_a2/home/root/crontab.root"
    
crontab_add_scripts_start() {
    echo "Adding custom scripts to crontab..."
    
    # Save original crontab
    crontab -l > $CRONORG

    # Add custom crontab scripts
    cat $CRONTMP $CRONORG $CRONCUSTOM | crontab -
}

crontab_add_scripts_stop() {
    # Revert to original crontab
    echo "Reverting crontab back to original state..."
    cat $CRONORG | crontab -
}

crontab_add_scripts_restart() {
    crontab_add_scripts_stop
    crontab_add_scripts_start
}

run_rc_command "$1"

/mnt/HD_a2/home/root/crontab.root:

Code:

### Logrotate
0 0 * * * /opt/sbin/logrotate -f /opt/etc/logrotate.conf &>/dev/null

It can:
1) Start
It stores the original crontab jobs as crontab.org. It reads crontab.root and together with crontab.org it's stored as the new crontab.
2) Stop
It reads crontab.org and saves it as the new crontab
3) Restart
Calls Stop and start. This is useful after you updated crontab.root.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB