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- and trailing -release
17 ver
=`echo "${1##*/}" | sed -e 's/linux-//' -e 's/-.*//'`
18 if ! expr "$ver" : 2.
[246] >/dev
/null
; then
19 ver
=`echo "${1##*/}" | sed -e 's/kernel-source-//' -e 's/-.*//'`
20 if ! expr "$ver" : 2.
[246] >/dev
/null
; then
21 echo "$0: Unable to determine kernel version ($ver)" >&2
26 # build patch files list
29 if expr $ver : 2.2 >/dev
/null
; then
30 patchfiles
=$patchdir/linux-2.2.
*.
patch
31 elif expr $ver : 2.4 >/dev
/null
; then
32 patchfiles
=`echo $patchdir/linux-2.4.18-{include,make}.patch`
33 # need to differentiate a bit
34 typeset
-i rel
=${ver##*.}
35 if [ $rel -eq 18 ]; then
36 patchfiles
="$patchfiles $patchdir/linux-2.4.18-pad.patch"
37 elif [ $rel -gt 18 ]; then
38 patchfiles
="$patchfiles $patchdir/linux-2.4.19-pad.patch"
40 echo "$0: unable to determine kernel version" >&2
43 elif expr $ver : 2.6 >/dev
/null
; then
44 patchfiles
=`echo $patchdir/linux-2.6*.patch`
47 echo "Detected kernel version $ver"
48 echo "I will now patch the kernel in directory $1"
49 echo -n "Press ret to continue, CTRL-C to exit: "
53 for patch in $patchfiles; do
57 for file in $mppe_files; do
58 cp -v $patchdir/$file drivers
/net