Pandora PND permissions weirdness on ext and fat


KickAss

Very Active Member
Joined
Mar 9, 2011
Messages
604
Location
Germany
hi,

i'm sure this has been discussed before, but i just can't find the bit that i'm missing.

i packaged a pnd that's behaving very strangely:

i packaged it on an ext partition and on there:

it will run if started with pnd_run

it will not run if started with /usr/pandora/scripts/run_pnd.sh (throwing "Operation not permitted" Errors at me)

on fat32:

it wont run at all ("Operation not permitted" Errors)

so permissions seem to be key.

what's the difference between run_pnd and /usr/pandora/scripts/run_pnd.sh?

why would they give different results here?
 
Use sudo ?
yeh tried that, of course. doesn't change anything.

in another thread someone seemed to have a similar problem.

neelix wrote something about file permissions and creating appdata directories from within the startup script... so far i wasnt able to make sense of it all.

file permissions are set correctly and they are owned by my local user (not root) on ext.

theres no problem if i run this natively (as in not packaged to a pnd file). so my guess is that i am missing something to make the pnd magic work.

what really baffles me is that the pnd works if started with pnd_run, but not if started with /usr/pandora/scripts/run_pnd.sh

also i dont understand what the problem with fat might be.

fat doesnt have file permissions.

possibly file ownership is being set to root on fat and i can't run a pnd as "normal" user? but would't that affect every pnd? i dont get it... :wacko:
 
How are you using it? can you share the command you are using?

Both commands do different things and have different syntax.. for run_pnd.sh, I typically only use it to mount and unmount PNDs with it.. but I know you can use the -e flag to run a specified command..

to mount a pnp to the /mnt/utmp directory


/usr/pandora/scripts/run_pnd.sh -p PATH_TO_PND -m
to unmount:

Code:
/usr/pandora/scripts/run_pnd.sh -p PATH_TO_PND -u
 
Last edited by a moderator:
right, im an idiot.
i've been reading all day and didn't notice the typo.

pnd_run and pnd_run.sh both work fine.

any ideas what the problem with fat might be?
 
pnd_run (binary) just runs pnd_run.sh; they shoudl be synonymous, excepting pnd_run binary takes less arguments and is less flexsible; its there just as a handy way to quickly run pnd's .. it runs things the same way the system does.

To be specific.. you're making an iso image of a fat filesystem, and thus lacking executable flags? I forget offhand, but if the mount is not then specifying that all files are executable, I'd bet it'd fail to be able to run things. Should be easy to check the mount options, and further.. I'd imagine the pnd_run.sh output in /tmp/ should clarify the error pretty well.

Checked the logs there? Sorry, no pandora handy .. just on my phone :)

jeff
 
pnd_run (binary) just runs pnd_run.sh; they shoudl be synonymous, excepting pnd_run binary takes less arguments and is less flexsible; its there just as a handy way to quickly run pnd's .. it runs things the same way the system does.
that's what i thought. thanks for the clarification.

To be specific.. you're making an iso image of a fat filesystem, and thus lacking executable flags? I forget offhand, but if the mount is not then specifying that all files are executable, I'd bet it'd fail to be able to run things. Should be easy to check the mount options, and further.. I'd imagine the pnd_run.sh output in /tmp/ should clarify the error pretty well.
i'm making a squashfs image (using -c) of an ext formatted sd, copy the .pnd onto a fat formatted sd and try to run it.

on fat the .pnd fails to run, raising python IOError.exceptions "Operation not permitted". pnd_run.out does pretty much the same (can't show you any logs right now as i dont have the pandora with me).

on ext the .pnd runs without any issues, so i guess it's about file permissions.

the .pnd reads and writes to files in the appdata dir. on ext file ownership is set to my local user. fat does not follow the concept of file permissions. so i don't understand how file permissions could be the problem here.

why use ext in the first place?

fat is case-insensitive :(
 
Okay so its not a pnd issue .. The pnd is up and running and your py code is blowing up .. Probably would happen if you just ran the py code too. So its a py on FAT issue most likely ..


So maybe one of the modules is have a case, long filename or permissions issue, or some ioctl or other unsupported issue?


Fat may not support all perms, but it has to try; if your code depends on perms it may blow up..


Need maybe the py stack trace to see whats up?
 
One of the main issues I've seen with Python programs in PNDs is that they tend to assume they are running on a case sensitive file system, so they will do something silly like having a file and a directory with the same name, but different capitalisation.

When they suddenly find themselves in a FAT32 environment (as happens when appdata is on a FAT32 card, regardless of the fs in the PND itself) there is suddenly a conflict between two identically named files and everything goes to crap.

I have no idea if this in any way relates to the issue you've been experiencing but it's something to keep in mind.

- Neelix
 
@skeezix: true. its not a pnd specific problem. the app doesnt do anything fancy and does not depend on permissions (well, it shouldnt).

@neelix: good point and i think thats the case here. it tries to read/write case sensitive files to the appdata dir.

its supposed to read/write only one file (which is all lower case, actually). for some reason it also writes parts of the contents of the pnd to the appdata dir (.py files and some config files). but not by my design (at least not intentionally).
 
okay, finally figured it out.

was trying to write to $HOME (/mnt/utmp/...) instead of $APPDATADIR (/media/somesdcard/...)

if you run your .pnd on an ext formatted sd card, this will work.

if you run your .pnd on a fat formatted sd card, this will not work.
 
Isn't this what is fixed by notaz' latest changes to the makepnd script (something about having the files in the PND owned by root)?
 
Back
Top