Home | History | Annotate | Line # | Download | only in boot
      1  1.1       dbj #!/bin/sh
      2  1.2  christos #	$NetBSD: installboot.sh,v 1.2 2002/07/11 16:03:18 christos Exp $
      3  1.1       dbj 
      4  1.1       dbj # simple installboot program we can use until we have disklabel to do the job.
      5  1.1       dbj # (This one has the advantage that it runs on any architecture. However it
      6  1.1       dbj #  expects the bootblock to be located at a very fixed position.)
      7  1.1       dbj #
      8  1.1       dbj Usage() {
      9  1.1       dbj 	echo "Usage: installboot bootprog device" >&2
     10  1.1       dbj 	if [ -n "$1" ]; then echo "$1" >&2; fi
     11  1.1       dbj 	exit 1
     12  1.1       dbj }
     13  1.1       dbj 
     14  1.1       dbj if [ $# != 2 ]; then Usage; fi
     15  1.1       dbj if [ ! -f $1 ]; then Usage "bootprog must be a regular file"; fi
     16  1.1       dbj if [ ! -c $2 ]; then Usage "device must be a character special file"; fi
     17  1.1       dbj 
     18  1.1       dbj dd if="$1" of="$2" obs=1024 seek=32 conv=osync
     19  1.2  christos dd if="$1" of="$2" obs=1024 seek=96 conv=osync
     20  1.1       dbj exit $?
     21