/usr/src/kernel-patches/all/apply/wrr is in kernel-patch-wrr 20021019-7.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | #! /bin/bash
set -e
if ! [ -d kernel -a -d Documentation ]
then
echo >&2 "Not in kernel top level directory. Exiting"
exit 1
fi
TOPPATCHDIR=/usr/src/kernel-patches
ARCHITECTURE=`dpkg --print-installation-architecture`
DECOMPRESSOR="zcat -f"
PATCH_OPTIONS="--ignore-whitespace --silent"
# This is informational only, used by lskpatches
DHPKPATCHES_VERSION=0.99.36
DEPENDS=("" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "")
KVERSIONS=(2.6.9 2.6.10 2.6.11 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.18 2.6.19 2.6.20 2.6.22 2.6.23 2.6.24 2.6.25 2.6.26)
PATCHFILES=("/usr/src/kernel-patches/diffs/wrr/wrr-linux-051111-2.6.12.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-051111-2.6.12.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-051111-2.6.12.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-051111-2.6.12.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-051111-2.6.14.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-051111-2.6.14.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-051111-2.6.14.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-051111-2.6.14.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-051111-2.6.14.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-051111-2.6.14.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-051111-2.6.19.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-051111-2.6.20.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-070717-2.6.22.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-071203-2.6.25.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-071203-2.6.25.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-071203-2.6.25+koch20080820.patch.gz" "/usr/src/kernel-patches/diffs/wrr/wrr-linux-071203-2.6.25+koch20080820.patch.gz")
DEBPATCHFILES=("" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "")
STRIPLEVELS=(1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1)
[ -f debian/APPLIED_${ARCHITECTURE}_wrr -o \
-f debian/APPLIED_all_wrr ] && exit 0
VERSION=$(grep ^VERSION Makefile 2>/dev/null | \
sed -e 's/[^0-9]*\([0-9]*\)/\1/')
PATCHLEVEL=$( grep ^PATCHLEVEL Makefile 2>/dev/null | \
sed -e 's/[^0-9]*\([0-9]*\)/\1/')
SUBLEVEL=$(grep ^SUBLEVEL Makefile 2>/dev/null | \
sed -e 's/[^0-9]*\([0-9]*\)/\1/')
EXTRAVERSION=$(grep ^EXTRAVERSION Makefile | head -1 2>/dev/null | \
sed -e 's/EXTRAVERSION =[ ]*\([^ ]*\)$/\1/')
KERNELBRANCHLET=${VERSION}.${PATCHLEVEL}.${SUBLEVEL}
KERNELRELEASE=${KERNELBRANCHLET}${EXTRAVERSION}
IDX=
declare -i i=${#PATCHFILES[*]}-1
while [ $i -ge 0 ]
do
v=${KVERSIONS[$i]}
if [ -n "$KPATCH_wrr" -a "$v" = "$KPATCH_wrr" \
-o "$v" = "$KERNELRELEASE" \
-o "$v" = "$KERNELBRANCHLET" \
-o "$v" = all ]
then
IDX=$i
fi
i=i-1
done
if [ -n "$KPATCH_wrr" -a ${KVERSIONS[$IDX]} != "$KPATCH_wrr" ]
then
echo >&2 "Requested kernel version \`$KPATCH_wrr' not found for patch wrr"
exit 1
elif [ -z "$IDX" ]
then
echo >&2 "No \"Extension to traffic Control/network bandwidth management\" patch found for kernel version $KERNELRELEASE"
exit 1
fi
KVERSION=${KVERSIONS[$IDX]}
STRIPLEVEL=${STRIPLEVELS[$IDX]}
if [ "${DEBPATCHFILES[$IDX]}" != '' -a \
\( -r version.Debian -o -r README.Debian \) ]
then
PATCHFILE=${DEBPATCHFILES[$IDX]}
else
PATCHFILE=${PATCHFILES[$IDX]}
fi
echo >&2 "START applying wrr patch (Extension to traffic Control/network bandwidth management)"
NEEDED_DEPS=
for dep in ${DEPENDS[$IDX]}
do
if [ -x ${TOPPATCHDIR}/${ARCHITECTURE}/${KERNELBRANCHLET}/apply/$dep ]
then
NEEDED_DEPS="${ARCHITECTURE}/${KERNELBRANCHLET}/apply/$dep $NEEDED_DEPS"
elif [ -x ${TOPPATCHDIR}/all/${KERNELBRANCHLET}/apply/$dep ]
then
NEEDED_DEPS="all/${KERNELBRANCHLET}/apply/$dep $NEEDED_DEPS"
elif [ -x ${TOPPATCHDIR}/${ARCHITECTURE}/apply/$dep ]
then
NEEDED_DEPS="${ARCHITECTURE}/apply/$dep $NEEDED_DEPS"
elif [ -x ${TOPPATCHDIR}/all/apply/$dep ]
then
NEEDED_DEPS="all/apply/$dep $NEEDED_DEPS"
else
echo >&2 "ERROR: Patch dependency \`$dep' not found - aborting"
echo >&2 "END applying wrr patch"
exit 1
fi
done
if [ "$NEEDED_DEPS" ]
then
echo >&2 "Ensuring the following patches are applied first: $NEEDED_DEPS"
for apply in ${NEEDED_DEPS}
do
dep=$(basename $apply)
${TOPPATCHDIR}/$apply
# check something was applied
if [ ! -f debian/APPLIED_${ARCHITECTURE}_$dep -a \
! -f debian/APPLIED_all_$dep ]
then
echo >&2 "ERROR: patch dependency did not left a patch stamp (version mismatch ?) - aborting"
echo >&2 "END applying wrr patch"
exit 1
fi
done
UNPATCHDEPS=$(echo ${NEEDED_DEPS} | sed s,/apply/,/unpatch/,g)
fi
echo >&2 "Testing whether \"Extension to traffic Control/network bandwidth management\" patch for $KVERSION applies (dry run):"
if ! [ -r $PATCHFILE ]
then
echo >&2 "\"Extension to traffic Control/network bandwidth management\" patch for $KVERSION not found"
exit 1
elif ! $DECOMPRESSOR $PATCHFILE |
patch --force --dry-run $PATCH_OPTIONS -p$STRIPLEVEL
then
echo >&2 "\"Extension to traffic Control/network bandwidth management\" patch for $KVERSION does not apply cleanly"
exit 1
fi
if ! $DECOMPRESSOR $PATCHFILE |
patch $PATCH_OPTIONS -p$STRIPLEVEL
then
# This should never happen, thanks to the dry-run
echo >&2 "ASSERTION FAILED - \"Extension to traffic Control/network bandwidth management\" patch for $KVERSION failed"
echo >&2 "END applying wrr patch"
exit 1
fi
echo >&2 "\"Extension to traffic Control/network bandwidth management\" patch for $KVERSION succeeded"
echo >&2 "Removing empty files:"
# make an exception for ./debian, or else the stamp files will go too.
find . -path ./debian -prune -o \
-type f -size 0 ! -name 'APPLIED*' -exec rm {} \; -print
echo >&2 "Done."
mkdir -p debian
cat > 'debian/APPLIED_all_wrr' <<EOF
PATCHFILE='$PATCHFILE'
STRIPLEVEL='$STRIPLEVEL'
DEPENDS='$UNPATCHDEPS'
EOF
mkdir -p debian/image.d
PKGNAME=`dpkg -S $PATCHFILE | cut -d: -f1`
PKGVERS=`grep-dctrl -n -P $PKGNAME -s Version -X /var/lib/dpkg/status`
cat > 'debian/image.d/register-wrr' <<EOF
#!/bin/sh
# This scripts documents the "Extension to traffic Control/network bandwidth management" kernel patch into the
# kernel-image package, as being applied to the kernel.
docdir=\${IMAGE_TOP}/usr/share/doc/kernel-image-\${version}
mkdir -p \${docdir}
(
printf 'Extension to traffic Control/network bandwidth management (wrr)${KPATCH_wrr:+ for kernel ${KPATCH_wrr}},'
echo ' from package $PKGNAME, version $PKGVERS'
) >> \${docdir}/applied-patches
EOF
chmod +x 'debian/image.d/register-wrr'
echo >&2 "END applying wrr patch"
|