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-08 23:01:56

sjmac
Member
Registered: 2008-01-21
Posts: 222

funpkg to add Optware support to fonz fun_plug 0.4

OK, despite the experimental status of the optware support for DNS323, it's still a bit too much effort to install and use.

I use optware along side a fonz fun_plug 0.4 installation, and here is my script that will set up the Optware paths and start any optware services installed. It works for me.

I've attached the file packaged in a tgz file which you can either extract in a telnet session in the / directory or run the command

Code:

funpkg optware.tgz

I think that it should be easy to add in the initial ipkg binary and configuration needed to "install" optware, but for now the tgz just contains this single script that needs to be run at each boot of the DNS323. It's a bit of a patchwork from bits posted on this forum - thanks everyone :-)

Code:

#!/bin/sh

# /mnt/HD_a2/fun_plug.d/start/optware.sh

# This script sets up the folders and paths that are expected
# by the optware binary packages.

# This script intended to be placed in the fun_plug.d/start directory
# and given execute permissions so that it will be started automatically
# by fonz fun_plug 0.4: http://www.inreto.de/dns323/fun-plug/0.4/

echo "*Optware Create and mount /opt for ipkg applications" >>${LOGFILE}
mkdir -p /opt
mount --bind /mnt/HD_a2/ipkg/opt /opt
# NB: The fun_plug bin directories end up in front of optware.
export PATH=/opt/bin:/opt/sbin:$PATH

echo "*Optware Don't use the built in shell as it is locked" >>${LOGFILE}
# We expect this script to be run from fonz fun_plug version 0.4 which
# provides an unlocked and more recent busybox.
# Save the unmodified passwd file:
if [ ! -e /etc/passwd.orig ]; then    
  cp /etc/passwd /etc/passwd.orig
fi
# Replace /bin/sh with /mnt/HD_a2/fun_plug.d/bin/sh:
sed -i 's@:/bin/sh$@:/mnt/HD_a2/fun_plug.d/bin/sh@' /etc/passwd

echo "*Optware starting optware services" >>${LOGFILE}
# Add calls to selected start scripts for packages that you install from optware here:
#/opt/etc/init.d/S40sshd start

# Or start all services that have an Optware start script:
# http://trac.nslu2-linux.org/optware/browser/trunk/sources/ipkg-opt/rc.optware
for i in /opt/etc/init.d/S??* ;do  
  # Ignore dangling symlinks (if any).
  [ ! -f "$i" ] && continue
  
  case "$i" in
     *.sh)
          # Source shell script for speed.
          (
                  trap - INT QUIT TSTP
                  set start
                  . $i
          )
          ;;
     *)
          # No sh extension, so fork subprocess.
          $i start
          ;;
  esac
done

With this script/funpkg installed you don't need to make any changes to the main fun_plug script.

Last edited by sjmac (2008-05-08 23:21:17)


Attachments:
Attachment Icon optware.tgz, Size: 957 bytes, Downloads: 1,258

Offline

 

#2 2008-05-11 09:15:36

pwvandeursen
Member
Registered: 2007-07-04
Posts: 112

Re: funpkg to add Optware support to fonz fun_plug 0.4

Does this also work for ffp 0.5? If not what needs to be changed for it to work?

sorry for the stupid question but which dir is:

I've attached the file packaged in a tgz file which you can either extract in a telnet session in the / directory or run the command
is that the root? where also the fun_plug file is?

Thanks

Last edited by pwvandeursen (2008-05-11 10:34:40)

Offline

 

#3 2008-05-11 13:38:04

sjmac
Member
Registered: 2008-01-21
Posts: 222

Re: funpkg to add Optware support to fonz fun_plug 0.4

pwvandeursen wrote:

Does this also work for ffp 0.5?

No, I'm pretty sure it won't.

pwvandeursen wrote:

If not what needs to be changed for it to work?

For a start, the path in the tgz file will be wrong, so after you unpack it you'll have to move the script to wherever the startup files in ffp 0.5 are.

Then you'll need to edit the script to update the path to busybox, so you could try just changing them to the new path to 'sh' in ffp 0.5. So maybe changing /mnt/HD_a2/fun_plug.d/bin/sh to /ffp/bin/sh will work?

Finally, I'm not sure if the PATH definitions in optware.sh will survive in to the shell in ffp 0.5. You'd have to try it and see, and let me know - maybe fonz has some comment?

pwvandeursen wrote:

sorry for the stupid question but which dir is:
I've attached the file packaged in a tgz file which you can either extract in a telnet session in the / directory or run the command
is that the root?

Yes, it is the root directory, where you end up if you type 'cd /'. But as I said, the tgz file has the file in a subdirectory that will not be correct for ffp 0.5. The file is intended for fonz fun_plug 0.4, which has a special command funkpg that will do the right thing with it!

Offline

 

#4 2008-05-11 17:04:45

