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 2011-01-06 06:33:52

puterboy
Member
Registered: 2008-09-18
Posts: 306

Revised standalone reloaded.sh script that doesn't require ffp

I rewrote the reloaded.sh script so that it can run standalone without *any* ffp installation or packages.
I also cleaned up the script a bit.

This allows one to reload the kernel directly on boot of the DNS-323 from a short /mnt/HD_a2/fun_plug script without any need to load or even install the ffp directories and packages. This also allows the script to be used to reboot other kernels directly (e.g., if you have reloaded a debian kernel you can reload it again directly using this script (and the appropriate reloaded module version) without having to first reboot the original firmware.)

The rewrite required careful attention that all of the functions used are present in the original (limited) busybox firmware shell and required some functions to be re-written in sh script.

The only functions missing and that I couldn't rewrite in shell script are 'killall5' and 'nohup'. However, if you reload right on boot and hence aren't starting up a lot of memory hogging ffp services or other user processes, then there is probablh no need for killing everything with killall5 (and if you are not doing killall5 you don't need nohup). But if you still want 'killall5' and 'nohup', I have compiled small, stripped & statically linked binaries that run both under 'arm' and 'armel' kernels.

So, to make this work all you need are:
1. This revised reload-jjk.sh script
2. The reloaded-2.6.12.6-arm1.ko kernel module (provided by Fonz) or a recompiled version if you are reloading from another kernel
3. The kernel +/- initrd/initramfs that you want to reload
4. An optional boot.sh calling script that puts in optional parameters.
5. The optional static nohup and killall5 binaries.

I also wrote a short replacement fun_plug script that will automatically reload the kernel on boot by calling boot.sh which in turn calls reloaded-jjk.sh to reload the kernel. This script only reboots the kernel if (1) the "flag" file .reload-kernel is present on /mnt/HD_a2 [this is configurable] and (2) the dns-323 can ping your LAN gateway. #1 allows you to prevent reloading by toggling the presence of the file. #2 allows you to stop reloading by pulling the network cable in case it gets stuck and you don't want to use ftp to either remove .reload-kernel or edit fun_plug. If reloading fails (or is not called), then the script calls fun_plug.alt (if it exists) which can be your original fun_plug script.


I am attaching the following in case anybody finds them useful:
1. reload-jjk.sh -- the revised reloaded script as described above
2. The 'nohup' and 'killall5' stripped static binaries
3. boot.sh -- which is a couple line sample script I use to pass the parameters to reload-jjk.sh to boot debian from a USB flash partition on sdc2
4. funplug -- the revised fun_plug script for reloading directly on boot
5. Fonz's original reloaded-2.6.12.6-arml.ko module

Note all you need to add is the kernel +/- initrd/initramfs that you want to reload (plus the root filesystem of course that you will be using)

ENJOY!


Attachments:
Attachment Icon reload-jjk.tgz, Size: 48,137 bytes, Downloads: 170

Offline

 

#2 2011-01-06 12:40:38

bjby
Member
Registered: 2009-02-22
Posts: 265

Re: Revised standalone reloaded.sh script that doesn't require ffp

This is good stuff. I will try it out sometime. This ping gateway safeguard was kind of smart.

What HW version of 323 are you using?

Offline

 

#3 2011-01-06 15:16:39

puterboy
Member
Registered: 2008-09-18
Posts: 306

Re: Revised standalone reloaded.sh script that doesn't require ffp

The ping test can be a lifesaver -- because if it does lock up on a new kernel or some dumb mistake, your only solution may be to pull the drive, break RAID (if you have it) and manually remove or edit the fun_plug. Because if it locks up in the new kernel, you won't even have access to the old firmware ftp to change things since each time it will immediately reboot...

By the way, I am using HW B1 with 1.05 firmware

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB