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 2008-01-23 00:49:12

HaydnH
Member
Registered: 2007-09-28
Posts: 187

RFC (ATTN FONZ): ipkg & dns-323 file structure

Hi All,

Fonz, I'm especially interested in your comments on this in relation to your fun_plug etc.

I've been looking at ipkg recently to easily install/uninstall/upgrade software on the dns-323 - it seems to work pretty well and I've setup a quick demo (see below) that you can try out - you can also add pre/post install scripts to do configuration etc (e.g: creating an ssl certificate for openvpn). Anyway, I have a request for comment regarding this - please could anyone who's actively developing/hacking the 323 give me their thoughts on:

- Where applications should be installed? The demo below installs everything
    under /mnt/HD_a2/ipkg/[bin|etc|lib] etc, would you prefer everything under
    /mnt/HD_a2/[bin|etc|lib] etc? Somewhere else?

- Do you have any concerns using ipkg as a package manager?

- Do you have any other ideas/thoughts/concerns regarding this route?

- Who do I speak to to get a feed setup on http://dns323.kood.org? Or has anyone
   else got a temporary place for a feed? The feed can run from any website,
   however there is a python script to create the index file, it could be rewritten to
   shell though.


Demo:

Notes:
- FW 1.03 ONLY at present! The dns-323-fwver package is empty, it just checks if the dns-323 is fw 1.03, all other packages depend on this package forcing fw 1.03, you can also allow 1.03+ if you create the ipkg like that.
- Don't run the mediatomb binary without setting the " -m /mnt/HD_a2/mediatomb" flag if you install it this way.


Install ipkg:
Download the ipkg tarball (65kb) to /mnt/HD_a2.

Code:

/mnt/HD_a2 # bunzip2 ipkg.tar.bz2
/mnt/HD_a2 # tar xvf ipkg.tar

Set up ipkg (needs to done every boot):
These would obviously be done through fun_plug and probably using ldconfig instead:

Code:

/mnt/HD_a2 # LD_LIBRARY_PATH=/mnt/HD_a2/ipkg/lib; export LD_LIBRARY_PATH
/mnt/HD_a2 # PATH=$PATH:/mnt/HD_a2/ipkg/bin; export PATH
/mnt/HD_a2 # ipkg update

Example usage:

Code:

List all ipkg commands: # ipkg
List packages from the feed: # ipkg list
List installed packages: # ipkg list_installed
Install a package & dependencies (e.g: try mediatomb): # ipkg install pkgName
Remove a package: # ipkg remove pkgName

Thanks in advance all, I'm on an E25k TOI for the next 2 days so probably won't be able to respond much until Friday.

Haydn.

Last edited by HaydnH (2008-01-23 00:59:47)

Offline

 

#2 2008-01-23 11:40:39

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

HaydnH wrote:

- Where applications should be installed? The demo below installs everything
    under /mnt/HD_a2/ipkg/[bin|etc|lib] etc, would you prefer everything under
    /mnt/HD_a2/[bin|etc|lib] etc? Somewhere else?

That's a matter of taste. My very first funplug created an 'opt' directory and bind-mounted it to /opt. The wiki funplugs used /mnt/HD_a2/lnx_bin. In the end, I went for fun_plug.d, since it's the directory accompanying the fun_plug script. I'm sure you've noticed, the layout below fun_plug.d is pretty standard.

I advise against using /mnt/HD_a2/{bin,lib,..}. Some use the disk's root directory for 'real' Linux installations. The fun_plug is an add-on that can live in a separate directory tree.

HaydnH wrote:

- Do you have any concerns using ipkg as a package manager?
- Do you have any other ideas/thoughts/concerns regarding this route?

No. If more people start producing add-ons, a package manager might come in handy.

HaydnH wrote:

- Who do I speak to to get a feed setup on http://dns323.kood.org? Or has anyone
   else got a temporary place for a feed? The feed can run from any website,
   however there is a python script to create the index file, it could be rewritten to
   shell though.

Afaik, KRH is the owner of dns323.info.

Offline

 

#3 2008-01-23 13:44:39

KRH
Member
From: Denmark
Registered: 2006-10-27
Posts: 219
Website

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

