1996-05-05 16:17:03 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# usage: writeboot <boot_file> <boot_device(raw)>
|
|
|
|
#
|
1998-01-05 23:51:25 +03:00
|
|
|
# $NetBSD: writefdboot,v 1.2 1998/01/05 20:52:18 perry Exp $
|
1996-05-05 16:17:03 +04:00
|
|
|
|
|
|
|
temp=/tmp/writeboot$$
|
|
|
|
|
|
|
|
case "$#" in
|
|
|
|
2) ;;
|
|
|
|
*) echo "usage: `basename $0` fdboot /dev/rfd?a" >&2
|
|
|
|
exit 1;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
trap "rm -f $temp; exit 1" 1 2 3 15
|
|
|
|
rm -f $temp
|
|
|
|
( dd if=$1 bs=64 count=1
|
|
|
|
dd if=$2 bs=1024 count=1 | dd bs=64 skip=1 count=7
|
|
|
|
dd if=$1 bs=256 skip=2 ) > $temp
|
|
|
|
|
|
|
|
cat $temp /dev/zero | dd bs=1024 count=4 of=$2
|
|
|
|
rm -f $temp
|