pwvandeursen
Member
Registered: 2007-07-04
Posts: 112

Re: funpkg to add Optware support to fonz fun_plug 0.4

Hmmmm, Thanks for the answer. Hopefully, someone with ffp0.5 will adapt it as it is not something I am good at.......

Offline

 

#5 2008-07-17 17:03:08

whiski
Member
Registered: 2008-07-17
Posts: 6

Re: funpkg to add Optware support to fonz fun_plug 0.4

I just tried to adapt optware.sh to ffp0.5

optware.sh (minimalistic, without comments):

Code:

#!/bin/sh

mkdir -p /opt
mount --bind /mnt/HD_a2/ipkg/opt /opt
for i in /opt/etc/init.d/S??* ;do  
  [ ! -f "$i" ] && continue
  
  case "$i" in
     *.sh)
          (
                  trap - INT QUIT TSTP
                  set start
                  . $i
          )
          ;;
     *)
          $i start
          ;;
  esac
done

PLUS you need change (add paths) /ffp/etc/profile

Code:

# Don't want a global LD_LIBRARY_PATH
unset LD_LIBRARY_PATH

if [ $(id -u) -eq 0 ]; then
    PATH=/ffp/sbin:/ffp/bin:/usr/sbin:/sbin:/usr/bin:/bin
else
    PATH=/ffp/bin:/usr/bin:/bin:.
fi

#optware
PATH=/opt/bin:/opt/sbin:$PATH

PS1='\u@\h:\w\$ '
PS2='> '

export PATH PS1 PS2 TERM

umask 022

Enjoy, it works for me.

Last edited by whiski (2008-07-17 17:04:15)

Offline

 

#6 2008-07-21 10:27:36

pwvandeursen
Member
Registered: 2007-07-04
Posts: 112

Re: funpkg to add Optware support to fonz fun_plug 0.4

Sorry to have to ask it, but what are the step by step actions needed to get Optware working with ffp 0.5 with this? ( I would like to have the ldap server running on my dlink)

Thanks for any help.

Offline

 

#7 2008-07-21 11:04:10

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: funpkg to add Optware support to fonz fun_plug 0.4

pwvandeursen wrote:

Sorry to have to ask it, but what are the step by step actions needed to get Optware working with ffp 0.5 with this? ( I would like to have the ldap server running on my dlink)

Thanks for any help.

i'm quite a noob but could follow these instructions, i use ffp 0.5 on usb, just adapt the commands to your setup.

http://dns323.kood.org/howto:optware

Last edited by knireis (2008-07-21 11:04:27)

Offline

 

#8 2008-07-21 13:28:53

pwvandeursen
Member
Registered: 2007-07-04
Posts: 112

Re: funpkg to add Optware support to fonz fun_plug 0.4

Thanks Knireis.

THat is indeed what had used before, to get optware running. In the end I switched back to funplug, and have it all running as I want. What I don't want to be doing is something that will force me to redo everything (I now Backup backup backup, which I will do before I start)

The question is for ffp 05. do I run the tgz file (will it then install the .sh file which I then adapt) do I have to do anything else to get it running?

If I read correctly the tgz file will do everything for you that is mentioned in the howto:optware page right?

just a small step by step for this particular config......

thanks

Offline

 

#9 2008-07-21 14:50:11

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: funpkg to add Optware support to fonz fun_plug 0.4

just follow the steps and it will work, to make it active at startup i used the information from entry #5 in this topic from whiski.
I installed MC this way and it works good.

Offline

 

#10 2008-07-21 15:12:17

EnricoM
Member
From: Netherlands
Registered: 2008-06-03
Posts: 77

Re: funpkg to add Optware support to fonz fun_plug 0.4

I can confirm that knireis is right. It's very easy to install optware and to activate it with the script from entry #5. I installed nzbget and mc this way. It took me about 10 minutes to install.


Hardware: Conceptronic CH3SNAS, FW1.03 - 2x Samsung Spinpoint F1 750 MB, no RAID  - Imation Whizz 4GB USB Flash Drive
Software:  Fun_plug 0.5 beta, SSH, Samba recycle bin, Firefly, hellanzb, nzbget, cleanboot, chrooted etch, optware, midnight commander, rsnapshot

Offline

 

#11 2008-07-21 17:23:57

pwvandeursen
Member
Registered: 2007-07-04
Posts: 112

Re: funpkg to add Optware support to fonz fun_plug 0.4

