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 2013-04-13 06:08:45

Amorphis
Member
Registered: 2013-04-01
Posts: 8

DNS-323 / Funplug 0.7 - Runlevels

Hi all,

I've been toying around with a script to automate the creation (simulation?) of runlevels for
the dns-323 running funplug.  I thought I'd throw it up here incase anyone is working on something
similar or is curious.

It will overwrite the funplug rc system, so it's may be a good idea to do a cp -rp on your ffp folder
to back it up! (I have 3 revision B's, and it works great for me on them… I've written this around
funplug 0.7, I have no idea if it will even work with 0.5)

It creates some scripts in /ffp/etc/rc.d to launch each runlevel, and keeps symlinks in /etc/rc0.d - rc6.d
similar to how other linux distros handle runlevels.  By default it has the following setup:

   0  - Halt             - Shut down Funplug for poweroff
   1  - Single User Mode - utelnet shell + the Dlink Firmware load is halted
   2  - Debug Mode       - utelnet shell + the Dlink Firmware loads normally
   3  - Dlink Mode       - Dlink Firmware loads normally
   4  - Not used but available for customization
   5  - Full Funplug     - Dlink Firmware loads normally + Funplug Scripts
   6  - Reboot           - Shut down Funplug for reboot

It also modifies the fun_plug script that gets called from /mnt/HD_a2 to execute the appropriate scripts
from /ffp/etc/rc.d

A 'chkconfig' utility is installed that allows you to manage runlevels in a similar fashion to rhel
and centos.  A 'runlevel' utility is also installed to allow easy switching between runlevels.
This in itself is what made it worth the effort for me. (Try 'chkconfig -h' or 'runlevel -h')
A .inittab file located on /mnt/HD_a2 keeps track of the runlevel, so you can edit this via SMB
as another method of switching runlevels on each boot.

*You'll need to install the utelnetd package to get the default runlevels 1 and 2 to work.  This will
make a tiny telnet daemon available that can be run from the ramdisk to avoid disk dependencies.
(The package was built from files taken from http://dns323.kood.org/howto:telnet - not my own work)

*I've also put together a modded version of that amazing chkbutton2 script to use rc0 and rc6, to seamlessly
integrate with this runlevel management method.  It's available if anyone wants to try it out.

Last edited by Amorphis (2013-04-13 06:23:13)


Attachments:
Attachment Icon make_runlevels.sh, Size: 19,599 bytes, Downloads: 255

Offline

 

#2 2013-04-13 06:09:47

Amorphis
Member
Registered: 2013-04-01
Posts: 8

Re: DNS-323 / Funplug 0.7 - Runlevels

And the utelnetd package:

Last edited by Amorphis (2013-04-13 06:10:14)


Attachments:
Attachment Icon utelnetd-1-oarm-1.txz, Size: 487,386 bytes, Downloads: 267

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB