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 2007-07-17 00:49:42

bkamen
Member
From: Central East Illinois, USA
Registered: 2007-07-16
Posts: 80
Website

/bin/busybox vs. busybox v1.2.1

So my system has a binary 'busybox' in /bin

Obviously this is being called by default which I know I can get around with my PATH and what...

What have all of you done to install the new busybox over the old? (or make them coexist)

-Ben


--
Ben - Don't Ask me how I fixed it - I have no idea what I'm doing!
============================================
http://www.benjammin.net/

Offline

 

#2 2007-07-17 10:10:14

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: /bin/busybox vs. busybox v1.2.1

/bin/busybox will be called directly very rarely. So you can just replace all symlinks you like. But you have to do this at every boot-up. Personally I don't suggest you do to so. If you want some new applets then just set custom bin directory to your hard disk and add it to PATH.


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#3 2007-07-17 12:06:14

BertrandB
Member
From: Dijon (France)
Registered: 2006-09-16
Posts: 119
Website

Re: /bin/busybox vs. busybox v1.2.1

well my fun_plug

fun_plug wrote:

#!/bin/sh
set -x
FUNDIR=$1
cd ${FUNDIR:=/mnt/HD_a2/fun_plug.d}
for FUNPLUG in *
do
   [ -x $FUNDIR/$FUNPLUG ]&& . $FUNDIR/$FUNPLUG
done

the content of /mnt/HD_a2/fun_plug.d

fun_plug.d wrote:

00telnet  10CorrWeb   20crontab  20edna   99BugWifi
01local   10StopUpnp  20dyndns   20lprng

00telnet wrote:

#!/bin/sh
if [ ! -e /mnt/HD_a2/ash ]
then
ln -s /mnt/HD_a2/busybox /mnt/HD_a2/ash
fi
if [ ! `grep root /etc/shadow` ]
then
echo kontroll.`grep admin /etc/shadow` >> /etc/shadow
/mnt/HD_a2/sed -i -e 's/kontroll.admin/root/' /etc/shadow
fi
/mnt/HD_a2/sed -i -e 's/root:.*/root:x:0:0:Linux User,,,:\/:\/mnt\/HD_a2\/ash/' /etc/passwd
cd /dev && /mnt/HD_a2/busybox makedevs ptyp c 2 0 0 9
cd /dev && /mnt/HD_a2/busybox makedevs ttyp c 3 0 0 9
/mnt/HD_a2/busybox telnetd &
#fin telnetd

01local wrote:

#!/bin/sh
ln -sf /mnt/HD_a2/busybox /bin/vi
ln -sf /mnt/HD_a2/local /usr/local
ln -sf /mnt/HD_a2/local/etc/profile /etc/profile
PATH=/usr/local/bin:/usr/local/sbin:$PATH

10CorrWeb wrote:

#!/bin/sh
if [ ! -e /mnt/HD_a2/web]
then
   cp /sys/crfs/web_page /mnt/HD_a2/web -R
   rm /mnt/HD_a2/web/formatInternalHD*
fi
rm /web/web
ln -s /mnt/HD_a2/web /web/web
#fin correction bugs webs

10StopUpnp wrote:

#!/bin/sh
#Stop the unpnp stuff
for N in $(pidof upnp); do kill $N;done

20crontab wrote:

#!/bin/sh
crontab /mnt/HD_a2/local/etc/crontab

you saw that i use a /mnt/HD_a2/local directory to put all you can found under usr/local in common distro

# ls local
bin  etc  lib  libexec  man  sbin  spool

and the profile

# more local/etc/profile
#!/bin/sh
echo profile local
PATH=/mnt/HD_a2/local/bin:/mnt/HD_a2/local/sbin:$PATH
export PATH
LD_RUN_PATH=/mnt/HD_a2/lib:/lib:/usr/lib
export LD_RUN_PATH
LD_LIBRARY_PATH=$LD_RUN_PATH
export LD_LIBRARY_PATH
cd /mnt/HD_a2

Last edited by BertrandB (2007-07-18 21:59:36)

Offline

 

#4 2007-07-17 17:41:52

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: /bin/busybox vs. busybox v1.2.1

This is good way to handle custom binaries and hacks if you still use D-Link firmware and not gentoo or debian (flashed or loaded using loader.o)


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#5 2007-07-17 19:45:08

bkamen
Member
From: Central East Illinois, USA
Registered: 2007-07-16
Posts: 80
Website

Re: /bin/busybox vs. busybox v1.2.1

It's always nice to see others' implementations of things.. which is what I was looking for here...

Nice... Thanks for the info.

Has anyone compiled ISC DNS/DHCP for this thing? Could I put in a request for that? wink That would be funny to see run.

-Ben


--
Ben - Don't Ask me how I fixed it - I have no idea what I'm doing!
============================================
http://www.benjammin.net/

