version 1.117, 2018/12/16 20:57:49 |
version 1.118, 2018/12/16 21:10:00 |
|
|
#!/bin/sh |
#!/bin/sh |
# $AFresh1: update_openbsd,v 1.116 2018/12/16 20:55:24 andrew Exp $ |
# $AFresh1: update_openbsd,v 1.117 2018/12/16 20:57:49 andrew Exp $ |
# |
# |
# Copyright (c) 2012 Andrew Fresh <andrew@afresh1.com> |
# Copyright (c) 2012 Andrew Fresh <andrew@afresh1.com> |
# |
# |
|
|
fi |
fi |
|
|
cd $KERNEL_ROOT |
cd $KERNEL_ROOT |
BOOT_KERNEL=$( find_boot_kernel ) |
BOOTED_KERNEL=$( find_boot_kernel ) |
BOOT_KERNEL_VERSION=$( kernel_file_version $BOOT_KERNEL ) |
BOOT_KERNEL_VERSION=$( kernel_file_version $BOOTED_KERNEL ) |
if [ $(sysctl -n hw.ncpufound) -gt 1 ] || kernel_is_multiprocessor $BOOT_KERNEL; then |
|
|
if [ $(sysctl -n hw.ncpufound) -gt 1 ] || kernel_is_multiprocessor $BOOTED_KERNEL; then |
BOOT_KERNEL=bsd.mp |
BOOT_KERNEL=bsd.mp |
|
else |
|
BOOT_KERNEL=$BOOTED_KERNEL |
fi |
fi |
|
|
BOOTED_KERNEL_VERSION=`sysctl -n kern.version` |
BOOTED_KERNEL_VERSION=`sysctl -n kern.version` |
|
|
fi |
fi |
|
|
if [ X"$BOOT_KERNEL_VERSION" != X"$NEW_KERNEL_VERSION" ]; then |
if [ X"$BOOT_KERNEL_VERSION" != X"$NEW_KERNEL_VERSION" ]; then |
echo "===> Backing up ${_d}$BOOT_KERNEL to ${_d}obsd" |
echo "===> Backing up ${_d}$BOOTED_KERNEL to ${_d}obsd" |
if [ $mount_is_msdos ]; then |
if [ $mount_is_msdos ]; then |
cp ${_d}$BOOT_KERNEL ${_d}obsd |
cp ${_d}$BOOTED_KERNEL ${_d}obsd |
else |
else |
ln -f ${_d}$BOOT_KERNEL ${_d}obsd |
ln -f ${_d}$BOOTED_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 |
|
|
echo "===> Last booted:\n$BOOTED_KERNEL_VERSION" |
echo "===> Last booted:\n$BOOTED_KERNEL_VERSION" |
if [ X"$BOOT_KERNEL_VERSION" != X"$BOOTED_KERNEL_VERSION" \ |
if [ X"$BOOT_KERNEL_VERSION" != X"$BOOTED_KERNEL_VERSION" \ |
-a X"$BOOT_KERNEL_VERSION" != X"$NEW_KERNEL_VERSION" ]; then |
-a X"$BOOT_KERNEL_VERSION" != X"$NEW_KERNEL_VERSION" ]; then |
echo "Next boot (unless replaced):\n$BOOT_KERNEL_VERSION" |
echo "Next boot $BOOTED_KERNEL (unless replaced):\n$BOOT_KERNEL_VERSION" |
fi |
fi |
if [ -n "$NEW_KERNEL_VERSION" ]; then |
if [ -n "$NEW_KERNEL_VERSION" ]; then |
echo "===> New $BOOT_KERNEL:\n$NEW_KERNEL_VERSION"; |
echo "===> New $BOOT_KERNEL:\n$NEW_KERNEL_VERSION"; |