#!/bin/sh -e DVHTOOL=/usr/sbin/dvhtool ARCBOOT_IMG=/usr/lib/arcboot/arcboot.ip22 ARCBOOT_CONF=/etc/arcboot.conf # system type : RM200-C40 SYSTYPE=`sed -ne '/^system type/ { s/.*: //; p; }' " exit 1 fi echo -n "Putting `basename $ARCBOOT_IMG` into the volume header of $1 as $VHNAME ..." $DVHTOOL -d $1 --unix-to-vh $ARCBOOT_IMG $VHNAME echo "done." # check if the "image=" lines in $ARCBOOT_IMG refer to valid ELF images for i in `grep "^[[:space:]]*image=" $ARCBOOT_CONF`; do IMAGE=`echo $i | cut -d'=' -f2`; if [ -L $IMAGE ]; then # if it's a symlink, follow it IMAGE=`dirname $IMAGE`/`readlink $IMAGE` fi if [ "$(dd if=$IMAGE bs=4 count=1 2>/dev/null)" != "$(printf '\177ELF')" ]; then echo "Warning: $IMAGE is not an ELF image. Booting it will fail!" fi done # TODO: better sanity checking of $ARCBOOT_CONF