Startup Script To Run When Gp2x Turns On? (on Sd)


Nurg

Still Fresh
Joined
Mar 6, 2007
Messages
9
How can I get my GP2x to start an application on the SD card when i turn it on? Sort of like an autoexec.bat on the SD card?

I want to have an SD card for music that boots right into gmu if its there at startup.

I'm sure I read something somewhere about this, but I can't find anything now.
 
eNRGy said:
How can I get my GP2x to start an application on the SD card when i turn it on? Sort of like an autoexec.bat on the SD card?

I want to have an SD card for music that boots right into gmu if its there at startup.

I'm sure I read something somewhere about this, but I can't find anything now.
put a file in the root of the card called "autorun.gpu"
 
Last edited by a moderator:
Ah, thanks.

The wiki could do with a page explaining the very basics of Linux scripting, for those of us who just want to launch an app at startup.

I understand the basics as I can write .bat files for dos, but I'm still struggling here.

With an autorun.gpu file all I get is a blank screen.. even if all the file does is call the menu:

CODE
#!/bin/sh
exec /usr/gp2x/gp2xmenu


What am I doing wrong?

This is what I'm really after:
CODE
#!/bin/sh
exec ./gmu-0.5.0/gmu.gpu
exec /usr/gp2x/gp2xmenu


Blank screen until I switch off and take the card out.

Is the working directory the same as the SD root? (autorun.gpu being in the SD root)
 
I'm still just getting stuck with a blank screen.

After doing a bit more reading, my script now looks like this:

CODE
#!/bin/sh
cd /tmp/mnt/sd/gmu-0.5.0
exec gmu.gpu -r ../Music/

# return to the menu screen
cd /usr/gp2x
sync
exec /usr/gp2x/gp2xmenu


Still exactly the same black screen.

I'm using Linux line-ends.. I must be missing something obvious here..

[EDIT] Actually at startup it now gets stuck at the green "Loading... GP2X blah blah" splash screen. Launching the script from the Game menu still gives the blank screen.
[EDIT] Fixed typo in script
 
Looks like I forgot the ./ in front of gmu.gpu ... I thought it would be something dumb I was doing! :unsure:

It works great now, and my final autorun.gpu looks like this:
CODE
#!/bin/sh
cd /tmp/mnt/sd/gmu
./gmu.gpu -m

# return to the menu screen
cd /usr/gp2x
sync
exec /usr/gp2x/gp2xmenu --disable-autorun



This will only work for programs that don't start the menu when you quit, otherwise quiting will keep restarting the program, via the menu's autorun. (gmu -m stops it from starting the menu)

Hope this is of use to some other linux n00b :) .
 
Back
Top