Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#121359 - 17/10/2002 00:01 restore apps in one easy step after upgrade..kinda
image
old hand

Registered: 28/04/2002
Posts: 770
Loc: Los Angeles, CA
ok, i was thinking about this during work. if you take time to set it up correctly, then this should work.

say you reapply the b13 upgrade file and hijack. the next step is to use wfaulk's preinit ftp script, with the additions of mkdir /programs0 and /programs1 (so it will automount right afterwards). in /programs0/preinit.d, have a M99reupgrade shell script that checks if a certain file is in the root partition. if not, it copies whatever needs to be in the partition(index.html, rsync, libraries, ntptime, modified mtab/fstab, etc.) and the file that it will check for next time. last command is a reboot -f, and then thats it. you're back to what you were before you reflashed. the problem is that you have to keep track of what you modify in the / partition. what i've done is just have /programs0/base with all files, and do a cp /programs0/base / -r.

sound good?

Top
#121360 - 17/10/2002 03:15 Re: restore apps in one easy step after upgrade..kinda [Re: image]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5680
Loc: London, UK
I just keep a base.tar.gz and configs.tar.gz in /drive0. After an upgrade, it's a simple matter of untarring them.

Works for me. However, I don't use preinit or anything like that, so it might get complicated.
_________________________
-- roger

Top
#121361 - 17/10/2002 09:10 Re: restore apps in one easy step after upgrade..kinda [Re: Roger]
image
old hand

Registered: 28/04/2002
Posts: 770
Loc: Los Angeles, CA
borrowing from your method...

install.ftp for preinit should be this:

quote site rw
cd /
quote mkd programs0
quote mkd programs1
cd /bin
bin
put empeg-preinit hijack
quote site chmod 755 hijack
quote site ro
quit

i keep a base.tar.gz in my /programs0 dir, and have the M99firstrun script in /programs0/preinit.d which consists of:

if [ -s /firstrun ]; then
echo "base.tar.gz already applied"
else
rw
cd /
tar zxvf /programs0/base.tar.gz
ro
reboot -f
fi

firstrun is a file in base.tar.gz of course.


Edited by iMaGe (17/10/2002 09:12)

Top
#121362 - 17/10/2002 09:42 Re: restore apps in one easy step after upgrade..k [Re: image]
jaharkes
enthusiast

Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
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

Top