X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=netbsd-1.1%2Fkinstall.sh;h=66d3f0789bdc1f917f476c1c9af4293e061c1911;hp=41beb8523807694fc0cd1c522cc951166e11bf30;hb=874f1c70ee11de3dead7da7a7bc17a6c46afbfa7;hpb=7005827d79039deaac4646047fb08992e47d6b59 diff --git a/netbsd-1.1/kinstall.sh b/netbsd-1.1/kinstall.sh index 41beb85..66d3f07 100755 --- a/netbsd-1.1/kinstall.sh +++ b/netbsd-1.1/kinstall.sh @@ -1,7 +1,7 @@ #!/bin/sh # This script modifies the kernel sources in /sys to install -# ppp-2.2. It is intended to be run in the ppp-2.2 directory. +# ppp-2.3. It is intended to be run in the ppp-2.3 directory. # # Paul Mackerras 11-Dec-95 @@ -15,7 +15,7 @@ DOCONF= DOMAKE= # Work out whether to use config or config.old -if grep -q timezone $CFILE; then +if grep -q '^[ ]*timezone' $CFILE; then CONFIG=config.old else CONFIG=config @@ -24,14 +24,13 @@ fi # Copy new versions of files into /sys/net for f in net/if_ppp.h net/ppp-comp.h net/ppp_defs.h $SRC/bsd-comp.c \ - $SRC/if_ppp.c $SRC/if_pppvar.h $SRC/ppp_tty.c \ - $SRC/slcompress.c $SRC/slcompress.h; do + $SRC/ppp-deflate.c $SRC/if_ppp.c $SRC/if_pppvar.h $SRC/ppp_tty.c \ + $SRC/slcompress.c $SRC/slcompress.h common/zlib.c common/zlib.h; do dest=$SYS/net/$(basename $f) if [ -f $dest ]; then - if ! cmp -s $f $dest; then + if ! diff -qBI '[ ]\$[IN][de].*:.*\$' $f $dest >/dev/null; then echo "Copying $f to $dest" - mv -f $dest $dest.orig - echo " (old version saved in $dest.orig)" + mv -f $dest $dest.orig && echo " (old version saved in $dest.orig)" cp $f $dest DOMAKE=yes fi @@ -42,6 +41,30 @@ for f in net/if_ppp.h net/ppp-comp.h net/ppp_defs.h $SRC/bsd-comp.c \ fi done +OLDFILES=files.oldconf +NEWFILES=files +OLDCONFIG=config.old +NEWCONFIG=config + +if [ -f $SYS/conf/$OLDFILES ]; then + if ! grep -q ppp-deflate $SYS/conf/$OLDFILES; then + echo "Patching $SYS/conf/$OLDFILES" + patch -N $SYS/conf/$OLDFILES <$SRC/files.oldconf.patch + if [ $CONFIG = $OLDCONFIG ]; then + DOCONF=yes + fi + fi +fi +if [ -f $SYS/conf/$NEWFILES ]; then + if ! grep -q ppp-deflate $SYS/conf/$NEWFILES; then + echo "Patching $SYS/conf/$NEWFILES" + patch -N $SYS/conf/$NEWFILES <$SRC/files.patch + if [ $CONFIG = $NEWCONFIG ]; then + DOCONF=yes + fi + fi +fi + # Tell the user to add a pseudo-device line to the configuration file # and remake the kernel, if necessary. @@ -60,7 +83,7 @@ fi if [ $DOCONF ]; then echo echo "You need to configure and build a new kernel." - echo "The procedure for doing this involves the following commands." + echo "The procedure for doing this involves the following commands:" echo "(\"$CONF\" may be replaced by the name of another config file.)" echo echo " cd $ARCHDIR/conf" @@ -69,8 +92,9 @@ if [ $DOCONF ]; then echo " make depend" DOMAKE=yes elif [ $DOMAKE ]; then + echo echo "You need to build a new kernel." - echo "The procedure for doing this involves the following commands." + echo "The procedure for doing this involves the following commands:" echo echo " cd $ARCHDIR/compile/$CONF" fi