3 # A quickie script to install MPPE into the 2.2.19+ or 2.4.18+ kernel.
4 # Does very little error checking!!!
7 mppe_files="sha1.[ch] arcfour.[ch] ppp_mppe_compress.c"
9 if [ -z "$1" -o ! -d "$1" ]; then
10 echo "Usage: $0 <linux-source-dir>" >&2
14 # strip any trailing /
16 # strip leading /path/to/linux-
17 ver=`echo "${1##*/}" | sed -e 's/linux-//'` # -e 's/\/$//'
18 if ! expr "$ver" : 2.[24] >/dev/null ; then
19 echo "$0: Unable to determine kernel version ($ver)" >&2
23 # build patch files list
26 if expr $ver : 2.2 >/dev/null ; then
27 patchfiles=$patchdir/linux-2.2.*.patch
28 elif expr $ver : 2.4 >/dev/null ; then
29 patchfiles=`echo $patchdir/linux-2.4.18-{include,make}.patch`
30 # need to differentiate a bit
31 typeset -i rel=${ver##*.}
32 if [ $rel -eq 18 ]; then
33 patchfiles="$patchfiles $patchdir/linux-2.4.18-pad.patch"
34 elif [ $rel -gt 18 ]; then
35 patchfiles="$patchfiles $patchdir/linux-2.4.19-pad.patch"
37 echo "$0: unable to determine kernel version" >&2
42 echo "Detected kernel version $ver"
43 echo "I will now patch the kernel in directory $1"
44 echo -n "Press ret to continue, CTRL-C to exit: "
48 for patch in $patchfiles; do
52 for file in $mppe_files; do
53 cp -v $patchdir/$file drivers/net