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.

#1 2008-05-31 23:21:24

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

Bug fix and small updates for cleanboot 2.0

Hi,

after 3 weeks with my DNS 323 I configured it the way I needed it (thanks to fonz for the funplug!).The first script I modified and updated was cleanboot. There were some small bugs (umount of sdb had a typo and the if statement never executed the shutdown command, even though it was requested). These bugs are fixed in my version 2.0.2, including a nicer kill of the running applications/daemons (first kill, then kill -6 and then kill -9 after having waited after each command 3 seconds) and some commands to spin-up the disks if they are in standby. This is needed to ensure a proper umount. Otherwise you will again get some error messages of not cleanly umounted disks.

Please find my version of cleanboot attached, I hope pof has no objections against modification of his code.

The script was tested on a DNS 323 with FW 1.04b84 and ffp 0.5.

Enjoy the script!
marinalink

Last edited by marinalink (2008-06-01 00:19:28)


Attachments:
Attachment Icon cleanboot-2.0.2-ffp05.tgz, Size: 4,323 bytes, Downloads: 569

Offline

 

#2 2008-06-01 21:25:49

SilentException
Member
From: Island of Krk, Croatia
Registered: 2008-05-04
Posts: 148

Re: Bug fix and small updates for cleanboot 2.0

thanks,

so
"if [ $1 = "shutdown" ]; then"
was the shutdown fix! nice. havent tested it yet but i believe it works wink


btw i'm running raid0 so when testing the spinup commands
"touch /mnt/HD_a2/.tmp_wakeup_disk;sleep 1;rm /mnt/HD_a2/.tmp_wakeup_disk"
would walke hd0 only in most occasions (HD_b2 does not exist)

i have changed it to:
touch /mnt/HD_a4/.tmp_wakeup_disk;sleep 1;rm /mnt/HD_a4/.tmp_wakeup_disk
touch /mnt/HD_b4/.tmp_wakeup_disk;sleep 1;rm /mnt/HD_b4/.tmp_wakeup_disk

which is more correct in every raid/non raid scenario (a4 and b4 always exist - if you formatted using d-link webs)


D-Link DNS-323 v1.05 fun_plug-ed + many mods,  2 x 320GB Seagate Barracuda 7200.10 RAID0, Cat6 Gigabit Network, 9k Jumbo Frames, Average (WRITE): 19,32 MB/sec, Average (READ): 28,6 MB/sec

Offline

 

#3 2008-06-01 22:55:45

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

Re: Bug fix and small updates for cleanboot 2.0

Thanks SilentException for the hint and the proposed modification! It is now includedin the new version 2.0.3 (see attachment).

marinalink


Attachments:
Attachment Icon cleanboot-2.0.3-ffp05.tgz, Size: 4,331 bytes, Downloads: 514

Offline

 

#4 2008-06-01 23:19:36

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

Re: Bug fix and small updates for cleanboot 2.0

Is it possible to create a version for funplug 0.4? I would do it but don't know how.

Offline

 

#5 2008-06-01 23:32:25

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

Re: Bug fix and small updates for cleanboot 2.0

Sorry, I'm only using ffp 0.5. Never used funplug 0.4.

marinalink

Offline

 

#6 2008-06-03 19:24:49

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

Re: Bug fix and small updates for cleanboot 2.0

Sorry, I forgot to unset the executing bit of cleanboot.sh in /ffp/start. Therefore I have compiled a new version 2.0.4, which fixes this.

That means, if you want to have the clean boot now enabled, you have to set the executing bit by:

Code:

chmod a+x /ffp/start/cleanboot.sh

marinalink


Attachments:
Attachment Icon cleanboot-2.0.4-ffp05.tgz, Size: 4,330 bytes, Downloads: 1,425

Offline

 

#7 2008-07-07 16:46:42

flashman1207
Member
Registered: 2008-05-27
Posts: 92

Re: Bug fix and small updates for cleanboot 2.0

Does this run with fw 1.05?

Thanks
Tony

Offline

 

#8 2008-07-07 22:32:42

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

Re: Bug fix and small updates for cleanboot 2.0

Yes this should work smoothly with FW 1.05, but I was not able to test it.

I still have FW 1.04B84 running. You know: NEVER change a running system!

Offline

 

#9 2008-07-08 00:24:15

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: Bug fix and small updates for cleanboot 2.0

flashman1207 wrote:

Does this run with fw 1.05?

Tony,

I'm running fw 1.05, ffp 0.5 and cleanboot-2.0.4-ffp05.tgz without a problem.

Bob Blackwell
Pickering, ON


Bob Blackwell
Pickering, ON

Offline

 

#10 2008-07-08 04:01:28

flashman1207
Member
Registered: 2008-05-27
Posts: 92

Re: Bug fix and small updates for cleanboot 2.0

Thanks, will give it a go then.....

Tony

Offline

 

#11 2008-07-08 21:57:26

truxntrax
Member
Registered: 2007-11-16
Posts: 33

Re: Bug fix and small updates for cleanboot 2.0

Yes - i hadn't unistalled the previous version correctly - thanks for your help!  :-)

Offline

 

#12 2008-07-20 12:41:46

silversurfer
Member
Registered: 2008-07-20
Posts: 95

Re: Bug fix and small updates for cleanboot 2.0

marinalink,

I downloaded your version of cleanboot because the original cleanboot 2.0 doesn't work on my CH3SNAS. It tries to write to the readonly /sys/crfs file system. Unfortunately I found out that your version is trying the same thing.
Maybe this is different on a DNS-323 but on the CH3SNAS /usr/sbin is linked to /sys/crfs/sbin, at least in firmware 1.04RC4.
I'm not willing to brick my box by writing to the flash. ;-)

Do I have to modify the script myself to use the folders of ffp like /ffp/sbin or /ffp/bin to copy the files to? These folders come first in the $PATH.

Offline

 

#13 2008-07-20 23:29:43

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

Re: Bug fix and small updates for cleanboot 2.0

Hi silversurfer,

Did you read this thread: http://dns323.kood.org/forum/viewtopic. … 28&p=2

It has a cleanboot work around for CH3SNAS users.


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

 

#14 2008-07-21 02:55:38

silversurfer
Member
Registered: 2008-07-20
Posts: 95

Re: Bug fix and small updates for cleanboot 2.0

YES!!! It works! :-)

Thank you very much. After installing the modified script I can now reboot and shutdown with cleanly unmounted drives. I did a check on the hard disks and also the minix flash and now the error messages are gone.
The only errors I get are from the USB drive with the FFP on it. I believe that this can't be circumvented because most of the system runs from it.

There is only one thing which I didn't understand. You suggested to use "rm -r sbin" at one point.
Well, the "sbin" in "/usr/" is only a symbolic link. "rm sbin" should be enough to remove it and in fact it is enough on my box.
I don't know why it didn't work for the other fellow. Do you have an explanation for this strange behaviour?

Offline

 

#15 2008-07-21 08:57:31

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

Re: Bug fix and small updates for cleanboot 2.0

silversurfer wrote:

Do you have an explanation for this strange behaviour?

I did not investigate this, maybe I made a litle mistake during the process of installation, testing and rebooting (I am still a noob . . .). Anyway it's both working.

About cleanly unmounting the USB device, it's possible. Make sure that the started scripts in /ffp/start also contain the proper stop commands so that no application keeps files open on the file system. The cleanboot script will first stop all applications and will then try to unmount all file systems registered in /proc/mounts.


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

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB