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 2006-10-22 03:46:40

vic_macky
Member
Registered: 2006-10-22
Posts: 20

fun_plug using cygwin. an idiots guide perhaps?

Hi guys! first of all i wanna say you guys are doing a great job on this site especially with the dsm projects you are doing. I recently bought a dsm-g600 because ive read that it can be used more than what its intended to. im a big fan of buying tech related things that can be hacked to extend its use beyond its defined purpose.

I'm a total noob in linux although i had a very small experience from a long time ago when i was able to install early versions of redhat though i wasnt able to continue to explore the world of linux for some reason.  Ive read in qn1234's posts that fun_plug can be edited thru cygwin. Can you please provide a noobs step by step example on how to do this on cygwin? i have cygwin installed and i dont know what to do next or maybe point me in a direction where i can read and learn how to do these things.  excuse me for being a total noob but everyone has to start somewhere to learn things you guys here already know. i would appreciate any help and advice you guys will give and hopefully when i learn these things i can give back to the community by helping out noobs like me who needs help.

any help will be appreciated.

vic

Offline

 

#2 2006-10-22 12:19:57

Grouper
Member
Registered: 2006-09-19
Posts: 33

Re: fun_plug using cygwin. an idiots guide perhaps?

Ok, can you specify your problems a little bit?
vim is a bit tricky as an editor, so maybe as a win-user you should edt the plug with Notepad, open it only in vim and set the fileformat to unix by typing":set filemode=unix" and saving it with ":wq" (there are quiet a few reference sheets for vi around,they help a lot)
afterwards just type "chmod +x fun_plug",
thats it.

Offline

 

#3 2006-10-23 09:24:27

vic_macky
Member
Registered: 2006-10-22
Posts: 20

Re: fun_plug using cygwin. an idiots guide perhaps?

Thanks for your reply Grouper.

ok so from starting from scratch i'll create my fun_plug by copying and pasting in Notepad the fun_plug scripts posted in this forum.? where do i find vim in cygwin? i was looking for vim from the folder where i installed cygwin and i cant seem to find it (im really sorry if my questions sounds stupid i am just starting into this and i really wanna learn). Where do i type ":set filemode=unix" and how do i save it with ":wg" and lastly where do i type "chmod + x fun_plug"?

When i do create my fun plug, do i just copy/ftp it together with busybox files to folder named HD_a2?

Offline

 

#4 2006-10-24 14:15:52

vic_macky
Member
Registered: 2006-10-22
Posts: 20

Re: fun_plug using cygwin. an idiots guide perhaps?

ok so finally i was able to create my fun_plug succesfully. big thanks to grouper. i opened cygwin then typed "chmod +x fun_plug" but nothing happened. what messages should i see to know that the command worked?

I'm learning. This is a great thing. Thanks guys.

Offline

 

#5 2006-10-24 16:38:50

Grouper
Member
Registered: 2006-09-19
Posts: 33

Re: fun_plug using cygwin. an idiots guide perhaps?

Sounds good!
you can tell if it has worked by changeing into /mnt/HD_a2 and do a "ls" command. Executales should be displayed in green. Otherwise I think there is a shell command to show the flags, but ls will do fine.
When inside cygwin you can use your "tab"key to complete commands and dir-names, it is a real help (rememeber doskey?)
Good luck!

Offline

 

#6 2006-10-25 09:34:22

vic_macky
Member
Registered: 2006-10-22
Posts: 20

Re: fun_plug using cygwin. an idiots guide perhaps?

ok as i mentioned iin my previous post I finally created my fun_plug using the scripts posted and then added the busybox scripts. now my fun_plug looks like this.

Code:

   #!/bin/sh

sleep 30

Dir_Len=28
Filename_Len=26
CUSTOMIZEHDPATH=/sys/custom/shared_name/HD

