From 32817c02bd400ee0a20db12840f6717ddf55b6d8 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Wed, 25 Mar 2015 10:27:18 -0600 Subject: [PATCH] do not install boot stuff by default --- snap | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/snap b/snap index 64a83ea..6caac67 100755 --- a/snap +++ b/snap @@ -1,6 +1,6 @@ #!/bin/ksh -version=1.0.4 +version=1.0.5 grey="\033[01;30m" red="\033[01;31m" @@ -42,7 +42,7 @@ snap options: -B do not backup current kernel. -u check for update to snap script. -U download new snap script (will replace currently installed version). - -b do not run installboot (not implemented). + -b device to install bootstrap to. -h help. Examples: @@ -248,7 +248,7 @@ SETVER=$(uname -r | sed -e 's/\.//') VER=$(uname -r) CHK_UPDATE=$(get_conf_var 'CHK_UPDATE' || echo 'false') INS_UPDATE=$(get_conf_var 'INS_UPDATE' || echo 'false') -NO_INSTBOOT=$(get_conf_var 'NO_INSTBOOT' || echo 'false') +INSTBOOT=$(get_conf_var 'INSTBOOT') MIRROR=$(get_conf_var 'MIRROR' || echo 'ftp3.usa.openbsd.org') @@ -309,7 +309,7 @@ while getopts "sSfea:sm:sv:srV:spxR:sAM:shiBknuUb" arg; do INS_UPDATE=true ;; b) - NO_INSTBOOT=true + INSTBOOT=$(echo $OPTARG) ;; esac done @@ -421,11 +421,9 @@ msg "${white}Fetching from: ${green}${URL}" echo "Don't forget to run:\n\tsysmerge -s ${DST}/etc${SETVER}.tgz -x ${DST}/xetc${SETVER}.tgz" fi - if [ $NO_INSTBOOT == false ]; then - boot_disk=$(sysctl hw.disknames | cut -d= -f2 | cut -d: -f1) - dmesg | grep "root on" | grep -q $boot_disk || error "Can't detect root disk! Manually run installboot!" - msg "Installing bootstrap on ${boot_disk}" - installboot -v $boot_disk || error "Something bad happened - check your boot disk!" + if [ $INSTBOOT ]; then + msg "Installing bootstrap on ${INSTBOOT}" + installboot -v $INSTBOOT || error "Something bad happened - check your boot disk!" fi date > ~/.last_snap