[G1 Android Development] Firerat:
the ones in posts 2 and 3 not what you are after?

anyway, you should be using cm5 ;)

I have noneDanger patche

you have to get the updater script to run this script *after* the system format, and before the system files are copied

InstallPrep.sh ( root of the zip )

#!/sbin/sh

gogogo ()
{
mount /cache
Block4=`df |grep block4|sed -e s~\ \ \ ~\ ~g -e s~\ \ ~\ ~g -e s~\ \ ~\ ~g|cut -d " " -f2|head -n1`
if [ `expr $Block4 \/ 1024` -lt "67" ];
then
Danger
elif [ `expr $Block4 \/ 1024` -gt "67" ];
then
MT3G
else
NoneDanger
fi
}

PrepBase ()
{
mount /system
if [ ! -d /system/sd ];
then
mkdir /system/sd
fi
mount -a
return
}

banner ()
{
if [ ! -d /system/etc/init.d ];
then
install -d /system/etc/init.d
fi

cat > /system/etc/init.d/00ndbanner << "EOF"
#!/system/bin/sh
#
# indicate tainted
L="log -p i -t cm"
$L "
) (
( /( )\ )
)\()) ( (()/( ) ( ( ( (
((_)\ ( ( ))\ /(_)) ( /( ( )\))( ))\ )(
_((_) )\ )\ ) /((_|_))_ )(_)) )\ )((_))\ /((_|()\
| \| |((_)_(_/((_)) | \((_)_ _(_/( (()(_|_)) ((_)
| .\` / _ \ ' \)) -_) | |) / _\` | ' \)) _\` |/ -_)| '_|
|_|\_\___/_||_|\___| |___/\__,_|_||_|\__, |\___||_|
|___/"
EOF
chmod 700 /system/etc/init.d/00ndbanner
return
}

Danger ()
{
PrepBase
echo "no action required"
return
}

MT3G ()
{
PrepBase
echo "no action required"
return
}

NoneDanger ()
{
PrepBase
install -d /data/local
install -d /system/media
for i in bootanimation.zip;do
ln -s /data/local/$i /system/media/$i
done
mkdir /data/gapps
install -d /system/app
for i in BugReport.apk EnhancedGoogleSearchProvider.apk GenieWidget.apk Gmail.apk GmailProvider.apk GoogleApps.apk GoogleBackupTransport.apk GoogleCheckin.apk GoogleContactsSyncAdapter.apk GooglePartnerSetup.apk GoogleSettingsProvider.apk GoogleSubscribedFeedsProvider.apk gtalkservice.apk LatinImeTutorial.apk Maps.apk MarketUpdater.apk MediaUploader.apk NetworkLocation.apk PassionQuickOffice.apk SetupWizard.apk Street.apk Talk.apk TalkProvider.apk Vending.apk VoiceSearch.apk YouTube.apk;do
ln -s /data/gapps/$i /system/app/$i
done
cat > /dev/10bind-dc << "EOF"
#!/system/bin/sh
if [ -e /cache/dalvik-cache ] && [ ! -d /cache/dalvik-cache ];
then
rm /cache/dalvik-cache
fi

if [ ! -d /cache/dalvik-cache ];
then
install -m 771 -o 1000 -g 1000 -d /cache/dalvik-cache
fi

rm /data/dalvik-cache/*
busybox mount -o bind /cache/dalvik-cache /data/dalvik-cache
EOF
install -m 700 -D /dev/10bind-dc /system/etc/init.d/10bind-dc
banner
return
}

# ok, lets start
gogogo
exit 0

section I inserted in bold

META-INF/com/google/android/updater-script

package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
run_program("/tmp/backuptool.sh", "backup");
show_progress(0.200000, 10);
format("MTD", "system");
[B]ui_print("Check for NoneDangerSPL...");
package_extract_file("InstallPrep.sh", "/tmp/InstallPrep.sh");
set_perm(0, 0, 0777, "/tmp/InstallPrep.sh");
run_program("/tmp/InstallPrep.sh");
ui_print("Check for NoneDangerSPL complete");[/B]
ui_print("Installing system...");
mount("MTD", "system", "/system");
show_progress(0.500000, 40);
package_extract_dir("recovery", "/system");

NB this is not cachehack,

I will probably move this to its own thread

Edit : :( my banner didn't work quite like I wanted it to :(

I'll tidy it up :)

edit2: better banner :)