diff options
author | Stef Walter <stef@memberwebs.com> | 2009-09-10 16:23:56 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2009-09-10 16:23:56 +0000 |
commit | dac8b80c8c5f3da019ed921bdf2e95fe368d7169 (patch) | |
tree | a4a0eaf8fc5bc0cd617e9862a359304934e6d374 | |
parent | b3ed25869949d6fc007ac66969738e11e117067f (diff) |
Separate update-kernel patches and add new one
-rw-r--r-- | kernel-8.0/freebsd-mcast-filter-array-in-sync.patch | 14 | ||||
-rwxr-xr-x | update-kernel | 120 |
2 files changed, 134 insertions, 0 deletions
diff --git a/kernel-8.0/freebsd-mcast-filter-array-in-sync.patch b/kernel-8.0/freebsd-mcast-filter-array-in-sync.patch new file mode 100644 index 0000000..49f2408 --- /dev/null +++ b/kernel-8.0/freebsd-mcast-filter-array-in-sync.patch @@ -0,0 +1,14 @@ +--- sys/netinet/in_mcast.c.orig 2009-09-09 19:33:22.000000000 +0000 ++++ sys/netinet/in_mcast.c 2009-09-10 05:28:20.000000000 +0000 +@@ -2280,7 +2292,9 @@ + + if (is_final) { +- /* Remove the gap in the membership array. */ +- for (++idx; idx < imo->imo_num_memberships; ++idx) ++ /* Remove the gap in the membership and filter array. */ ++ for (++idx; idx < imo->imo_num_memberships; ++idx) { + imo->imo_membership[idx-1] = imo->imo_membership[idx]; ++ imo->imo_mfilters[idx-1] = imo->imo_mfilters[idx]; ++ } + imo->imo_num_memberships--; + } diff --git a/update-kernel b/update-kernel new file mode 100755 index 0000000..a57d04e --- /dev/null +++ b/update-kernel @@ -0,0 +1,120 @@ +#!/bin/sh -euf + +script=update-kernel +set -euf + +# ----------------------------------------------------- +# BASIC STUFF + +is_yes() +{ + case ${1-} in + [Yy][Ee][Ss]|[Yy]|[Tt][Rr][Uu][Ee]) + return 0 + ;; + *) + return 1 + ;; + esac +} + +empty() +{ + case ${@:+1} in + '') + return 0 + ;; + *) + return 1 + ;; + esac +} + +warn() +{ + echo "$script: $@" >&2 +} + +fail() +{ + echo "$script: $@" >&2 + exit 1 +} + +# ------------------------------------------------------------ +# Main action + +usage() +{ + echo "usage: $script [-v] [-s server] [-B branch]" >&2 + exit 2 +} + +supfile=/usr/src/cvsupfile-sys +server="cvsup2.FreeBSD.org" +version=`uname -r | sed -En 's/^([.0-9]+).*/\1/p'` +branch="RELENG_`echo $version | tr '.' '_'`" +csup="csup -L0" +patch="patch -s" + +while getopts "B:s:v" arg; do + case $arg in + B) + branch="$OPTARG" + ;; + s) + server="$OPTARG" + ;; + v) + patch="patch" + csup="csup -L2" + ;; + *) + usage + ;; + esac +done + +shift `expr $OPTIND - 1` +if [ $# -ne 0 ]; then + usage +fi + +if empty $version; then + fail "couldn't determine OS version" +fi + +if empty $branch; then + fail "couldn't determine cvsup branch" +fi + +base=`dirname $0` +base=`realpath $base` +patchdir=$base/kernel-$version + +if [ ! -d $patchdir ]; then + fail "patches directory does not exist: $patchdir" +fi + +cat > $supfile << EOF +*default host=$server +*default base=/usr +*default prefix=/usr +*default release=cvs +*default tag=$branch +*default delete use-rel-suffix + +src-sys +EOF + +# Only allow up to 10 files to be deleted +$csup -d 10 $supfile + +# Allow globbing from here on out +set +f + +for file in $patchdir/*; do + if [ -f "$file" ]; then + $patch -d /usr/src -t -p0 < $file + fi +done |