=================================================================== RCS file: /cvs/openbsd/update_openbsd/update_openbsd,v retrieving revision 1.106 retrieving revision 1.110 diff -u -r1.106 -r1.110 --- openbsd/update_openbsd/update_openbsd 2017/12/11 03:12:34 1.106 +++ openbsd/update_openbsd/update_openbsd 2018/10/01 00:31:27 1.110 @@ -1,5 +1,5 @@ #!/bin/sh -# $AFresh1: update_openbsd,v 1.105 2017/12/11 02:58:57 andrew Exp $ +# $AFresh1: update_openbsd,v 1.109 2018/02/08 19:08:01 andrew Exp $ # # Copyright (c) 2012 Andrew Fresh # @@ -101,6 +101,7 @@ boot_device_mounted="" mount_boot_device() { [ "$boot_device_mounted" ] && return + [ "$BOOT_DEVICE" ] || return local default_mount=$( df -lnP /bsd | sed -ne 's!/dev/.* !!p' ) local boot_mount=$( mount | @@ -423,12 +424,14 @@ install_kernels() { - local _d=$1 + local _d="$1" local default_mount local boot_mount local mount_is_msdos - if [ ! "$_d" ]; then + if [ "$_d" ]; then + _d=$( readlink -nf "$_d" ) + else default_mount=$( df -lnP /bsd | sed -ne 's!/dev/.* !!p' ) mount_boot_device @@ -455,13 +458,14 @@ fi [ $_d != / ] && mount | grep -q " on ${_d%/} .* msdos" && mount_is_msdos=1 + [ $_d != / ] && $_d=$_d/ if [ X"$BOOT_KERNEL_VERSION" != X"$NEW_KERNEL_VERSION" ]; then echo "===> Backing up $BOOT_KERNEL to ${_d}obsd" if [ $mount_is_msdos ]; then - cp $BOOT_KERNEL ${_d}obsd + cp ${_d}$BOOT_KERNEL ${_d}obsd else - ln -f $BOOT_KERNEL ${_d}obsd + ln -f ${_d}$BOOT_KERNEL ${_d}obsd fi if [ $? -ne 0 ]; then echo "Error copying old kernel!" >&2 @@ -609,7 +613,7 @@ . ${HOME}/.update_openbsdrc fi -MIRROR=${MIRROR:=http://fastly.cdn.openbsd.org/pub/OpenBSD} +MIRROR=${MIRROR:=http://cdn.openbsd.org/pub/OpenBSD} FTP_CMD=${FTP_CMD:=ftp -V} DESTDIR=${DESTDIR:=/}