Command line parameters when executing a PND?


Lanboy

Still Fresh
Joined
Nov 22, 2009
Messages
26
I'd like to be able to supply command line parameters when running a PND like Darkplaces, just not sure how to do it. If there is a document on the subject I'd appreciate it if you could point me in the right direction. Thanks.
 
I am not sure how exactly, but I am sure it's possible. There is a script that starts pnds called pnd_run which probably passes through arguments if the pnd is set up properly, so maybe have a Iook at that. tried looking it up on the wiki, but couldn't find it, sorry.

Edit: never mind i found it, have a look here:
https://github.com/skeezix/libpnd-clone/blob/master/testdata/scripts/pnd_run.sh

If you scroll through the script you will find the usage section which explains how to pass arguments and everything else:

Usage:
pnd_run.sh -p file.pnd -e cmd [-a args] [-b pndid] [-s path] [-c speed] [-d [path]] [-x] [-m] [-u] [-- more_args]
-p file.pnd : Specify the pnd file to execute
-e cmd : Command to run
-a args : Arguments to the command
-b pndid : name of the directory mount-point ($UNION_MOUNT_DIR/pndid) (Default: name of the pnd file)
-s path : Directory in the union to start the command from
-o speed : Set the CPU speed
-d [path] : Use path as source of the overlay. (Default: pandora/appdata/pndid)
-x : Stop X before starting the apps
-m : Only mount the pnd, dont run it (-e become optional)
-u : Only umount the pnd, dont run it (-e become optional)

One more thing: I took basically the first repo I could find, so I don't know how old that script is. Please don't install it on your pandora, the one that comes with the firmware does the same thing, but might contain fixes the other one does not.
 
Last edited:
What EXACTLY are you trying?
Passing parameters to stuff inside a pnd will most likely not work since many run by using a startup script that would simply throw these commands away.
Unpacking the pnd and then just write your arguments to that startup script may be what you want.
 
Thanks for the help guys. I did some digging before asking but couldn't find any relevant information.

I'm trying to run Quake (Darkplaces and GL Quake ES) and load maps and mods that require additional resources, which require you to pass parameters on the command line. Even just running a map that uses Quoth requires command line options.
 
Yea just unpack it, using "unsquashfs file.pnd", and adjust the startup by hand.
it should not make a difference if its a folder or a pnd so you can just shove that on the SD card.
 
  • Like
Reactions: ___
I'll give that a shot. I guess I'll need different .pnd files for specific options.

Can I assume that I just use squashfs to re-create the pnd?

Thanks for the help, I appreciate it.
 
https://github.com/skeezix/libpnd-clone/blob/master/testdata/scripts/pnd_run.sh

If you scroll through the script you will find the usage section which explains how to pass arguments and everything else:
I'm not sure why you cut off lines 150 and 151 which are an addendum to the usage which seems to be relevant here:
If '--' is specified, all subsequent arguments are passed through to the command
(useful if you want to pass quotes and weird chars to the command)

That seems to be what the OP is asking about to me. I take your warning that this doesn't seem to be live code, but I doubt that facility was explicitly excluded from the latest code.

Edit: Of course, it's possible if not likely that actually the first run thing is a script which doesn't parse any arguments, so arguments that make it through pnd_run wouldn't actually go any further. If you examine and modify the run script you wouldn't need to repack it necessarily for testing at least; you could put it in your appdata for the pnd, and that will replace the copy inside the pnd before running. If you want various different options here though, you'll need to repack the pnd as part of any solution though I think.

Making a PND is not a simple matter of running squashfs as far as I recall, there's also a separate copy of the PXML appended to the end. There should me a helper script called makepnd around somewhere, possibly in usr/pandora/scripts, but you might have success just appending the PXML to the end.
 
Last edited:
  • Like
Reactions: ___
I'm not sure why you cut off lines 150 and 151 which are an addendum to the usage which seems to be relevant here:


That seems to be what the OP is asking about to me. I take your warning that this doesn't seem to be live code, but I doubt that facility was explicitly excluded from the latest code.

Edit: Of course, it's possible if not likely that actually the first run thing is a script which doesn't parse any arguments, so arguments that make it through pnd_run wouldn't actually go any further. If you examine and modify the run script you wouldn't need to repack it necessarily for testing at least; you could put it in your appdata for the pnd, and that will replace the copy inside the pnd before running. If you want various different options here though, you'll need to repack the pnd as part of any solution though I think.

Making a PND is not a simple matter of running squashfs as far as I recall, there's also a separate copy of the PXML appended to the end. There should me a helper script called makepnd around somewhere, possibly in usr/pandora/scripts, but you might have success just appending the PXML to the end.
Yeah I didn't mean to cut off those lines but I posted this from my cellphone and it was super hard to copy and paste on the touch screen.
 
Back
Top