summaryrefslogtreecommitdiff
path: root/simpad-utilities/genboot
diff options
context:
space:
mode:
authorMichael Lauer <mickey@vanille-media.de>2004-04-09 10:06:41 +0000
committerMichael Lauer <mickey@vanille-media.de>2004-04-09 10:06:41 +0000
commit4c4b22bf3aa41f4db62611349f4cac670b3b1998 (patch)
tree735275d294110aac5fbc95fea4a9ee42e6db017a /simpad-utilities/genboot
parent6c6bdccb08a7e65f69d76e9e3bde327fac2f8a3f (diff)
make simpad-make-flashimg usable outside of OpenZaurus buildroot :)
BKrev: 407675b1iC_CZSu83ZcBKm8emG5rag
Diffstat (limited to 'simpad-utilities/genboot')
-rw-r--r--simpad-utilities/genboot/simpad-make-flashimg89
1 files changed, 89 insertions, 0 deletions
diff --git a/simpad-utilities/genboot/simpad-make-flashimg b/simpad-utilities/genboot/simpad-make-flashimg
index e69de29bb2..70818180db 100644
--- a/simpad-utilities/genboot/simpad-make-flashimg
+++ b/simpad-utilities/genboot/simpad-make-flashimg
@@ -0,0 +1,89 @@
+#!/bin/sh
+# Script to build a full (kernel+initrd) flash rom bootimage
+# (C) 2003-2004 Michael 'Mickey' Lauer <mickey@Vanille.de>
+# Use serload to flash the image on your SIMpad
+
+#
+# vars
+#
+GENBOOT=genboot
+PAD=pad
+KERNEL=$2
+OUTPUT_DIR=$3
+
+doComplete()
+{
+ kernel=$(basename $KERNEL)
+ initrd=$OUTPUT_DIR/images/initrd.bin
+ outfile=/tmp/tmpfile
+ padfile=/tmp/tmpfile2
+ flashfile=$kernel.initrd.flashfile
+
+ cp -f $KERNEL $padfile
+ $PAD 1048556 $padfile
+ cat $padfile $initrd >$outfile
+ set X`ls -l $outfile`
+ filelen=$5
+
+ loader_start="0xc0208000"
+ loader_entry="0xc0208000"
+
+ echo "File: $flashfile Exec: $loader_entry $filelen "
+ $GENBOOT -d3 $loader_entry 1 $loader_start $filelen >$OUTPUT_DIR/bheader
+ cat $OUTPUT_DIR/bheader $outfile >$flashfile
+ rm $outfile
+ rm $padfile
+ exit 0
+}
+
+doKernel()
+{
+ kernel=$(basename $KERNEL)
+ outfile=/tmp/tmpfile
+ flashfile=$kernel.flashfile
+
+ cat $KERNEL >$outfile
+ set X`ls -l $outfile`
+ filelen=$5
+
+ loader_start="0xc0208000"
+ loader_entry="0xc0208000"
+
+ echo "File: $flashfile Exec: $loader_entry $filelen "
+ $GENBOOT -d3 $loader_entry 1 $loader_start $filelen >$OUTPUT_DIR/bheader
+ cat $OUTPUT_DIR/bheader $outfile >$flashfile
+ rm $outfile
+ exit 0
+}
+
+doKernelInPlace()
+{
+ kernel=$(basename $KERNEL)
+ outfile=/tmp/tmpfile
+ flashfile=$kernel.flashfile
+
+ cat $KERNEL >$outfile
+ set X`ls -l $outfile`
+ filelen=$5
+
+ loader_start="0xc0080000"
+ loader_entry="0xc0080000"
+
+ echo "File: $flashfile Exec: $loader_entry $filelen "
+ $GENBOOT $loader_entry 1 $loader_start $filelen >$OUTPUT_DIR/bheader
+ cat $OUTPUT_DIR/bheader $outfile >$flashfile.inplace
+ rm $outfile
+ exit 0
+}
+
+if [ $# -lt 3 ]
+ then echo "Usage: ./simpad-make-flashimg [kernel|complete|inplace] <kernel> <output-dir>" && exit -1
+fi
+
+case "$1" in
+kernel) doKernel;;
+complete) doComplete;;
+inplace) doKernelInPlace;;
+*) echo "Usage: ./simpad-make-flashimg [kernel|complete|inplace] <kernel> <output-dir>"; exit;;
+esac
+