From: Evgeniy Ivanov Date: Wed, 15 Feb 2012 02:51:27 +0000 (+0100) Subject: updateboot script for netbsd bootloader X-Git-Tag: v3.2.0~30 X-Git-Url: http://zhaoyanbai.com/repos/man.delv.html?a=commitdiff_plain;h=9ab3cf37ce3f09d2d66105b1451a4deceb39a506;p=minix.git updateboot script for netbsd bootloader --- diff --git a/commands/Makefile b/commands/Makefile index de07aa4f2..557a34c39 100644 --- a/commands/Makefile +++ b/commands/Makefile @@ -33,7 +33,7 @@ SUBDIR= add_route arp ash at autil awk \ unstack update uud uue version vol wc \ whereis which who write writeisofs fetch \ xargs yacc yes zdump zmodem pkgin_cd \ - mktemp worldstone + mktemp worldstone updateboot .if ${ARCH} == "i386" SUBDIR+= atnormalize dosread fdisk loadfont \ diff --git a/commands/updateboot/Makefile b/commands/updateboot/Makefile new file mode 100644 index 000000000..81200bda1 --- /dev/null +++ b/commands/updateboot/Makefile @@ -0,0 +1,5 @@ +SCRIPTS= updateboot.sh +BINDIR= /bin +MAN= + +.include diff --git a/commands/updateboot/updateboot.sh b/commands/updateboot/updateboot.sh new file mode 100755 index 000000000..18a7a54f7 --- /dev/null +++ b/commands/updateboot/updateboot.sh @@ -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