How To Mount A Pnd And See The Gooey Bits Inside


gruso

thunderbox
Joined
Feb 28, 2008
Messages
7,461
Age
47
Location
Sydney, Australia
Website
pandorapress.net
I'm starting a new thread for this because, although I know the information is out there, it's pretty hard to find. This thread should be more visible in search results. This guide will allow you to mount a PND, and browse the files inside it.

On your Pandora:

Open Thunar, browse to your PND location, right click and open a terminal. Enter the following:

Code:
# /usr/pandora/scripts/pnd_run.sh -p [PNDNAME].pnd -m
You can now browse to /mnt/utmp/[PNDNAME] to see the files. Unmount by swapping -m for -u:

Code:
# /usr/pandora/scripts/pnd_run.sh -p [PNDNAME].pnd -u
On your Linux PC:

There are two types of PND, squashfs and ISO9660, a fact neatly hidden from view when using pnd_run on the Pandora. On the PC, different commands are used for each type.

squashfs PNDs
Note: You will need squashfs-tools installed.

Open a terminal in the location of your PND, and enter the following (choosing your own [NAME] text):

Code:
# sudo bash
# mkdir /mnt/[NAME]
# mount [PNDNAME].pnd /mnt/[NAME] -t squashfs -o loop
You can now browse to /mnt/[NAME] to see the files. Unmount with:

Code:
# umount /mnt/[NAME]

ISO9660 PNDs
You do not need any special tools installed to mount these.

Code:
# sudo bash
# mkdir /mnt/[NAME]
# mount -o loop [PNDNAME].pnd /mnt/[NAME]
Unmounting is as per above example.
 
all pnd are not in squashfs format. some are classic iso9660.
but you're lucky beccause this works too :
# mount -o loop hello.pnd /mnt/hello

EDIT: why not on the wiki instead ?
 
Gruso said:
but I don't know what loop means. I also don't really know how to unmount this.
At Wikipedia is a good explanation of the Loop-Device.

Unmounting is as simple as "umount /mounted/path", but you first have to close all references to it.
With "lsof /mounted/path" you can see what processes are still referring to it.
 
Last edited by a moderator:
You can use pnd_run.sh to do all the heavy lifting here and eliminate guesswork.
Code:
/usr/pandora/scripts/pnd_run.sh -p path_to.pnd -m
/usr/pandora/scripts/pnd_run.sh -p path_to.pnd -u
-m mounts and -u unmounts
It will mount to /mnt/utmp/[PNDNAME]

I suppose it wouldn't be too hard to configure some Thunar helpers for this either.
 
I'd recommend the pnd_run.sh method -- thats why we built it, and it will be supported, and will support future pnd-file types.

Also, 'sudo su' isn't really kocher; 'sudo bash' to 'as root, give me a shell' is more what you want.

jeff
 
Thunar helpers work a treat.

  1. Open Thunar
  2. click Edit
  3. click Configure Custom actions
  4. click the add button (on the right)
  5. Name: Mount PND
  6. Command: /usr/pandora/scripts/pnd_run.sh %f -m && thunar /mnt/utmp/
  7. Icon: If you feel so inclined to add one.
  8. Click Appearance Conditions
  9. File Pattern: *.pnd;*.PND
  10. Check Other Files
  11. Click OK
  12. Repeat Steps 4-11 except name it Unmount PND and use "-u" instad of "-m && thunar /mnt/utmp/" on the command
  13. Enjoy

Quick add this to the firmware. :p
 
mindlord -- oh trust me, we've often wanted to :)

Write up the config change or .desktop to do that, send it my way, I'll roll it in ;)

jeff
 
It'll have to be in the SKEL.
Code:
/etc/skel/Applications/Settings/Thunar/uca.xml

People can replace the contents of their current uca.xml file with this too.
Code:
/home/[USERNAME]/Applications/Settings/Thunar/uca.xml

Code:
<?xml encoding="UTF-8" version="1.0"?>
  <actions>
    <action>
       <icon>Terminal</icon>
       <name>Open Terminal Here</name>
       <command>exo-open --working-directory %f --launch TerminalEmulator</command>
       <description>Example for a custom action</description>
       <patterns>*</patterns>
       <directories/>
    </action>
    <action>
      <icon>emblem-symbolic-link</icon>
      <name>Mount PND</name>
      <command>/usr/pandora/scripts/pnd_run.sh -p  %f -m &amp;&amp; thunar /mnt/utmp/</command>
      <description></description>
      <patterns>*.pnd;*.PND</patterns>
      <other-files/>
      <text-files/>
    </action>
    <action>
      <icon>gtk-jump-to-rtl</icon>
      <name>Unmount PND</name>
      <command>/usr/pandora/scripts/pnd_run.sh -p %f -u</command>
      <description></description>
      <patterns>*.pnd;*.PND</patterns>
      <other-files/>
      <text-files/>
    </action>
  </actions>
 
Hey can you drop that clip into a feature request in bugs.openpandora? That'd be a good way to make an action item and we can get it in for HF6.

jeff
 
@Skeezix: Done.

@Sebt - Isn't that the default action already. (double-click) and Right click shows "Open With "Run PND Application" as the first menu item.
 
Ok, OP updated based on all your advice. It's still a WIP, so please tell me if I've gone wrong. Specifically, the libpnd stuff in red - I understand these tools can be installed on a desktop?

Also, is there any reason I shouldn't do this on the Pandora:

Code:
# cp /usr/pandora/scripts/pnd_run.sh /usr/bin/pnd_run
 
Gruso said:
Also, is there any reason I shouldn't do this on the Pandora:

Code:
# cp /usr/pandora/scripts/pnd_run.sh /usr/bin/pnd_run
Many : while the binary pnd_run read the pxml file at the end of the file to discover apps, the pnd_run.sh dont.
So you cannot simply "pnd_run file.pnd" anymore if you drop the binary.
Anyway, pnd_run start pnd_run.sh in the end (but with the corrects arguments)

So, imho, that would be a _very_ bad idea.
 
Last edited by a moderator:
Glad I asked. Truth is I had already done it... but I sensed there would be complications with naming it pnd_run, so I gave it another name. Everything's working nicely, and I'll only ever use it for mounting PNDs, so let's never speak of it again.

Getting back to the OP, any errors to point out? I'll get this on the wiki as soon as it's confirmed error free. :)

[edit] Ok, I'm going to remove the libpnd-on-pc stuff and just go with regular linux commands for desktop. Once it's on the wiki it's anyone's plaything.
 
I know this thread is a month and a half old but I just found out that 7-zip now reads SquashFS files. I installed the newest version on my WinXP machine at work and set .PND to open with 7-zip and then found a good Open-Pandora icon for it. Now i can open both SquashFS and ISO PNDs, or at least the ones I tried. Just thought anyone on Windows might like to know this because I found it very useful.
 
Back
Top