aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/freebsd-update/freebsd-update.sh
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2007-03-04 00:29:42 +0000
committerColin Percival <cperciva@FreeBSD.org>2007-03-04 00:29:42 +0000
commit2c434b2cc37b0e2861133dc15769dcdec6485a0f (patch)
treeedf47a8ab9ad168becf3719a22a5bbb684b50932 /usr.sbin/freebsd-update/freebsd-update.sh
parentbaf85fc2531481369e1d67c2c053385dff1c9414 (diff)
downloadsrc-2c434b2cc37b0e2861133dc15769dcdec6485a0f.tar.gz
src-2c434b2cc37b0e2861133dc15769dcdec6485a0f.zip
Fix problems resulting from SMP kernels (mis-)identifying themselves as
"SMP-GENERIC" (i386) or "GENERIC" (amd64). FreeBSD 6.2 Errata candidate. MFC after: 3 days Pointy hat to: cperciva
Notes
Notes: svn path=/head/; revision=167189
Diffstat (limited to 'usr.sbin/freebsd-update/freebsd-update.sh')
-rw-r--r--usr.sbin/freebsd-update/freebsd-update.sh23
1 files changed, 20 insertions, 3 deletions
diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh
index f290db101a75..faf8c3367b82 100644
--- a/usr.sbin/freebsd-update/freebsd-update.sh
+++ b/usr.sbin/freebsd-update/freebsd-update.sh
@@ -499,6 +499,24 @@ fetch_check_params () {
exit 1
fi
+ # Figure out what kernel configuration is running. We start with
+ # the output of `uname -i`, and then make the following adjustments:
+ # 1. Replace "SMP-GENERIC" with "SMP". Why the SMP kernel config
+ # file says "ident SMP-GENERIC", I don't know...
+ # 2. If the kernel claims to be GENERIC _and_ ${ARCH} is "amd64"
+ # _and_ `sysctl kern.version` contains a line which ends "/SMP", then
+ # we're running an SMP kernel. This mis-identification is a bug
+ # which was fixed in 6.2-STABLE.
+ KERNCONF=`uname -i`
+ if [ ${KERNCONF} = "SMP-GENERIC" ]; then
+ KERNCONF=SMP
+ fi
+ if [ ${KERNCONF} = "GENERIC" ] && [ ${ARCH} = "amd64" ]; then
+ if sysctl kern.version | grep -qE '/SMP$'; then
+ KERNCONF=SMP
+ fi
+ fi
+
# Define some paths
BSPATCH=/usr/bin/bspatch
SHA256=/sbin/sha256
@@ -1078,14 +1096,13 @@ fetch_filter_metadata () {
rm $1.all $1.tmp
}
-# Filter the metadata file $1 by adding lines with "/boot/`uname -i`"
+# Filter the metadata file $1 by adding lines with "/boot/${KERNCONF}"
# replaced by ${KERNELDIR} (which is `sysctl -n kern.bootfile` minus the
-# trailing "/kernel"); and if "/boot/`uname -i`" does not exist, remove
+# trailing "/kernel"); and if "/boot/${KERNCONF}" does not exist, remove
# the original lines which start with that.
# Put another way: Deal with the fact that the FOO kernel is sometimes
# installed in /boot/FOO/ and is sometimes installed elsewhere.
fetch_filter_kernel_names () {
- KERNCONF=`uname -i`
grep ^/boot/${KERNCONF} $1 |
sed -e "s,/boot/${KERNCONF},${KERNELDIR},g" |