i can change dns to point to any webserver


First user to fun_plug the dns-323.

Offline

 

#4 2008-01-23 15:50:36

Zen Seeker
Member
Registered: 2007-11-28
Posts: 74

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

This sounds really cool. I've used RPM but mostly apt-get for this. Would this only work for linux converted systems or can it be applied to fun_plug boxes? I was wondering about available memory and thought it would be great if we could somehow use the USB key to supplement RAM like they do on other OS's and for USB router on DD-WRT.

If the boxes didn't cost so much I'd pick up a second for testing but as it is I'm not willing to risk my 800gb of media until we're well done a beta path.

Watching with great intrest, please post any results.

Offline

 

#5 2008-01-25 14:30:59

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

Here's my thoughts on the subject - my dns-323 is turned off atm and I'm not at home so I can't login to check some things so I appologise if anything is a little vague:

Firstly I think the "fun_plug" should have ipkg added and any applications that are included in it (e.g: nfs/lighttp?) removed and turned in to packages. The fun_plug should essentially become a conduit for users to install what they want. For example most windows users have no need for nfs, so why install it? Anybody that wants nfs/mediatomb/openvpn/ssh/httpd etc should be able to install what they require in an easy way. I guess that where the fun plug resides physically on the device is unimportant, as long as it's agreed with the community. Fonz, this is more the area of thought I was after above, your opinions on what would make a "bare bones" fun_plug allowing users to add/remove what they do/don't want and whether you agree with my ideas.

Along side ipkg, it might be nice to include a script to enable/disable booting applications at boot time. All it would have to do is create/remove a link to the start/stop script in a specific directory which the fun_plug script would run in a similar way as it does now (if executable run). Also maybe a generic command to start/stop/restart services. Neither of these are particularly important but they may be nice if we have dependencies on applications in future (e.g: if we're running apache we may also need to start the mysql daemon). I'm thinking along the lines of the chkconfig/service commands in rpm based distro's or SMF in Solaris.

Something I want to explore in relation to this (probably this weekend as a start - I'm on call so can't stray too far away from home anyway) is the possibility of adding a web based gui for adding packages. Wouldn't it be nice to be able to add a web page to the standard DNS-323 configuration pages listing packages people have created and allowing people to download/install/remove/configure those additional applications without the need for installing telnet etc unless they want to? I'm not sure what support the standard webserver has (eg: cgi/php/lighttp etc - probably very little) so it may have to be a different port rather than directly in the standard config pages.

Also I'm a bit concerned with the security off the 323 at present, e.g the number of people installing telnet etc on their 323's without understanding the security implications, perhaps the fun_plug should be made more secure to start with e.g: using ssh as default instead of telnet, maybe an option of iptables if that's possible without a custom kernel (not sure if ip net filtering can be compiled as a module), and then install things like telnet if the user really requires it. One nice thing about ipkg is that you can run pre/post install scripts, so it could be implemented to display a security notice with a yes/no prompt before installing an unsecure application, or used to open/close a firewall port for the app being installed etc. Anyway, the security issue is probably a bit off topic...

KRH - thanks for letting me know re: dns. I'll get back to you when I've done a bit more work...

Haydn.

Offline

 

#6 2008-01-25 18:10:04

Zen Seeker
Member
Registered: 2007-11-28
Posts: 74

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

Although I've grown weak in Linux over the last 10 years supporting Widows I currently do a lot of installers for XP and Vista. I've never done one for Linux but if it's got a windows based tool or one for a livecd/dvd like Knoppix I can review and attempt to help out.

Otherwise I can test beta's we know wont brick things or kill data. (Sorry but I have no were to stick the 850GB I save on the DNS-323 and I already have about 5 TB of storage at the momant, almost all of it full.)

The rest of your comments are either agreeable to me or make no difference one way or the other provided we continue to do it the same way. The HPMediavault group pretty much did the same thing last year.

Thanks for the good ideas and the knowledge to help make it happen.

Offline

 

#7 2008-01-25 18:22:46

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

"Otherwise I can test beta's we know wont brick things or kill data."

The only things I'd be doing would be through the fun_plug so sticking the disks in a pc and removing the fun_plug script would fix any changes. On the other hand - I don't have a pc! (laptop only and dns-323 replaced my desktop) I've been considering setting up the fun_plug to automount a flash drive and if a file (/fix_fun_plug or similar) is present remove the fun_plug (i.e: removal of fun_plug by inserting usb key and rebooting)... I'll probably just risk it while doing dev stuff though as I'm pretty confident and I could go to a friends house if needed ;P

Offline

 

#8 2008-01-28 14:36:17

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

Having a very quick look this weekend, the dns-323 uses the goAhead webserver which has support for asp (grrr) and not much else. It is possible to add pages to the configuration pages of the dns-323 although as they're stored in rom (and I don't want to edit the rom at all for obvious reasons!) they need to be copied to the dns-323's HDDs and then mounted back in to place - it works well although there'll be some issues that I'll need to think about regarding future fw upgrades - easy enough to work around safely though.