file=$(find "$CUSTOMIZEHDPATH"/*)
HD_Path=`expr substr "$file" "$Dir_Len" "$Filename_Len"`
HD_Path=$HD_Path"a2"

if [ -e /mnt/$HD_Path/fun_plug ]; then
        echo "function plug enable"
        /mnt/$HD_Path/fun_plug
fi
#!/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 &

Did i do it right? Also how can i change into /mnt/HD_a2? Do i use cygwin to do that? what is the comand or steps by step thing to do like explaining a little bit how and what to use so i can confirm that what i did is correct

Be more patient on me please.

thanks

Offline

 

#7 2006-10-25 09:46:39

vic_macky
Member
Registered: 2006-10-22
Posts: 20

Re: fun_plug using cygwin. an idiots guide perhaps?

I tried the command "net use" command in cygwin and this is what i get ( the results are displayed in column):
Status : ok
Local  : N ( i set the drive to N: on "my computer" in windows)
Remote : \\DSM-G600\HDD_a (When i open it in FTP using Internet Eplorer it displays as HD_a2--- the address bar shows -- ftp://dsm-g600/HD_a2/ )
Network : Microsoft windows network

I also tried the ff on Cygwin:
cd n: then i pressed enter. so im now in n: drive
chmod 777 fun_plug then i pressed enter again but nothing happens.

i have a feeling that im doing things wrongly.

please feel free to point me to the right path.

Offline

 

#8 2006-10-25 10:38:54

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

Re: fun_plug using cygwin. an idiots guide perhaps?

First of remove this from your fun_plug!

Code:

   #!/bin/sh

sleep 30

Dir_Len=28
Filename_Len=26
CUSTOMIZEHDPATH=/sys/custom/shared_name/HD

file=$(find "$CUSTOMIZEHDPATH"/*)
HD_Path=`expr substr "$file" "$Dir_Len" "$Filename_Len"`
HD_Path=$HD_Path"a2"

if [ -e /mnt/$HD_Path/fun_plug ]; then
        echo "function plug enable"
        /mnt/$HD_Path/fun_plug
fi

Secondly try real linux method. If you don't have nix based, ext3 supported computer. Then download damn small linux and boot it up.
http://dns323.kood.org/forum/p39-200609 … 7.html#p39


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

Offline

 

#9 2006-10-25 13:00:17

Grouper
Member
Registered: 2006-09-19
Posts: 33

Re: fun_plug using cygwin. an idiots guide perhaps?

what does sleep = 30 suppose to do?

(still looking for a method to sleep-mode the internal Harddisk) smile

Offline

 

#10 2006-10-25 13:36:36

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

Re: fun_plug using cygwin. an idiots guide perhaps?

Grouper wrote:

what does sleep = 30 suppose to do?

It pauses script for specified seconds.

Grouper wrote:

(still looking for a method to sleep-mode the internal Harddisk) smile

Try sdparm
http://dns323.kood.org/downloads/sdparm-1.00.tar.bz2


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

Offline

 

#11 2006-10-25 14:41:54

Grouper
Member
Registered: 2006-09-19
Posts: 33

Re: fun_plug using cygwin. an idiots guide perhaps?

Great & quick as usual, thanks a lot Sala!

Offline

 

#12 2006-10-30 07:56:36

vic_macky
Member
Registered: 2006-10-22
Posts: 20

Re: fun_plug using cygwin. an idiots guide perhaps?

I got it! Now i can telnet to my dsm now..I used a bootable PCLinuxOS then mounted the hard drive on my pc then followed the instructions you guys gave then walla! a success. It's specially gratifying for me because i have zero knowledge in Linux or Unix.

I really appreciate your patience with me. It's a good start. I will read more to learn more. 

Thanks to Grouper and Sala.

Uh-oh! another question. Do i just copy sdparm(no instructions in tar file) on DSM? Do i need to modify fun_plug? if i do how do i add it to my fun_plug scripts?

Offline

 

#13 2006-10-30 08:14:00

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

Re: fun_plug using cygwin. an idiots guide perhaps?

vic_macky wrote:

Uh-oh! another question. Do i just copy sdparm(no instructions in tar file) on DSM? Do i need to modify fun_plug? if i do how do i add it to my fun_plug scripts?

sdparm is just for suspending a hard drive or setting some other parameters for your disk. You don't really need it.
Here are some info about it:
http://sg.torque.net/sg/sdparm.html


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