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.
This commit is contained in:
parent
af0ec0d1d4
commit
48830f7cb1
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/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 () {
|
vecho () {
|
||||||
@ -59,21 +59,13 @@ fi
|
|||||||
WHAT=$1
|
WHAT=$1
|
||||||
DEST=$2
|
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
|
if [ ! -d $DEST ]; then
|
||||||
echo "$DEST: not a directory"
|
echo "$DEST: not a directory"
|
||||||
Usage
|
Usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ $KARCH = sun4 ]; then SKIP=1; else SKIP=0; fi
|
SKIP=0
|
||||||
|
|
||||||
|
|
||||||
case $WHAT in
|
case $WHAT in
|
||||||
"ffs")
|
"ffs")
|
||||||
@ -99,16 +91,25 @@ case $WHAT in
|
|||||||
TARGET=$DEST/boot
|
TARGET=$DEST/boot
|
||||||
vecho Boot device: $DEV
|
vecho Boot device: $DEV
|
||||||
vecho Target: $TARGET
|
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
|
sync; sync; sync
|
||||||
vecho installboot ${VERBOSE:+-v} $TARGET ${MDEC}/bootxx $DEV
|
vecho installboot ${VERBOSE:+-v} $TARGET ${MDEC}/bootxx $DEV
|
||||||
$DOIT installboot ${VERBOSE:+-v} $TARGET ${MDEC}/bootxx $DEV
|
$DOIT installboot ${VERBOSE:+-v} $TARGET ${MDEC}/bootxx $DEV
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"net")
|
"net")
|
||||||
TARGET=$DEST/boot.sparc.netbsd.$KARCH
|
TARGET=$DEST/boot.sparc.netbsd
|
||||||
|
TMP=/tmp/boot.$$
|
||||||
vecho Target: $TARGET
|
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
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
Loading…
Reference in New Issue
Block a user