version 1.106, 2017/12/11 03:12:34 |
version 1.109, 2018/02/08 19:08:01 |
|
|
#!/bin/sh |
#!/bin/sh |
# $AFresh1: update_openbsd,v 1.105 2017/12/11 02:58:57 andrew Exp $ |
# $AFresh1: update_openbsd,v 1.108 2018/02/08 19:07:06 andrew Exp $ |
# |
# |
# Copyright (c) 2012 Andrew Fresh <andrew@afresh1.com> |
# Copyright (c) 2012 Andrew Fresh <andrew@afresh1.com> |
# |
# |
|
|
boot_device_mounted="" |
boot_device_mounted="" |
mount_boot_device() { |
mount_boot_device() { |
[ "$boot_device_mounted" ] && return |
[ "$boot_device_mounted" ] && return |
|
[ "$BOOT_DEVICE" ] || return |
|
|
local default_mount=$( df -lnP /bsd | sed -ne 's!/dev/.* !!p' ) |
local default_mount=$( df -lnP /bsd | sed -ne 's!/dev/.* !!p' ) |
local boot_mount=$( mount | |
local boot_mount=$( mount | |
|
|
if [ X"$BOOT_KERNEL_VERSION" != X"$NEW_KERNEL_VERSION" ]; then |
if [ X"$BOOT_KERNEL_VERSION" != X"$NEW_KERNEL_VERSION" ]; then |
echo "===> Backing up $BOOT_KERNEL to ${_d}obsd" |
echo "===> Backing up $BOOT_KERNEL to ${_d}obsd" |
if [ $mount_is_msdos ]; then |
if [ $mount_is_msdos ]; then |
cp $BOOT_KERNEL ${_d}obsd |
cp ${_d}$BOOT_KERNEL ${_d}obsd |
else |
else |
ln -f $BOOT_KERNEL ${_d}obsd |
ln -f ${_d}$BOOT_KERNEL ${_d}obsd |
fi |
fi |
if [ $? -ne 0 ]; then |
if [ $? -ne 0 ]; then |
echo "Error copying old kernel!" >&2 |
echo "Error copying old kernel!" >&2 |
|
|
. ${HOME}/.update_openbsdrc |
. ${HOME}/.update_openbsdrc |
fi |
fi |
|
|
MIRROR=${MIRROR:=http://fastly.cdn.openbsd.org/pub/OpenBSD} |
MIRROR=${MIRROR:=http://cdn.openbsd.org/pub/OpenBSD} |
FTP_CMD=${FTP_CMD:=ftp -V} |
FTP_CMD=${FTP_CMD:=ftp -V} |
|
|
DESTDIR=${DESTDIR:=/} |
DESTDIR=${DESTDIR:=/} |