You could just add
> /firstrun

In the script. It creates an empty file named /firstrun, so if the base tarball is missing it the player won't try to extract the tarball on every run.

Combine that with extracting all tarballs in a given directory, and we have a basic installer that can even deal with upgrading applications by uploading a new tarball and then rebooting the player.

M00firstrun:
#!/bin/bash
cd /
for tgz in *.tgz ; do
base=`basename "$tgz"
stamp="/firstrun.$base"
if [ ! -e "$stamp" -o "$stamp" -ot "$tgz" ] ; then
rw ; rwm ; rwp
tar -xzf "$tgz"
> "$stamp"
rop; rom; ro
fi
done

Although if applications just limit themselves to /programs0 all of this isn't necessary. Just install preinit as /sbin/hijack after an upgrade and we're done.
_________________________
40GB - serial #40104051 gpsapp