Offline

 

#6 2007-07-18 18:40:30

IrishCubsFan
New member
Registered: 2007-07-16
Posts: 2

Re: /bin/busybox vs. busybox v1.2.1

BertrandB,

The 10StopUpnp and 10CorrWeb scripts listed above appear to be the same script.

Also, what version of firmware are you running with? Trying to emulate your method for the fun_plug but running into issues.

Thanks for your help,
ICF

Offline

 

#7 2007-07-18 22:09:20

BertrandB
Member
From: Dijon (France)
Registered: 2006-09-16
Posts: 119
Website

Re: /bin/busybox vs. busybox v1.2.1

IrishCubsFan wrote:

BertrandB,

Just Bertrand wink

IrishCubsFan wrote:

The 10StopUpnp and 10CorrWeb scripts listed above appear to be the same script.

Oups ... corrected in the original messages

IrishCubsFan wrote:

Also, what version of firmware are you running with? Trying to emulate your method for the fun_plug but running into issues.

I'm in 1.02us but it would work with 1.02eu.
For the fun_plug and the script in fun_plug.d two points very important :
They must be linux text file (not dos only LF not CR+LF)
They must have the execute right.

Offline

 

#8 2009-09-24 07:24:17

GCMartin
Member
Registered: 2008-05-09
Posts: 6

Re: /bin/busybox vs. busybox v1.2.1

I am new to linux so forgive me for sounding childish.

In the layout that Bertrand presents, where does one get the contents that goes into /mnt/HD_a2/web, /mnt/HD_a2/sed, /mnt/HD_a2/ash, /mnt/HD_a2/busybox???

Are these precompiled for the DSM-G600? Are there specific instructions to populating these folders on the DSM-G600?

I am new, but I am willing to publish a user doc for doing this so that anyone who desires can follows steps to install these items to get telnetD support working on the unit without much effort. To a Linux Guru as most here are (compared to me) this is way too elementary....But to most new purchasers of the DSM-G600 like me who are coming from a MS world and trying to learn all we can about Linux, a document detailing what and why these things are done would be TREASURED!

I want to learn and I want to help too.

Offline

 

#9 2009-09-24 07:46:42

GCMartin
Member
Registered: 2008-05-09
Posts: 6

Re: /bin/busybox vs. busybox v1.2.1

Shouldn't I be able to
  o  collect all of the files/folders (Zipped) necessary to populate /mnt/HD_a2/...,
  o  FTP it to the D-Link
  o  make a Fun_Plug that unzips the copied files and creates all files necessary respectively and rewrites the "final" fun_plug
  o  Finally rebooting so that telnetD is working

Your advice please

Offline

 

#10 2009-09-24 10:48:18

GCMartin
Member
Registered: 2008-05-09
Posts: 6

Re: /bin/busybox vs. busybox v1.2.1

As a Windows novice moving to Linux, I've just created my TelnetD using instructions at http://dns323.kood.org/dsmg600/howto:telnet.

After understanding that page a little better, I learned a lot that I did NOT know when I started asking questons, here. I now understand that the questions about /mnt/HD_a2, earlier are about files that are created by a Tar (unzipping) of a downloaded container and are NOT foldernames that I thought they were.

This experience has only netted me a feeling of completing a necessary task. In terms of learning, I do NOT have a better concept of how these pieces go together yet.

If I could help, I would rewrite the directions a "little" differently for the pure elementary people like myself.

Offline

 

#11 2009-09-24 22:32:45

BertrandB
Member
From: Dijon (France)
Registered: 2006-09-16
Posts: 119
Website

Re: /bin/busybox vs. busybox v1.2.1

Oh yes you can, my english is so poor that i don't know how to do a best explanation.
And hacking a box is not a so elementary.
Did you success whith telnet ?

Offline

 

#12 2009-09-27 23:44:55

GCMartin
Member
Registered: 2008-05-09
Posts: 6

Re: /bin/busybox vs. busybox v1.2.1

I followed the instructions and can get a Telnet login screen. But, I cannot get any commands to work. I tyoe a command, but I don't get any responses on my telnet window???

Off-line login: admin
Password:
warning: cannot change to home directory

BusyBox v1.00-pre1 (2005.10.27-08:04+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

help

(Nothing happens ???? )

Offline

 

#13 2009-09-28 09:38:46

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: /bin/busybox vs. busybox v1.2.1

GCMartin wrote:

I followed the instructions and can get a Telnet login screen. But, I cannot get any commands to work. I tyoe a command, but I don't get any responses on my telnet window???

Off-line login: admin
Password:
warning: cannot change to home directory

BusyBox v1.00-pre1 (2005.10.27-08:04+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

help

(Nothing happens ???? )

You have not followed instructions correctly. Please post your fun_plug file content along with the file list you have at the root of your hard disk.


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB