3 # A quickie script to install MPPE into the 2.2.19+ or 2.4.18+ kernel.
4 # Does no 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 "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
32 if [ $rel -gt 18 ] ; then
33 patchfiles="$patchfiles $patchdir/linux-2.4.19-pad.patch"
35 patchfiles="$patchfiles $patchdir/linux-2.4.18-pad.patch"
39 echo "Detected kernel version $ver"
40 echo "I will now patch the kernel in directory $1"
41 echo -n "Press ret to continue, CTRL-C to exit: "
45 for patch in $patchfiles; do
49 for file in $mppe_files; do
50 cp -v $patchdir/$file drivers/net