X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=linux%2Fkinstall.sh;h=0391a231c3fca4230cb76fe793e8e3f7491f28d4;hp=23ae2d128db5de7083958841c5a6ba2dce3dcc79;hb=d0d16c4ba18e31f76e891201e5e106887f87bbf0;hpb=0816630b7e90b23792599af619d6950841891b9b diff --git a/linux/kinstall.sh b/linux/kinstall.sh index 23ae2d1..0391a23 100755 --- a/linux/kinstall.sh +++ b/linux/kinstall.sh @@ -14,9 +14,6 @@ # # In addition, we have to edit the Makefile in the drivers/net # directory to add support for the ppp-comp compression option. -# -# Finally, we have to check that certain include file stubs in -# /usr/include/net exist, or else pppd won't compile. Phew! LINUXSRC=/usr/src/linux @@ -48,7 +45,7 @@ fi # introduced in 1.0.1 if [ `egrep '^VERSION|^PATCHLEVEL|^SUBLEVEL' $LINUXMK | wc -l` -ne 3 ]; then echo You appear to have a very old kernel. You must upgrade. - echo It is recommended that you upgrade to the most recent 1.2.X kernel. + echo It is recommended that you upgrade to the most recent 2.0.x kernel. exit 1 fi @@ -69,22 +66,6 @@ if [ $VERSION -lt 2 ]; then exit 1 fi -echo -echo Installing into kernel version $KERNEL in $LINUXSRC -echo - -echo "Notice to the user:" -echo -echo "It is perfectly legal for this script to run without making any changes" -echo "to your system. This only means that the system currently contains the" -echo "necessary changes to support this package. Please do not attempt to" -echo "force this script to replace any file or make any patch. If you do so" -echo "then it is probable that you are actually putting older, buggier, code" -echo "over newer, fixed, code. Thank you." -echo -echo Installing into kernel version $KERNEL in $LINUXSRC -echo - # # convenience function to exit if the last command failed @@ -98,7 +79,7 @@ bombiffailed () { # # convenience function to compare two files marked with ==FILEVERSION -# version numbers; returns success if $1 is newer than $2 +# version numbers; returns success if $1 is not older than $2 newer () { file1=$1 @@ -129,19 +110,21 @@ newer () { false ; return } -# -# Change the USE_SKB_PROTOCOL for correct operation on 1.3.x -update_ppp () { - return -} - # # Install the files. installfile () { BASE=`basename $1` + if [ ! -e $BASE ]; then + if [ -e ../include/linux/$BASE ]; then + BASE=../include/linux/$BASE + else + echo Could not find source file $BASE ! + false ; return + fi + fi if newer $1 $BASE; then - echo $1 is newer than $BASE, skipping + echo $1 is not older than $BASE, skipping return 0 fi BACKUP=`echo $1 | sed 's/.c$/.old.c/;s/.h$/.old.h/'` @@ -155,37 +138,6 @@ installfile () { bombiffailed touch $1 bombiffailed - if [ "$2" = "yes" ]; then - update_ppp - fi -} - -# -# Patch the bad copies of the sys/types.h file -# -patch_include () { - echo -n "Ensuring that sys/types.h includes sys/bitypes.h" - fgrep "" /usr/include/sys/types.h >/dev/null - if [ ! "$?" = "0" ]; then - echo -n '.' - rm -f /usr/include/sys/types.h.rej - (cd /usr/include/sys; patch -p0 -f -F30 -s) after it includes the file." - echo -n "Please change it so that it does." - rm -f /usr/include/sys/types.h.rej - else - echo -n " -- completed" - fi - else - echo -n " -- skipping" - fi - echo "" } # @@ -241,17 +193,6 @@ done installfile $LINUXSRC/drivers/net/ppp.c yes -for FILE in if.h if_arp.h route.h - do - if [ ! -f $LINUXSRC/include/linux/$FILE ]; then - echo Installing new $1 - cp $FILE $LINUXSRC/include/linux/$FILE - bombiffailed - touch $LINUXSRC/include/linux/$FILE - bombiffailed - fi -done - echo -n 'Adding BSD compression module to drivers makefile...' NETMK=$LINUXSRC/drivers/net/Makefile fgrep bsd_comp.o $NETMK >/dev/null @@ -289,50 +230,27 @@ else fi echo -# -# install header stub files in /usr/include/net - -for FILE in if_ppp.h \ - if_pppvar.h \ - ppp-comp.h \ - if.h \ - if_arp.h \ - route.h \ - ppp_defs.h - do - if [ ! -f /usr/include/net/$FILE ]; then - echo Installing stub include file in /usr/include/net/$FILE - echo "#include " > /usr/include/net/$FILE - bombiffailed - chown 0:0 /usr/include/net/$FILE - bombiffailed - chmod 444 /usr/include/net/$FILE - bombiffailed - touch /usr/include/net/$FILE - bombiffailed - fi -done - -for FILE in ip.h \ - tcp.h - do - if [ ! -f /usr/include/netinet/$FILE ]; then - echo Installing stub include file in /usr/include/netinet/$FILE - if [ ! -f $LINUXSRC/include/linux/$FILE ]; then - echo "#include \"$LINUXSRC/net/inet/$FILE\"" >/usr/include/netinet/$FILE - else - echo "#include " > /usr/include/netinet/$FILE - fi - chown 0:0 /usr/include/netinet/$FILE - bombiffailed - chmod 444 /usr/include/netinet/$FILE - bombiffailed - touch /usr/include/netinet/$FILE - bombiffailed - fi -done - -patch_include +# # +# # install header stub files in /usr/include/net + +# for FILE in if_ppp.h \ +# if_pppvar.h \ +# ppp-comp.h \ +# if.h \ +# ppp_defs.h +# do +# if [ ! -f /usr/include/net/$FILE ]; then +# echo Installing stub include file in /usr/include/net/$FILE +# echo "#include " > /usr/include/net/$FILE +# bombiffailed +# chown 0:0 /usr/include/net/$FILE +# bombiffailed +# chmod 444 /usr/include/net/$FILE +# bombiffailed +# touch /usr/include/net/$FILE +# bombiffailed +# fi +# done echo "Kernel driver files installation done."