updateboot script for netbsd bootloader

This commit is contained in:
Evgeniy Ivanov 2012-02-15 03:51:27 +01:00 committed by Ben Gras
parent 47c1f10835
commit 9ab3cf37ce
3 changed files with 46 additions and 1 deletions

View file

@ -33,7 +33,7 @@ SUBDIR= add_route arp ash at autil awk \
unstack update uud uue version vol wc \ unstack update uud uue version vol wc \
whereis which who write writeisofs fetch \ whereis which who write writeisofs fetch \
xargs yacc yes zdump zmodem pkgin_cd \ xargs yacc yes zdump zmodem pkgin_cd \
mktemp worldstone mktemp worldstone updateboot
.if ${ARCH} == "i386" .if ${ARCH} == "i386"
SUBDIR+= atnormalize dosread fdisk loadfont \ SUBDIR+= atnormalize dosread fdisk loadfont \

View file

@ -0,0 +1,5 @@
SCRIPTS= updateboot.sh
BINDIR= /bin
MAN=
.include <bsd.prog.mk>

View file

@ -0,0 +1,40 @@
#!/bin/sh
set -e
MDEC=/usr/mdec
BOOT=/boot_monitor
ROOT=`printroot -r`
if [ ! -b "$ROOT" ]
then
echo root device $ROOT not found
exit 1
fi
echo -n "Install boot as $BOOT on current root? (y/N) "
read ans
if [ ! "$ans" = y ]
then
echo Aborting.
exit 1
fi
echo "Installing boot monitor into $BOOT."
cp $MDEC/boot_monitor $BOOT
disk=`echo "$ROOT" | sed 's/s[0-3]//'`
echo -n "Install bootxx_minixfs3 into $disk? (y/N) "
read ans
if [ ! "$ans" = y ]
then
echo Exiting...
sync
exit 0
fi
echo "Installing bootxx_minixfs3 into $disk."
installboot_nbsd "$disk" "$MDEC/bootxx_minixfs3"
sync