Merge from vendor branch TNF:
[pkgsrcv2.git] / net / ppp-mppe / patches / patch-au
1 $NetBSD$
2
3 --- /dev/null   Sat Sep 18 04:13:35 1999
4 +++ netbsd-1.4/kinstall.sh      Sat Sep 18 04:15:32 1999
5 @@ -0,0 +1,78 @@
6 +#!/bin/sh
7 +
8 +# This script modifies the kernel sources in /sys to install
9 +# ppp-2.3.  It is intended to be run in the ppp-2.3 directory.
10 +#
11 +# Paul Mackerras       11-Dec-95
12 +
13 +ARCH=$(uname -m)
14 +CONF=$(uname -v | sed 's/.*(\(.*\)).*/\1/')
15 +SYS=/sys
16 +ARCHDIR=$SYS/arch/$ARCH
17 +CFILE=$ARCHDIR/conf/$CONF
18 +SRC=netbsd-1.4
19 +DOCONF=
20 +DOMAKE=
21 +CONFIG=config
22 +
23 +# Copy new versions of files into /sys/net
24 +
25 +for f in include/net/if_ppp.h include/net/ppp-comp.h include/net/ppp_defs.h \
26 +        $SRC/bsd-comp.c $SRC/ppp-deflate.c $SRC/if_ppp.c $SRC/if_pppvar.h \
27 +         $SRC/ppp_tty.c $SRC/slcompress.c include/net/slcompress.h \
28 +         common/zlib.c common/zlib.h; do
29 +  dest=$SYS/net/$(basename $f)
30 +  if [ -f $dest ]; then
31 +    if ! diff -qBI '[  ]\$[IN][de].*:.*\$' $f $dest >/dev/null; then
32 +      echo "Copying $f to $dest"
33 +      mv -f $dest $dest.orig && echo " (old version saved in $dest.orig)"
34 +      cp $f $dest
35 +      DOMAKE=yes
36 +    fi
37 +  else
38 +    echo "Copying $f to $dest"
39 +    cp $f $dest
40 +    DOMAKE=yes
41 +  fi
42 +done
43 +
44 +# Tell the user to add a pseudo-device line to the configuration file
45 +# and remake the kernel, if necessary.
46 +
47 +if [ -f $CFILE ]; then
48 +  if ! grep -q '^[     ]*pseudo-device[        ][      ]*ppp' $CFILE; then
49 +    echo
50 +    echo "The currently-running kernel was built from configuration file"
51 +    echo "$CFILE, which does not include PPP."
52 +    echo "You need either to add a line like 'pseudo-device ppp 2' to"
53 +    echo "this file, or use another configuration file which includes"
54 +    echo "a line like this."
55 +    DOCONF=yes
56 +  fi
57 +fi
58 +
59 +if [ $DOCONF ]; then
60 +  echo
61 +  echo "You need to configure and build a new kernel."
62 +  echo "The procedure for doing this involves the following commands:"
63 +  echo "(\"$CONF\" may be replaced by the name of another config file.)"
64 +  echo
65 +  echo "       cd $ARCHDIR/conf"
66 +  echo "       /usr/sbin/$CONFIG $CONF"
67 +  echo "       cd ../compile/$CONF"
68 +  echo "       make depend"
69 +  DOMAKE=yes
70 +elif [ $DOMAKE ]; then
71 +  echo
72 +  echo "You need to build a new kernel."
73 +  echo "The procedure for doing this involves the following commands:"
74 +  echo
75 +  echo "       cd $ARCHDIR/compile/$CONF"
76 +fi
77 +if [ $DOMAKE ]; then
78 +  echo "       make"
79 +  echo
80 +  echo "Then copy the new kernel ($ARCHDIR/compile/$CONF/netbsd)"
81 +  echo "to /netbsd and reboot.  (Keep a copy of the old /netbsd,"
82 +  echo "just in case.)"
83 +fi