PND:FAQ

From Pandora Wiki
Revision as of 06:30, 21 June 2011 by Elpollodiablo (talk | contribs) (Adding run script before/after PND q/a)
Jump to: navigation, search

This is a list of frequently asked questions about using the Pandora PND package format. For factual and other kinds of questions, use the search box. If your question is not answered on this page, do some research and include it!

The PND system

What is a PND file?

A PND file is a compact file that contains one or more runnable applications for the Pandora. The file is basically an archive (like a ZIP, RAR or ISO) that contains all the data that the provided set of applications require, along with some meta data about the applications themselves.

Why are PNDs useful?

Normally, on an ordinary computer, it is necessary to install an application in order to run it. This usually happens in one of many different ways; an installer might be run, or an archive might become extracted, etc.
PND files are used to allow for applications to be executed without them being installed first. They are supposed to work in a way similar to game cartridges, in that they contain all of the necessary information in one tight package that can be executed independently.
This system is inspired by similar systems such as the Apple OS 10 DMG file system, the Puppy Linux package format, or the Haiku Box package management system.

Can I modify a PND file?

You can, but you need easily obtained open source freeware special tools to do so. (These tools are included by most Linux distributions by default, but are downloads for Windows and Mac OSX users.) It is advised that only developers modify or create PND files.

Can a PND file modify itself?

No, not generally. A pnd-file, even after extended use may be copied anywhere and still be in its original state. Any changes the application has made will have been redirected to its appdata directory instead, so you have your self-contained directory of its changes.

How does a PND store application data?

Since the PND cannot modify itself, there has to be a way for it to store runtime data, such as configuration files and user-added level files. This is achieved in the PND system by creating an application data directory for each application that is inside a PND. Since a PND can contain many applications, there can, and will, be multiple application data folders per PND, and each application declares its own application data folder name.
The application data folders are located in "pandora/appdata/*" on the device that the PND is stored on.

What desktop environments do pnd files work with?

As described below, the pnd-files will cause the system to spit out standard ".desktop" files for each application contained. The Pandora firmware includes several desktop environments (ie: menus) that understand those files (or operate with pnd-files directly.) The ".desktop" files are a standard however, so you are free to install other desktop environments and they should work fine out of the box with pnd-files, without any alteration whatsoever,

Can a PND-file be unpacked and used?

A pnd-file may be unpacked into what is called a "PXML-application directory" if the packager of the pnd-file followed the specification. (ie: the icon and PXML.xml metadata are included in the contained filesystem and not just found at the end of the pnd-file.) An application directory may be auto-discovered and executed just like a pnd-file, but you can muck with the files in-place without a problem. When the application writes back to itself however, the changes will still be directed to the appdata directory as with a regular pnd-file.
This is an advanced topic, noted here for completeness.

Can the PND-file system be added to other Linux distributions?

It is very easy to add the PND system to other Linux distributions, be they Pandora oriented or not. As of 2010 the Pandora APIs are are a little Pandora-specific, but effort will be made to split off the PND-file support and Pandora-specific support into separate systems, so that non-Pandora Linux distributions can even more easily adopt the PND-file system should they wish to. Certainly however, if you're building a new distribution to run on the Pandora, it is absolutely trivial to include PND-file support (and other Pandora originated technologies), so please do, to help for a consistent user experience.

Usage

How do I use PND files?

Using PND files on your Pandora is easy: You simply get hold of a PND file, presumably via a web page of some kind, and store it in a special folder on one of your SD cards. See the folder listing below. By default, both SD slots (and other mountable media) on the Pandora will be monitored for PND-files, though everything is configurable for advanced users.
Once you've put your PND in a known location, the PND system will pick up the new PND, "activate" it, and create shortcut icons to the applications inside of the PND. You can then use these icons to launch the applications.

How do I launch a PND application without putting it in a special location?

If you open a PND file in your file manager, the first application in the PND will be launched without you having to move the PND file.

How do I choose where the shortcut icons for a PND appear?

With the default configuration, there are four different folders you can put your PND files in to have their applications show up in different locations:
  • "/media/*/pandora/menu" - These PND-files will only generate shortcut icons in the system's application menu. ("*.desktop" files will be written to "/usr/share/applications")
  • "/media/*/pandora/desktop" - These PND files will only generate shortcut icons on the Desktop. ("*.desktop" files will be written to "~/Desktop")
  • "/media/*/pandora/apps" - Deprecated to some extent, this directory is used to be _both_ menu and desktop, without having to copy the pnd-file into /menu and /desktop (avoiding duplication)
  • "/usr/pandora/apps" This also extracts shortcut icons to the desktop. This path should not be touched, and is included to make an easy avenue for the Pandora firmware developers to include essential tools for the user, when bundled as pnd-files. (As of this writing early 2010, such tools are built into the firmware without being pnd-files, but the option exists still.)

Advanced Information

How is a PND file structured?

The PND file is simply an archive or file system image (currently, ISO and SquashFS are supported) with a "PXML.xml" appended at the end. There can also be an accompanying icon that is appended as well.

How does the PND discovery mechanism work?

There is an open source API for working with pnd-files and PXML-application directories (among other tasks); this API can be used by developers wishing to take advantage of the pnd auto-discovery system, such as when developing a new menu system say.
There is a special process called "pndnotifyd" that uses this API to watch the PND search paths for file changes. Once it finds a new PND file, it uses the PXML.xml file to generate one or more "*.desktop" files for the PND. (A .desktop file is a open standard way of describing an application and how to execute it, and is supported across most popular desktop environments.)

How do I change the search paths for PND files?

Simply edit the "/etc/pandora/conf/apps" file, and change the "searchpath" entry to include the paths you want to use. Paths are separated by colons (":") and may include wildcards (in the shape of "*") anywhere in the path.

How do I configure different locations for my PND shortcuts?

Edit the file "/etc/pandora/conf/desktop" (The "desktop" refers to "*.desktop files"). It will look like this:
# Open Pandora
# Desktop configuration

[desktop]
searchpath	/media/*/pandora/desktop:/media/*/pandora/apps:/usr/pandora/apps
dotdesktoppath	~/Desktop/
iconpath	/tmp

[menu]
searchpath	/media/*/pandora/menu
dotdesktoppath	/usr/share/applications
iconpath	/tmp
You should leave the "iconpath" variables be, but you can change which paths are searched through and where "*.desktop" files are extracted with the "searchpath" and "dotdesktoppath" variables, respectively.

How can I open a PND file to see what's inside?

The simplest way is probably to use PNDTools or PNDManager, which currently only work in Windows. You can also use them to edit PNDs and create them.

How do I set up a script to run before/after a specific PND runs?

Using pnd_run.sh or as of Zaxxon HF6 Alpha 1 The pandora will look in the program's appdata folder for a bash script named PND_pre_script.sh to run before the PND is run, and PND_post_script.sh to run on the PND's closing. All information pulled from [1] and may be subject to change due to updates.