Software PND shell script not executing


namco

Member
Joined
Mar 22, 2006
Messages
410
Age
42
Location
Manchester, UK
Website
www.stupendous-stuff.com
After feeling nostalgic about devving for the GP2X again (and actually finishing the issues in Zombiepox - release coming within the next few days),I've turned towards the Pandora to try and get something running (yes, Zombiepox). I tried again with cdevtools on the Pandora and got nowhere. Then I remembered that I'd downloaded some cross-compile bins and libs for the Pandora and tried those again. It took a few more goes and some research but I've finally got a working port of Zombiepox on the Pandora. However, putting it through PNDTools on Windows and running on the Pandora gives me nothing. I tried mounting the pnd using the -m switch and trying to run the shell script from there but it gives me a "not found" on the line that says ./Zombiepox.

I know this runs as I have a loose version (no pnd) with a shell script that does the same as the pnd version except that loose version doesn't have the export HOME=`pwd` lines. The other thing I've found is that the pnd version doesn't like carriage returns.

What am I doing wrong?

P.S. for those that remember the music issues with the GP2X version. There are none in the Pandora version! :)
 
It's probably saying file not found because there's no file names Zombiebox in your current directory, because I guess you're not cd'ed to inside the pnd before you run it.

It's hard for my to say why else it's not running. How exactly are you trying to run it? Does it appear in the start menu or in minimenu properly?

And yes, linuxes including the Pandora's use Line feed alone as the newline signifier, while windows uses carriage return+line feed from memory.
 
  • Like
Reactions: rSl
Okay, so if you open a terminal in the right folder (or presumably otherwise navigate to there) it does launch correctly. I suspect that indicates the trouble is in your PXML file. I don't know how PNDtools on windows handles this at all, but in the end result you need your PXML file inside the squash fs image as well as the contents of that file appended to the end. I suspect it's on the end okay, because I think that's what the menu builder look at, but the execute line might still be wrong.

Do you get any error messages if you run the pnd from the terminal. I forget the name of the pnd runner at present, and from memory it's somewhere like /usr/pandora/scripts, but it should give you better logs if there's a problem with your PXML.
 
Maybe a missing library?
"ldd ./Zombiepox" list all needed libraries. Run it in your mounted pnd directory.

Please upload the pnd for more tests.

Thomas
 
Probably not that; it seems to load and run at least as far as the menu if it's manually mounted and the start script is run, see the posted video for evidence. As far as I know even dynamically loaded libraries generally get loaded into the workspace at start up, so if it got to the menu I'd expect it to pass all tests.
 
It would be more efficient to post the start.sh and PXML file here instead of a 3min long video that doesn't gives any technical information.
 
It would be more efficient to post the start.sh and PXML file here instead of a 3min long video that doesn't gives any technical information.
Firstly, that video was for a "sanity check" to make sure that I'd done things somewhat correctly in terms of including the right things (like the application - which was mentioned) and I didn't want a ping pong of messages asking about it.

Secondly, I'd appreciate it if you'd have asked this a little less dickish. How about:

"Can you post your PXML and start.sh as it'll better help with the problem"
 
Well, maybe my message was a bit too direct, sorry for that.
But again, it's all about efficiancy. No one asked you to prove you have done all sanity test. This is not this kind of community here. You write you did, it's enough.
It's a technical community, that is all about code, script, low level detail...
What kind of solution are you exepting if you don't give details?

Only thing I can say without seeing anything is: try to switch to "#!/bin/bash" if you were using "#!/bin/sh" on your script? It sometimes help. And try to no rely on your PATH variable maybe. But again, have the start.sh at hand would make things much easier.
 
English isn't ptitSeb's first language like many here, so sometimes people's harmless messages come off as a bit blunt unintentionally. Just something to keep in mind.

Will do. Apologies, it's just the way that it came off.

But again, it's all about efficiancy. No one asked you to prove you have done all sanity test. This is not this kind of community here. You write you did, it's enough.
It's a technical community, that is all about code, script, low level detail...

Efficiency is great but it's always the small things that get ignored which causes the most frustration. With regards to this community, coming from the GP2X days where you had a frontend and comparatively little to worry about to being on a full linux system with external libraries, shell scripts etc. there's a lot that can do wrong that has nothing to do with code. As a developer for many years, this stuff still trips me up from time to time.

Using this project as an example, I was having an issue with the compiler complaining about this:

In function `_start': init.c: (.text+0x30): undefined reference to `main'

There was nothing wrong with the code as it was a source port
I was pretty sure nothing was wrong with my makefile as it was a modified one from my GP2X days and the console output looked fine.
It turned out that I'd forgotten to rename the src folder to _src and the compiler wasn't picking up the code properly

Sure, it could be argued that it was a script (makefile) problem but that makefile has helped me through the GP2X days and I had no reason to suspect it - other than maybe the libs were incorrectly ordered.

