Pandora PNDing shell applications


Galaxis

Member
Joined
Aug 30, 2010
Messages
318
Is there any standard to bundling up shell applications? Let's say I have something like ImageMagick or the commandline tools from the wireshark distribution that I usually want to call from a shell or from scripts.


I've seen what the Java PND does (installing a small wrapper that uses pnd_run.sh to mount the PND and pass parameters to the real binary inside). That's probably the way to go in general, but it also has some drawbacks (for example you call something like that a couple of hundred times from a shell script and the PND gets mounted each time - ouch).


On the other hand, I seem to remember there's a limit to how many PNDs can be mounted at any time? So just leaving things in persistently will lead to problems too...


While that part maybe is an unsolved problem, what I'd like to have is a standardized way to run programs from PNDs from the commandline without having to call pnd_run by hand. The idea would be to have a generalized shellscript that each PND can just create hardlinks to with the program names it needs.


Has someone worked on something like that already, or is there a better idea?
 
Last edited by a moderator:
You can have the PND add /mnt/utmp/PND_NAME/FOLDER_WITH_EXES/ to the $PATH and open a terminal window. That window would be able to run any executables in the PND as if they were in path. Closing/exiting that terminal window should unload the PND gracefully.


The CLI Love PND would be a good place to look for inspiration.
 
Last edited by a moderator:
IMHO it makes more sense to run the OS from SD-card and install command-line-applications that you frequently need to the system. If you still want to or have to run a command that is provided in a PND within a script a couple of times, then you can mount the pnd with something like "pnd_run.sh -p <pnd> ... -m", then execute the binary from /mnt/utmp/<pnd_mountpoint>/ as often as you need and at the end of the script run "pnd_run.sh -p <pnd> ... -u". I see possible smaller, unclean issues like that the PND is not unmounted when the script crashes or is aborted, but in general this should work.
 
Last edited by a moderator:
mindlord - yeah, that's what the cdevtools pnd does too, but I find that approach rather unwieldy. The goal would be to seamlessly integrate tools in PNDs in some way, but maybe I'm misguided there.


Lomaxx - For myself, I run off sd card anyway, and I use opkg and so on, but that doesn't help anyone else.
 
There are ways of doing what you want to do, but not without requiring the user to run the PND at least once per session. I guess you could modify the user's bash profile to add your PND's appdata folder to the Path, and dumping shell scripts there that would call pnd_run to launch the PND with the command line arguments in tow. Maybe it wouldn't be a bad idea to have a folder called /media/SDCARD(s)/pandora/scripts that is in the PATH that PND's could dump command line scripts into as part of the standard image so authors wouldn't have to worry about adding or removing things from the user's bash profile.



Code:
Mindlord strokes his beard
 
yeah, we've thought about this and never really cme up with an ideal solution. Its similar to the quesiton of .. how can a pnd make a shared lib available to the system, or any other long lived 'data file' (dictionairy files, etc.)


We keep thinking about stuff like automated dependancy loading between pnds, or pnds that pre-mount as soon as the system is up and idle (but then how to manage if you have too many pnds mounted?), and so on. Tough problem :)


jeff
 
yeah, we've thought about this and never really cme up with an ideal solution. Its similar to the quesiton of .. how can a pnd make a shared lib available to the system, or any other long lived 'data file' (dictionairy files, etc.)


We keep thinking about stuff like automated dependancy loading between pnds, or pnds that pre-mount as soon as the system is up and idle (but then how to manage if you have too many pnds mounted?), and so on. Tough problem :)
Hm, haven't even thought about the problem of libraries and such.


Don't know what has been discussed yet, but the quick & dirty idea would be to have an additional PND directory (like /pandora/system or something), and everything in there gets mounted at startup or login time (and adds itself to the global paths so binaries and libraries can be found). Limit there would still be the number of PNDs that can be mounted at any one time.
 
Another thing is .. pnds _can_ be left long term; a normal pnd enters, runs, exits; the wrapper (pnd_run.sh) sets it up and tears it down on enter/exit.


But pnd_run.sh can be told to mount-only and unmount-only (which it normally does and also runs between).


So a pnd could export a .desktop file (say) that would do the mount and unmount.. "toggle Foo.pnd Shell Available" or something, say, that would do the pnd_run.sh mount or unmount, without needing to leave a shell open to stop pnd_run.sh from tearing it down.


*shrug*


jeff
 
Back
Top