From d1e063beb43e595680c65e3804d1f8ddff53373b Mon Sep 17 00:00:00 2001 From: Guido Guenther Date: Sat, 18 Nov 2006 23:48:07 +0100 Subject: Imported Debian version 0.3.8.8 --- tip22/tip32 | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 tip22/tip32 (limited to 'tip22/tip32') diff --git a/tip22/tip32 b/tip22/tip32 new file mode 100755 index 0000000..0e91bb2 --- /dev/null +++ b/tip22/tip32 @@ -0,0 +1,51 @@ +#! /bin/sh -e +# +# Merges kernel and ramdisk into one ELF bootimage + +SUBARCH=IP32 + +LIBDIR=/usr/lib/tip22 +TIP22=$LIBDIR/tftpload.$SUBARCH.o +ARCLIB=$LIBDIR/libarc.a +LD_KERNEL=$LIBDIR/ld.kernel.script.$SUBARCH +LD_RAMDISK=$LIBDIR/ld.ramdisk.script.$SUBARCH +LD_SCRIPT=$LIBDIR/ld.script.$SUBARCH +LDFLAGS="-n" +LD=/usr/bin/ld +MKTEMP=/bin/mktemp + +usage() { + echo "`basename $0` vmlinux initrd outfile" + exit 1 +} + +if [ "$#" != "3" ]; then + usage +fi + +if ! file $2 | grep 'gzip compressed data' > /dev/null 2>&1; then + echo "$2 is no gzip compressed ramdisk". + usage +fi + +if ! file $1 | grep 'ELF .* MIPS' > /dev/null 2>&1; then + echo "$1 is no ELF kernel". + usage +fi + +if [ ! -x $MKTEMP ]; then + echo "Need mktemp." + exit 1 +fi + +if ! TMPDIR=`mktemp -d`; then + echo "mktemp failed." + exit 1 +fi + +echo -n "Merging kernel \"$1\" and ramdisk \"$2\" into bootimage \"$3\"..." +${LD} -T $LD_KERNEL -b binary -o $TMPDIR/kernel.o $1 +${LD} -T $LD_RAMDISK -b binary -o $TMPDIR/ramdisk.o $2 +${LD} -T $LD_SCRIPT ${LDFLAGS} -o $3 ${TIP22} ${ARCLIB} $TMPDIR/kernel.o $TMPDIR/ramdisk.o +rm -rf $TMPDIR +echo "done." -- cgit v1.2.3