
# check for valid standalone magic number
(
errorcode=""
for i in $*
do
    if dd if=$i bs=2 count=1 | grep SA >/dev/null
    then
	: # this is a nop
    else
	echo bootimage: $i is not in standalone a.out format > /dev/tty
	errorcode=bad
    fi
done
if [ -n "$errorcode" ]
then
    exit 1
fi

# they are all ok, now make the boot image.
for i in $*
do
    dd if=$i bs=1k conv=sync
done

# pad with one block of nulls
echo "\0\c" | dd bs=1k conv=sync
) 2>/dev/null | dd 2>/dev/null
exit 0