As an aside, when I was researching the problem, I did see a post from someone here having the same issue with their cross-compile. I didn't get chance to check to see if that was resolved - if not maybe the above helps?

Anyway, start.sh:

Code:
#!/bin/sh
export HOME=`pwd`
export HOME=$(pwd)
export LD_LIBRARY_PATH=`pwd`
export LD_LIBRARY_PATH=`pwd`/libs
./Zombiepox

PXML:

XML:
<?xml version="1.0" encoding="UTF-8"?>
<PXML xmlns="http://openpandora.org/namespaces/PXML">
    <package id="zombiepox.jamesdunn">
        <author name="James Dunn" website="http://www.stupendous-stuff.com"/>
        <version major="1" minor="0" release="0" build="0"/>
        <titles>
            <title lang="en_US">Zombiepox</title>
        </titles>
        <icon src="./Zombiepox/ld48.png"/>
    </package>
    <application id="zombiepox.jamesdunn">
        <exec command="sh" arguments="./Zombiepox/start.sh"/>
        <author name="T"/>
        <version major="1" minor="0" release="0" build="0"/>
        <titles>
            <title lang="en_US">Zombiepox</title>
        </titles>
        <!--Extra block for compatibility with OS versions before HF6-->
        <title lang="en_US">Zombiepox</title>
        <!--END Extra block-->
        <licenses>
            <license name="none"/>
        </licenses>
        <icon src="./Zombiepox/ld48.png"/>
        <categories>
            <category name="Game">
                <subcategory name="ActionGame"/>
            </category>
        </categories>
    </application>
    <!--Created with the PXMLCreator of PNDTools v.0.7.3-->
</PXML>
 
I'm unsure how your PND is organized: but I assume it's the regular "everything in the root of the pnd" kind of organization, with the binary "Zombiepox" in the root of the pnd, and the supporting libs ib "lib" folder (and maybe an empty "bin" folder).
I assume the "start.sh" to also be in the root of the PND, so this:
Code:
<exec command="sh" arguments="./Zombiepox/start.sh"/>
should simply be
Code:
<exec command="sh" arguments="start.sh"/>
in the PXML.
Also, allong with the application ID, I prefer to define the appdata folder.
So
Code:
<application id="zombiepox.jamesdunn">
can be this
Code:
<application id="zombiepox.jamesdunn" appdata="Zombiepox">
but that's not mendatory.

(also, I always do my PXML by hand, so not sure on how to do this using PNDtools)
 
I've got a little more movement - mounting the pnd and running via sh runs the program but executing the PND doesn't do anything.

I've located the pndrun_*.out file and this is what it says:


=======================================================================================
PND : /media/pand1/pandora/menu/Zombiepox.pnd
PND_FSTYPE : Squashfs
APPDATADIR : /media/pand1/pandora/appdata/zombiepox.jamesdunn
APPDD_FSTYPE : ext2
PND_CPUSPEED : <unset>
EXENAME : sh
ARGUMENTS : start.sh
=======================================================================================
[ START ]--- Mount the PND ----------
Mounting : mount -t squashfs -o ro "/dev/loop0" "/mnt/utmp/zombiepox.jamesdunn"
Mounting the Union FS : mount -t aufs -o exec,dirs="/media/pand1/pandora/appdata/zombiepox.jamesdunn=rw+nolwh":"/mnt/pnd/zombiepox.jamesdunn=rr" none "/mnt/utmp/zombiepox.jamesdunn"
[SUCCESS]--- Mount the PND ----------
[ START ]--- Starting the application ( sh start.sh ) ----------
/usr/pandora/scripts/pnd_run.sh: line 569: ./sh: No such file or directory
[ FAILED]--- Starting the application ( sh start.sh ) ----------
[ START ]--- Restoring the frame buffer status ----------
[SUCCESS]--- Restoring the frame buffer status ----------
[ START ]--- Restoring nub mode ----------
[SUCCESS]--- Restoring nub mode ----------
[ START ]--- uMount the PND ----------
[ START ]--- Waiting the Union to be available ----------
[SUCCESS]--- Waiting the Union to be available ----------
rmdir: failed to remove `/mnt/utmp/zombiepox.jamesdunn': Device or resource busy
[ START ]--- Waiting the PND mount dir to be free ----------
[SUCCESS]--- Waiting the PND mount dir to be free ----------
cleanup done
[SUCCESS]--- uMount the PND ----------
=======================================================================================
Return code is : 3
 
Ah good, progress.

I think the "exec" command is wrong. Try this one:
Code:
<exec background="true" standalone="true" x11="req" command="start.sh"/>
 
Brill!
That worked via the pnd.

Not sure I need x11. I'll play around with that.

Thank you all for the help.

Just got to add a few bits to this, do some testing. Then I can release.

Code:
     <icon src="./Zombiepox/ld48.png"/>
This also needs to be adjusted (your video shows you're missing an icon) :)
I saw that. Already fixed. Thanks again! :)
 
Back
Top