So - what I want to do is most likely possible without running a second webserver, now I just need to give myself a crash course in asp! Most of the example code I've found (even as simple as Hello World) does't seem to run - although I've got a hello world working now I think the server may have limited functionality so running a second server might still be the only option, unless I can find some documentation for asp support in GoAhead webs which seems thoroughly lacking!

BTW - The conditions of using the GoAhead webserver are that you have a logo on the front page of the site, I haven't noticed any on the dns-323 config pages so either d-link has an agreement with goahead, the condition doesn't apply to these kind of devices or d-link is being naughty!

I'll post back soon when I've figured out goahead/asp... which may be more trial and error than figuring out!

Haydn.

Offline

 

#9 2008-01-28 14:57:49

KRH
Member
From: Denmark
Registered: 2006-10-27
Posts: 219
Website

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

its not asp its just files whit the asp extension.

to make funcktions to the goahead server you need some source files that dlink not have given us.

Conceptronic CH3SNAS have the files for the webserver budt there where diffrent functions in the when i played whit it.

check the CH3SNAS source and you will have something to play whit.


First user to fun_plug the dns-323.

Offline

 

#10 2008-01-28 17:15:57

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

"its not asp its just files whit the asp extension."

The dns-323 runs the goAhead webserver:

Code:

/ # telnet localhost 80
HTTP GET foo
HTTP/1.1 400 Page not found
Server: GoAhead-Webs <---
Date: Mon Jan 28 15:01:19 2008
Pragma: no-cache
-- snip --
/ #

The goAhead web server (webs binary) states in it's documentation that it supports asp - however looking at it it appears to be an amazingly crippled form of asp! You can only use @language=javascript (although even trying to set it to javascript fails) and most of the objects are not implemented - i.e: <% Response.write("Hello World!") %> fails but <% write("Hello World") %> works and there's no server object, so no executing command lines through this asp implementation... grrrr!


"to make funcktions to the goahead server you need some source files that dlink not have given us. "

The source code for the goAhead web server is available from their website. To make functions you use their weird cgi/goForms api which looking at the [tiny] amount of documentation available I REALLY can't be bothered to learn it at the minute! It seems a bit strange but as I understand goAhead webs - you use their api and it registers the goForms/cgi function in the webserver binary itself... try running strings on the webserver binary (`strings /web/webs`) and you'll see a ton of functions (and other related junk, html etc) in their which are called through the url's /goForm/foobaa which isn't a real path it just says call the foobaa function from the binary.

I'm almost sure that adding functions to the rom web configuration is possible, however trying to figure out the implementation of goAhead may be a different matter! I'm erring towards creating a lighttpd/php implemntation for now and porting it to goBackwards sometime in the future.

Haydn.

Offline

 

#11 2008-01-28 17:23:38

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

Actually thinking about it - you may need the source files if the goahead api can't add functions to the binary and only recreate the whole thing... I can't find anything in the documentation to support either though...

Offline

 

#12 2008-01-29 19:59:53

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

Well I opted to go for an additional web server (lighttpd with php) and have linked it in to the dns-323 default configuration pages successfully, and created a page that can install/remove ipkg packages - hopefully I should have a working demo by the end of the week...