Followed all the steps, and wanted to start optware, but unfortunately unsuccessful:
~/HD_a2/ffp/start # ls -n
total 96
-rw-r--r-- 1   0   0   52 Apr 19 13:26 LOGIN.sh
-rw-r--r-- 1   0   0   36 Apr 19 13:26 SERVERS.sh
-rw-r--r-- 1   0   0  698 Apr 19 13:26 adjtimex.sh
-rw-r--r-- 1   0   0  209 Apr 14 21:55 btpd.sh
-rw-r--r-- 1   0   0  203 Apr 19 12:11 inetd.sh
-rw-r--r-- 1   0   0  229 Apr 15 14:06 kickwebs.sh
-rwxr-xr-x 1   0   0  223 Apr 15 14:06 lighttpd.sh
-rw-r--r-- 1   0   0  267 Apr 15 14:52 mediatomb.sh
-rwxr-xr-x 1   0   0 2453 Jun 15 17:07 mysqld.sh
-rw-r--r-- 1   0   0 1468 Apr 15 21:50 nfsd.sh
-rw-r--r-- 1   0   0  526 Apr 15 17:00 ntpd.sh
-rwxr-xr-x 1 501 501  334 Jul 21 14:45 optware.sh
-rwxr-xr-x 1   0   0  552 Apr 19 13:26 passwd.sh
-rw-r--r-- 1   0   0  160 Apr 15 22:18 portmap.sh
-rwxrwxrwx 1 501 501  322 Apr 12 16:15 pwconv.sh
-rwxr-xr-x 1   0   0  861 Apr 19 13:26 rcS.sh
-rw-r--r-- 1   0   0  224 Apr 16 07:37 rsyncd.sh
-rwxr-xr-x 1   0   0  534 Apr 19 13:26 shells.sh
-rw-r--r-- 1   0   0  229 Apr 24 19:16 smartd.sh
-rw-r--r-- 1   0   0  971 Apr 14 21:19 sshd.sh
-rw-r--r-- 1   0   0  398 Apr 19 12:11 syslogd.sh
-rwxr-xr-x 1   0   0  169 Apr 19 13:26 telnetd.sh
-rw-r--r-- 1   0   0  998 Apr 16 21:33 unfsd.sh
-rwxrwxrwx 1   0   0 2064 Apr 19 13:26 usbdisk.sh
~/HD_a2/ffp/start # sh /mnt/HD_a2/ffp/start/optware.sh start
sed: No such file or directory
Starting MySQL................................... ERROR!
Starting web server: lighttpd
2008-07-21 15:25:13: (network.c.300) can't bind to port:  3000 Address already in use

mysql is running, so I don't understand the error (or is that because it is running?)
why doesn't optware start?

Offline

 

#12 2008-07-24 01:00:44

whiski
Member
Registered: 2008-07-17
Posts: 6

Re: funpkg to add Optware support to fonz fun_plug 0.4

pwvandeursen wrote:

-rwxr-xr-x 1   0   0 2453 Jun 15 17:07 mysqld.sh

You have two MySQLs - one from ffp (look upper on your ls command - it starts automatically, because it has set exec right)
and one in optware.
Choose only one and uninstall second (funpkg -r or ipkg remove).
Try my theory this way:
stop ffp's mysql

Code:

/ffp/start/mysqld.sh stop

and next try to start optware (with optware's mysql).

Offline

 

#13 2009-01-02 19:39:10

kennedy101
Member
Registered: 2008-09-16
Posts: 48

Re: funpkg to add Optware support to fonz fun_plug 0.4

EDIT: The .5 scripts added by whiski work GREAT. For those like me that fail to read ALL the instructions and skip to the fun stuff beware.

You must complete the entire ffp .5 procedures to include enabling ssh!!! If you try to complete these procedures in telnet the ffp profile script will not update the path to inlclude /opt/bin.

Thanks for the help. Now we'll see if I can get the new functioning optware/ffp on to the USB stick.

Last edited by kennedy101 (2009-01-02 22:00:33)


DNS 323 (Hardware B1, Firmware 1.06). 2x 1.5TB Seagate HDs.
Chroot Debain (Lenny) on USB (not reloaded). Edna server. USB print server. USB drives added to samba share. All init.d scripts in place.
Future projects: FFP reloaded then chroot on B1 hardware.

Offline

 

#14 2010-06-29 19:10:02

gnugu
Member
Registered: 2008-05-08
Posts: 27

Re: funpkg to add Optware support to fonz fun_plug 0.4

I'm not sure if anybody is still tuned to this but I'll ask and hope smile.

Regarding post number 5 by whiski.

Once I have optware.sh in place I'm supposed to create /opt/etc/init.d and place there the scripts that optware.sh will start?
And do the scrips have to start with "S"?

Thanks.

Offline

 

#15 2010-06-29 19:19:06

gnugu
Member
Registered: 2008-05-08
Posts: 27

Re: funpkg to add Optware support to fonz fun_plug 0.4

Oh well, for the noobs like me smile

You have to create /opt/etc/init.d/ directory and in it you have to have scripts named like this S05xyz.sh.

optware.sh will execute all files that start with S followed by any two characters (which you should use as numbers so you can control the startup order) and then any characters and extension .sh.

I hope somebody will find it usefull.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB