fixed a breakage introduced by the uclibc-snapshot version
[kvm-coreboot.git] / bin / setsig.sh
blob28cd2fb21cb4f0ac98974f295ee1f847bf66beda
1 #!/bin/sh
3 # These should be fairly static - we can make them dynamic if we have to
5 START="FFFC0"
6 LEN="16"
8 STR_BEGIN=`dc -e "16 i FFFC0 p"`
9 STR_END=`expr $STR_BEGIN + $LEN`
11 IN=$1
12 SIG=$2
13 OUT=$3
15 if [ -z "$IN" -o -z "$SIG" ]; then
16 echo "usage: ./setsig.sh <input> <sig> <output>"
17 exit 1
20 if [ -z "$OUT" ]; then
21 OUTPUT=/dev/stdout
24 dd if=$IN bs=$STR_BEGIN count=1 > $OUT 2>/dev/null
25 echo -n "$SIG" >> $OUT
26 dd if=$IN bs=$STR_END skip=1 >> $OUT 2>/dev/null