Fonz: I was thinking about to do with the fun_plug script - as some people may want to use this "fun_plug", others will want to use the existing fun_plug and there may be more people wanting to use the fun_plug script for other things in the future. How about changing the default fun_plug script to ONLY look for files in a directory and run any executable files there... that way anyone wanting to use more than 1 "fun_plug" can do so - does that make sense? Comments?

Offline

 

#13 2008-01-30 00:55:28

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

HaydnH wrote:

How about changing the default fun_plug script to ONLY look for files in a directory and run any executable files there... that way anyone wanting to use more than 1 "fun_plug" can do so - does that make sense? Comments?

Please help me, I'm having trouble understanding what you're really after. The fun_plug script is 52 lines, nothing complex. And, it "looks for files in a directory and runs any executable files there". Some have integrated Debian chroot'ed apps, some have created funpkg.sh compatible addons, and there are more, very sophisticated and clever start scripts here on the forum. Btw, all the included start scripts take start/stop/restart/status commands.

You worried about NFS being installed by default - that's not the case in 0.4. You asked how to strip it down: You need busybox for telnet and shell. Probably, zlib, pcre, file, strace are not essential, but they don't take up much space either (and useful to diagnose problems). The 0.4 funplug is small (<5MB), too small, in fact. I find the need to add packages immediately after install to make it do sth useful, annoying.

I'd very much like to see an ipkg addon, if it simplifies things.

Offline

 

#14 2008-01-30 12:39:16

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

fonz wrote:

Please help me, I'm having trouble understanding what you're really after.

Definitions for clarity:

  - fun_plug script = the /mnt/_HD_a2/fun_plug script or equivelant.
  - fonz fun_plug = your fun_plug package
  - dns-323 extension = Any package that adds functionality to the dns-323 that requires the use of the fun_plug script. (e.g fonz fun_plug)

Sorry, I'll try to be clearer: As standard the DNS-323 has only 1 fun_plug script that is run at boot time. Including fonz fun_plug, the ipkg solution I'm working on and any other fun_plug scripts in the forums there are >1 uses for the fun_plug script. If someone wants to use 2 or more dns-323 extensions using the fun_plug script,  with the current situation, we are relying on the users installing telnet/ssh and either editing the fun_plug script by hand or running a script the dns-323 extension author has made. Let's take some theoretical examples:

  - A user is currently running fonz fun_plug and wishes to install an additional dns-323 extension. The only methods to install the second dns-323 extension either require telnet/ssh access or ftp'ing & hand editing the script and a minimal understanding of the Linux cli

  - A user has more than 1 dns-323 extension installed and wishes to remove one of them. At present this requires hand editing of the fun_plug. Taking fonz fun_plug as an example, we could script it and say remove the first 52 lines from the fun_plug script - but how do we know the code for fonz fun_plug is the first thing in the fun_plug script?


As a solution I was suggesting creating a standard master fun_plug script which never needs to be changed but gives us the possibility to have as many sub fun_plug scripts as we like. i.e: If we copied the "execute all in path for loop" from your  fun_plug script and used that as the master fun_plug script, then to install/remove any amount of dns-323 extensions in fun_plug terms would be as simple as adding/removing a file to/from that path. This is currently possible if a user is using fonz fun_plug - but what happens if a user does not wish to use fonz_funplug?

Of course a dns-323 extension author could create a script to append lines to the standard fun_plug script in "## start/end ##" tags - but this would require telnet/ssh access to run that script rather than just uploading the file via ftp or similar.

Haydn.

Offline

 

#15 2008-01-30 15:50:36

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

HaydnH wrote:

with the current situation, we are relying on the users installing telnet/ssh and either editing the fun_plug script by hand or running a script the dns-323 extension author has made.

I know that some have used my funplug this way, but it's not meant that way. In fact, my primary intention when writing the fun_plug script was: There should be no need to ever modify this script just to add some function (e.g. because a small typo can break things). Instead put a new script in the start/ directory, and you're done. Isn't this what you're asking for?

HaydnH wrote:

- A user has more than 1 dns-323 extension installed and wishes to remove one of them. At present this requires hand editing of the fun_plug.

See above, no need to edit the fun_plug, just remove the files. With 0.4, when installing addons, the list of installed files is stored on disk, so you can remove them later.

HaydnH wrote:

Of course a dns-323 extension author could create a script to append lines to the standard fun_plug script in "## start/end ##" tags

Again, changing the fun_plug is a hack, not the intended use.

Offline

 

#16 2008-01-30 16:48:33

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

fonz wrote:

There should be no need to ever modify this script.
See above, no need to edit the fun_plug, just remove the files.

That's the point I'm making. As it stands there is a need to modify the script if a user wants to use more than 1 package that requires the use of the fun_plug script concurrently while still having the option of running them independently. Consider the benefits of the following changes to a box running your fun_plug - it may get what I'm saying clearer:

Code:

# cd /mnt/HD_a2
# mkdir fpscripts
# mv fun_plug ./fpscripts/
# vi fun_plug
# cat funplug   # from your script with a few changes
FPSPWD="/mnt/HD_a2/fpscripts"
LOGFILE="somelogfile"
if [ -d "$FPSPWD" ]; then
    for fun_plug_script in $FPSPWD; do
        if [ -x "${fun_plug_script}" ]; then
            echo "* Running ${fun_plug_script} start ..." >>${LOGFILE}
            ${fun_plug_script} start 1>>${LOGFILE} 2>&1
        else
            echo "* ${fun_plug_script} not executable..." >>${LOGFILE}
        fi
    done
else
    echo "* ${FPSPWD} Directory not found"
fi
#

Now to install your funplug the user would upload it to /mnt/HD_a2/fpscripts and if anyone else needs to use the fun_plug script they can also upload their files to that path and /mnt/HD_a2/fun_plug never need change.

I hope what I'm trying to say is clear enough.

Haydn.

Offline

 

#17 2008-01-30 16:54:27

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

BTW: I recorded a quick video of how the ipkg thing is coming along, I still have quite a bit of work to do but it's coming along quite nicely You'll notice in the video that currently dependencies can't be removed until the package dependent on them is removed first and have do be done one at a time - I want to add a "remove all unused dependencies?" question at some point. Also there is no indication at present that anything is happening which could be confusing for large packages - that'll need to be changed. You'll find it here (2.7mb zipped).

Last edited by HaydnH (2008-01-30 17:02:12)

Offline

 

#18 2008-01-30 17:13:27

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

So, instead of putting new scripts into the start directory, you prefer to put new scripts into .../fpscripts? How is that better?

Offline

 

#19 2008-01-30 17:56:49

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

fonz wrote:

So, instead of putting new scripts into the start directory, you prefer to put new scripts into .../fpscripts? How is that better?

I use your funplug and like having it installed, but what would happen if somebody didn't want to use your fun_plug in conjunction with a different package - the start directory wouldn't exist. Therefore, anyone creating a package installer that requires the /mnt/HD_a2/fun_plug script would need to do something like "if installled(fonzFunPlug) { installPath=foo; scriptname != fun_plug }; elseif installed(packageX) { installPath = X; filename != fun_plug } else { installPath=/mnt/HD_a2; filename = fun_plug }" which is just horrible - especially as the install script would have to be updated whenever a new package was released and every package would need the "for i in path" loop to allow other packages to piggy back off the back of them.

* I imagine there is a mix of people using the dns-323, those who have never touched Linux and would prefer to have an easy web based installer and have no need for telnet (and therefore busybox), those who want both a graphical installer and the cli for more control and those, like me, who would be happy with just a cli.

Offline

 

#20 2008-01-30 18:31:34

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

HaydnH wrote:

those who have never touched Linux and would prefer to have an easy web based installer and have no need for telnet (and therefore busybox),

There're quite a few of those on this forum. And with a little help, they had great success installing my funplug. Some asked for additional packages, sure, but nobody complained about not having a graphical installer.

HaydnH wrote:

those who want both a graphical installer and the cli for more control and those, like me, who would be happy with just a cli.

Really, if someone wants to install two or more fun_plug scripts at the same time, he should know how to do this himself. From my POV, this is a non-issue.

There's a need for more packages, yes. But there's no need to create some meta-multi-fun_plug-framework thingy.

Offline

 

#21 2008-01-30 21:52:06

Zen Seeker
Member
Registered: 2007-11-28
Posts: 74

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

