From 48830f7cb161147987abd793af113e216c9d1191 Mon Sep 17 00:00:00 2001 From: pk Date: Fri, 29 Nov 1996 14:59:32 +0000 Subject: [PATCH] ffs bootblock install can be simplified since installboot(8) handles that now. To install a TFTPable boot image, we have to play the header tricks here. --- sys/arch/sparc/stand/binstall.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sys/arch/sparc/stand/binstall.sh b/sys/arch/sparc/stand/binstall.sh index 1b2db4158afb..bf7c12da9e7d 100644 --- a/sys/arch/sparc/stand/binstall.sh +++ b/sys/arch/sparc/stand/binstall.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: binstall.sh,v 1.3 1996/04/07 20:00:12 thorpej Exp $ +# $NetBSD: binstall.sh,v 1.4 1996/11/29 14:59:32 pk Exp $ # vecho () { @@ -59,21 +59,13 @@ fi WHAT=$1 DEST=$2 -if [ "`sysctl -n hw.model | cut -b1-5`" = "SUN-4" ]; then - KARCH=sun4 -else - KARCH=sun4c -fi -vecho "Kernel architecture: $KARCH" - if [ ! -d $DEST ]; then echo "$DEST: not a directory" Usage fi -if [ $KARCH = sun4 ]; then SKIP=1; else SKIP=0; fi - +SKIP=0 case $WHAT in "ffs") @@ -99,16 +91,25 @@ case $WHAT in TARGET=$DEST/boot vecho Boot device: $DEV vecho Target: $TARGET - $DOIT dd if=${MDEC}/boot of=$TARGET skip=$SKIP bs=32 + $DOIT dd if=${MDEC}/boot of=$TARGET bs=32 skip=$SKIP sync; sync; sync vecho installboot ${VERBOSE:+-v} $TARGET ${MDEC}/bootxx $DEV $DOIT installboot ${VERBOSE:+-v} $TARGET ${MDEC}/bootxx $DEV ;; "net") - TARGET=$DEST/boot.sparc.netbsd.$KARCH + TARGET=$DEST/boot.sparc.netbsd + TMP=/tmp/boot.$$ vecho Target: $TARGET - $DOIT dd if=${MDEC}/boot of=$TARGET skip=$SKIP bs=32 + vecho Copying to temporary file. + cp ${MDEC}/boot $TMP; chmod +w $TMP + vecho Stripping $TMP + strip $TMP + vecho Creating header magic. + printf '\01\03\01\07\060\200\0\07' | dd of=$TARGET bs=32 conv=sync + vecho Concatenating boot code. + dd if=$TMP of=$TARGET bs=32 skip=1 seek=1 + rm $TMP ;; *)