X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=linux%2Fmppe%2Fmppeinstall.sh;h=52ae7d12e31661711567ccd82a0cc1263ba7b8e2;hb=ae57a37fb6a716dddff877efde7c82a61f254c98;hp=6a1f9458de70e8655c152d6b2d81f52a5961d2a4;hpb=b34cd4f6562185d2bbc96612bbb3dc598f3a8dcd;p=ppp.git diff --git a/linux/mppe/mppeinstall.sh b/linux/mppe/mppeinstall.sh index 6a1f945..52ae7d1 100644 --- a/linux/mppe/mppeinstall.sh +++ b/linux/mppe/mppeinstall.sh @@ -1,7 +1,7 @@ #!/bin/sh # # A quickie script to install MPPE into the 2.2.19+ or 2.4.18+ kernel. -# Does no error checking!!! +# Does very little error checking!!! # mppe_files="sha1.[ch] arcfour.[ch] ppp_mppe_compress.c" @@ -13,11 +13,14 @@ fi # strip any trailing / set -- ${1%/} -# strip leading /path/to/linux- -ver=`echo "${1##*/}" | sed -e 's/linux-//'` # -e 's/\/$//' -if ! expr "$ver" : 2.[24] >/dev/null ; then - echo "Unable to determine kernel version ($ver)" >&2 - exit 1 +# strip leading /path/to/linux- and trailing -release +ver=`echo "${1##*/}" | sed -e 's/linux-//' -e 's/-.*//'` +if ! expr "$ver" : 2.[246] >/dev/null ; then + ver=`echo "${1##*/}" | sed -e 's/kernel-source-//' -e 's/-.*//'` + if ! expr "$ver" : 2.[246] >/dev/null ; then + echo "$0: Unable to determine kernel version ($ver)" >&2 + exit 1 + fi fi # build patch files list @@ -28,12 +31,17 @@ if expr $ver : 2.2 >/dev/null ; then elif expr $ver : 2.4 >/dev/null ; then patchfiles=`echo $patchdir/linux-2.4.18-{include,make}.patch` # need to differentiate a bit - rel=${ver##*.} - if [ $rel -gt 18 ] ; then + typeset -i rel=${ver##*.} + if [ $rel -eq 18 ]; then + patchfiles="$patchfiles $patchdir/linux-2.4.18-pad.patch" + elif [ $rel -gt 18 ]; then patchfiles="$patchfiles $patchdir/linux-2.4.19-pad.patch" else - patchfiles="$patchfiles $patchdir/linux-2.4.18-pad.patch" + echo "$0: unable to determine kernel version" >&2 + exit 1 fi +elif expr $ver : 2.6 >/dev/null ; then + patchfiles=`echo $patchdir/linux-2.6*.patch` fi echo "Detected kernel version $ver"