Hmm... this is only true if I still had a linux box somewhere. I guess a Live CD would do it to for that matter.

HaydnH wrote:

"Otherwise I can test beta's we know wont brick things or kill data."

The only things I'd be doing would be through the fun_plug so sticking the disks in a pc and removing the fun_plug script would fix any changes. On the other hand - I don't have a pc! (laptop only and dns-323 replaced my desktop) I've been considering setting up the fun_plug to automount a flash drive and if a file (/fix_fun_plug or similar) is present remove the fun_plug (i.e: removal of fun_plug by inserting usb key and rebooting)... I'll probably just risk it while doing dev stuff though as I'm pretty confident and I could go to a friends house if needed ;P

Offline

 

#22 2008-01-30 22:01:30

Zen Seeker
Member
Registered: 2007-11-28
Posts: 74

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

Webmin does just that and saves me finding my old notebook of switches and command line tools every time I want to edit a file with vi or update access control.

It does tend to make you command line lazy but for the amount of time I spend on Linux these days a good GUI is a better, faster, solution. Unfortunately the only person who got it to work on a DNS-323 never came back with the install instructions.

HaydnH wrote:

* I imagine there is a mix of people using the dns-323, those who have never touched Linux and would prefer to have an easy web based installer and have no need for telnet (and therefore busybox), those who want both a graphical installer and the cli for more control and those, like me, who would be happy with just a cli.

Offline

 

#23 2008-01-31 00:48:41

blbrown
Member
Registered: 2007-11-02
Posts: 88
Website

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

Just my 2c on this since I've been using fonz' fun_plug and have been adding functionality using various methods.  It would be nice for the following features to be added to the basic fun_plug, however it turns out:

- ability to dynamically change fun_plug.d/ (or whatever it's called) directory, depending on a USB device being installed--I'd like the ability to run add-ons completely off a USB key if it's present, but run off HD_a2 if it's not present
- setup rules for the add-ons' starting order (whether this is the start/ directory or something similar); there will often be times when one add-on depends on another one, or even depend on whether another one was successful or not

By the way, I really like this ipkg idea.  I'll definitely keep an eye on it and try to help when I have time.

Thanks fonz and HaydnH for putting so much work into the DNS-323 already!

Last edited by blbrown (2008-01-31 00:49:24)

Offline

 

#24 2008-01-31 09:56:52

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

blbrown wrote:

- ability to dynamically change fun_plug.d/ (or whatever it's called) directory, depending on a USB device being installed--I'd like the ability to run add-ons completely off a USB key if it's present, but run off HD_a2 if it's not present

It's necessary to hardcode some paths. Still, you need to the run the fun_plug from hard disk first, since that's where the firmware looks. If that script detects a usb stick, you can simply
mount --bind /path/to/usb/stick/fun_plug.d /mnt/HD_a2/fun_plug.d and it'll run off the stick....

blbrown wrote:

- setup rules for the add-ons' starting order (whether this is the start/ directory or something similar); there will often be times when one add-on depends on another one, or even depend on whether another one was successful or not

Ordering is trivial, just number the scripts (10-telnet.sh, 20-ssh.sh, 30-nfs.sh, ...) Dependencies are doable, too: if [ "$(10-telnet.sh status)" != "running" ]; then 10-telnet.sh start ....

Offline

 

#25 2008-01-31 15:13:18

Zen Seeker
Member
Registered: 2007-11-28
Posts: 74

Re: RFC (ATTN FONZ): ipkg & dns-323 file structure

I keep forgetting to check on a Live CD/DVD but can't we copy the format that Linux uses now?

I know we have one or two folders, depending on version, that contain files that are loaded in order at boot time. The *.S01/*.S99 files...in a folder just off the root if I recall right...not etc or root...maybe proc...just don't recall. (No Linux at work to check sorry.)

Anyway these are links/script that run at start and load items in the order of the file extention, *.S00 to *.S99 I think.

Would it be smart to use or mimic this? I've only created about two files for this folder when ever I built a server...one was to load custom support for USB when it wasn't working in the old days the second might have been for some sort of web security or apache.

Not sure if this is helpful but every time I read this thred I wonder if it's a useful thought or more of a hack.

l8r

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB