Run A Program At Startup?


thetictacaddict

Still Fresh
Joined
Nov 28, 2005
Messages
55
Age
36
Location
MI, USA
I downloaded the USB serial program a few days ago, and it's fun to poke around the file system. For one, it's easy to copy files to NAND (I copied the CPU/LCD tweaker and Serial program there. Also mplayer_tv.gpu, because I'm using firmware 1.1.0 and don't want to upgrade because of Video Sync issues in later firmware).

The main thing I want to do, though, is to run the LCD tweaker at bootup. I'm pretty sure that I've heard this can't be done. If that's the case, maybe someone can give me some reasons why the methods I tried didn't work.

I noticed that when I mounted the SD card without specifying the file system type, it used msdos instead of vfat, and when browsing for files with the music player etc, files and folders had their names shortened (using that thing with the ~). I don't think that's relevent, but I thought it was interesting.

I wanted to run the LCD tweaker using command line arguments and exit, so I included a command like this, similar to the one in the readme: "/mnt/sd/cpu_speed.gpe 1 2 200 > /mnt/sd/output.txt". UPLL, timing prescaler at 2 and CPU frequency 200Mhz.

First, I came accross /etc/rc.d/rc.local and added that command at the end. It didn't work. This leads me to believe that rc.local isn't run at startup, /mnt/nand isn't mounted yet (although mount doesn't show anything mounted to that directory), or I'm overlooking something. Could I safely put the command in rc.sysetm or something else?

The other thing I tried was to to rename "/usr/gp2x/gp2xmenu" and replace it with a script called gp2xmenu that would run the CPU/LCD tweaker then, cd to /usr/gp2x and exec /usr/gp2x/gp2xmenu. The script executed fine (once I remembered to make it executable) when I specifically ran it, but didn't run when I rebooted. Apparently, running /usr/gp2x/gp2xmenu isn't the only way to bring the menu up. It occurs to me now that when I run programs like the video player or image viewer from the USB serial terminal, they exit back to the USB serial program. By the way, if I mess up or delete some important system files, will a firmware upgrade set me straight?

So, er, any ideas? Other comments on the USB serial program?
 
use /etc/profile for running stuff at boot. sucks i know.

also, edit /etc/fstab and make / mount with rw,noatime to save on nand writes.

I also added:

tmpfs /tmp tmpfs size=4M 0 0

to /etc/fstab since screen creates stuff in /tmp, again to save on nand writes.

I also:
rm /var/log/wtmp
mkdir /var/log/wtmp

as otherwise this file gets appended to every boot. After 100 years your nand would fill up! :)
 
thetictacaddict posted on Feb 12 2006 at 08:26 AM said:
because I'm using firmware 1.1.0 and don't want to upgrade because of Video Sync issues in later firmware).



I never have video sync issues any more. I do two pass xvid encoding and make sure the audio is reencoded at 128kbps CBR MP3. Use AutoGK and you should be just fine.
 
Last edited by a moderator:
theoddbot posted on Feb 11 2006 at 06:54 PM said:
After 100 years your nand would fill up!
What is wtmp for?

Anyway, theoddbot, thanks, I replaced wtemp with a directory, and took your other advice as well. After looking at /etc/profile, I realized that /usr/gp2x/gp2xmenu is executed to bring up the menu at boot time after all. In hindsight, replacing gp2xmenu with a script may have worked, and I just didn't realize the LCD was different. Adding a line to /etc/profile is much better, though! What happens with the GP2X needs the extra 4 megabytes allotted to /tmp? Is it just written to the nand like normal?

Fomit, I do use AutoGK, but I throw some files on the card without re-encoding, and they usually work pretty well on 1.1.0.
 
Last edited by a moderator:
I'd suggest grabbing the gp2xmenu executable from Firmware 1.4 too, not only does it have an LCD tweaker built in that is saved between sessions, it downclocks to 66Mhz whilst in the menu to save power, and no longer jumps several options when using the joystick to try and move just one. The obvious disadvantage is that since it changes the cpu speed, it effectively kills off any programs that overclock the gp2x, so you need to include them in the emu/app itself, or run the overclocker in a script before the emu/app.
 
theoddbot posted on Feb 12 2006 at 08:54 AM said:
use /etc/profile for running stuff at boot. sucks i know.

also, edit /etc/fstab and make / mount with rw,noatime to save on nand writes.

I also added:

tmpfs /tmp tmpfs size=4M 0 0

to /etc/fstab since screen creates stuff in /tmp, again to save on nand writes.

I also:
rm /var/log/wtmp
mkdir /var/log/wtmp

as otherwise this file gets appended to every boot. After 100 years your nand would fill up! :)

Have you contacted GPH to make your suggestions concerning the life of the NAND or are those writes so infrequent that it will not make a difference?
 
Last edited by a moderator:
Back
Top