Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/freebsd-update/freebsd-update.sh
Show First 20 Lines • Show All 664 Lines • ▼ Show 20 Lines | RELNUM=`uname -r | | ||||
sed -E 's,-p[0-9]+,,' | | sed -E 's,-p[0-9]+,,' | | ||||
sed -E 's,-SECURITY,-RELEASE,'` | sed -E 's,-SECURITY,-RELEASE,'` | ||||
ARCH=`uname -m` | ARCH=`uname -m` | ||||
FETCHDIR=${RELNUM}/${ARCH} | FETCHDIR=${RELNUM}/${ARCH} | ||||
PATCHDIR=${RELNUM}/${ARCH}/bp | PATCHDIR=${RELNUM}/${ARCH}/bp | ||||
# Disallow upgrade from a version that is not a release | # Disallow upgrade from a version that is not a release | ||||
case ${RELNUM} in | case ${RELNUM} in | ||||
*-RELEASE | *-ALPHA* | *-BETA* | *-RC*) | *-RELEASE | *-ALPHA* | *-BETA* | *-RC*) | ||||
;; | ;; | ||||
*) | *) | ||||
echo -n "`basename $0`: " | echo -n "`basename $0`: " | ||||
cat <<- EOF | cat <<- EOF | ||||
Cannot upgrade from a version that is not a release | Cannot upgrade from a version that is not a release | ||||
(including alpha, beta and release candidates) | (including alpha, beta and release candidates) | ||||
using `basename $0`. Instead, FreeBSD can be directly | using `basename $0`. Instead, FreeBSD can be directly | ||||
upgraded by source or upgraded to a RELEASE/RELENG version | upgraded by source or upgraded to a RELEASE/RELENG version | ||||
prior to running `basename $0`. | prior to running `basename $0`. | ||||
Currently running: ${RELNUM} | Currently running: ${RELNUM} | ||||
EOF | EOF | ||||
exit 1 | exit 1 | ||||
;; | ;; | ||||
esac | esac | ||||
case ${ARCH} in | case ${ARCH} in | ||||
i386 | amd64) | i386 | amd64) | ||||
emaste: FreeBSD shell style places the cases at the same indentation level as the case statement itself… | |||||
;; | ;; | ||||
*) | *) | ||||
echo -n "`basename $0:`" | echo -n "`basename $0`: " | ||||
cat <<- EOF | cat <<- EOF | ||||
Upgrading from '${ARCH}' is unsupported by `basename $0`. | Upgrading from a '${ARCH}' system is unsupported by `basename $0`. | ||||
Instead, FreeBSD can be directly upgraded by source. | Instead, FreeBSD can be directly upgraded by source. | ||||
EOF | EOF | ||||
exit 1 | exit 1 | ||||
;; | ;; | ||||
esac | esac | ||||
# Figure out what directory contains the running kernel | # Figure out what directory contains the running kernel | ||||
BOOTFILE=`sysctl -n kern.bootfile` | BOOTFILE=`sysctl -n kern.bootfile` | ||||
KERNELDIR=${BOOTFILE%/kernel} | KERNELDIR=${BOOTFILE%/kernel} | ||||
if ! [ -d ${KERNELDIR} ]; then | if ! [ -d ${KERNELDIR} ]; then | ||||
echo "Cannot identify running kernel" | echo "Cannot identify running kernel" | ||||
exit 1 | exit 1 | ||||
▲ Show 20 Lines • Show All 2,647 Lines • Show Last 20 Lines |
FreeBSD shell style places the cases at the same indentation level as the case statement itself: