=================================================================== RCS file: /cvs/openbsd/update_openbsd/update_openbsd,v retrieving revision 1.46 retrieving revision 1.49 diff -u -r1.46 -r1.49 --- openbsd/update_openbsd/update_openbsd 2012/12/16 03:29:02 1.46 +++ openbsd/update_openbsd/update_openbsd 2013/10/20 01:13:38 1.49 @@ -1,5 +1,5 @@ #!/bin/sh -# $AFresh1: update_openbsd,v 1.45 2012/12/16 01:56:46 andrew Exp $ +# $AFresh1: update_openbsd,v 1.48 2013/01/26 18:13:03 andrew Exp $ # # Copyright (c) 2012 Andrew Fresh # @@ -185,6 +185,10 @@ # We want to default to what we had INSTALL_KERNELS="${BOOT_KERNEL#/}" + # if the boot kernel was our specially named bsd.sp, we install from bsd + if [ X"$INSTALL_KERNELS" == X"bsd.sp" ]; then + INSTALL_KERNELS="bsd" + fi # with a second option of an mp kernel if is is a likely candidate if [ X"$INSTALL_KERNELS" != X"bsd.mp" ]; then local _ncpu=$(sysctl -n hw.ncpufound) @@ -392,7 +396,8 @@ local _v=$FILE_VER - if [ $CUR_VER != $NEW_VER -a ! -e /sbin/oreboot ]; then + if [ X"$BOOT_KERNEL_VERSION" != X"$BOOTED_KERNEL_VERSION" \ + -a ! -e /sbin/oreboot ]; then $SUDO cp /sbin/reboot /sbin/oreboot if [ $? -ne 0 ]; then echo "Error copying old reboot command!" >&2 @@ -441,55 +446,33 @@ update_etc() { echo '### UPDATING ETC ###' if [ ! -e $SYSMERGE ]; then - SYSMERGE= + echo "ERROR: Can't find sysmerge!" >&2 + exit 1; fi - if [ X"" == X"$SYSMERGE" ]; then - if [ -e /var/tmp/temproot ]; then - MERGEMASTER=`which mergemaster` + if [ X"" == X"$RELEASEDIR" ]; then + echo "ERROR: no source for etc!" >&2 + exit 1 + fi - if [ $? != 0 ]; then - $SUDO pkg_add -i mergemaster + cd $RELEASEDIR - MERGEMASTER=`which mergemaster` - if [ $? != 0 ]; then - echo ERROR: mergemaster not installed! >&2 - exit 1 - fi - fi - - echo '### RUNNING MERGEMASTER ###' - $SUDO $MERGEMASTER -irv - else - echo "ERROR: no source for etc!" >&2 - exit 1 - fi + local _v=$FILE_VER + local _args="" + if [ -e etc${_v}.tgz ]; then + _args="$_args -s etc${_v}.tgz" + fi + if [ -e xetc${_v}.tgz ]; then + _args="$_args -x xetc${_v}.tgz" + fi + if [ X"" == X"$_args" ]; then + echo ERROR: No upgrade sets found! >&2 else - if [ X"" == X"$RELEASEDIR" ]; then - echo "ERROR: no source for etc!" >&2 - exit 1 - else - cd $RELEASEDIR - fi - - local _v=$FILE_VER - local _args="" - if [ -e etc${_v}.tgz ]; then - _args="$_args -s etc${_v}.tgz" - fi - if [ -e xetc${_v}.tgz ]; then - _args="$_args -x xetc${_v}.tgz" - fi - if [ X"" == X"$_args" ]; then - echo ERROR: No upgrade sets found! >&2 - else - echo '### RUNNING SYSMERGE ###' - if sysmerge 2>&1 | grep -- -a >/dev/null; then - _args="-a $_args" - fi - $SUDO $SYSMERGE $_args - fi + echo '### RUNNING SYSMERGE ###' + $SUDO $SYSMERGE $_args fi + + cd $OLDPWD } @@ -579,7 +562,7 @@ install_kernels install_sets -if [ $CUR_VER == $NEW_VER ]; then +if [ X"$BOOT_KERNEL_VERSION" == X"$BOOTED_KERNEL_VERSION" ]; then if [ -e /sbin/oreboot ]; then echo Removing /sbin/oreboot $SUDO rm -f /sbin/oreboot