]> git.ozlabs.org Git - ppp.git/blob - netbsd-1.1/kinstall.sh
extend protocol table; added maxconnect option
[ppp.git] / netbsd-1.1 / kinstall.sh
1 #!/bin/sh
2
3 # This script modifies the kernel sources in /sys to install
4 # ppp-2.2.  It is intended to be run in the ppp-2.2 directory.
5 #
6 # Paul Mackerras        11-Dec-95
7
8 ARCH=$(uname -m)
9 CONF=$(uname -v | sed 's/.*(\(.*\)).*/\1/')
10 SYS=/sys
11 ARCHDIR=$SYS/arch/$ARCH
12 CFILE=$ARCHDIR/conf/$CONF
13 SRC=netbsd-1.1
14 DOCONF=
15 DOMAKE=
16
17 # Work out whether to use config or config.old
18 if grep -q timezone $CFILE; then
19   CONFIG=config.old
20 else
21   CONFIG=config
22 fi
23
24 # Copy new versions of files into /sys/net
25
26 for f in net/if_ppp.h net/ppp-comp.h net/ppp_defs.h $SRC/bsd-comp.c \
27          $SRC/if_ppp.c $SRC/if_pppvar.h $SRC/ppp_tty.c \
28          $SRC/slcompress.c $SRC/slcompress.h; do
29   dest=$SYS/net/$(basename $f)
30   if [ -f $dest ]; then
31     if ! cmp -s $f $dest; then
32       echo "Copying $f to $dest"
33       mv -f $dest $dest.orig
34       echo " (old version saved in $dest.orig)"
35       cp $f $dest
36       DOMAKE=yes
37     fi
38   else
39     echo "Copying $f to $dest"
40     cp $f $dest
41     DOMAKE=yes
42   fi
43 done
44
45 # Tell the user to add a pseudo-device line to the configuration file
46 # and remake the kernel, if necessary.
47
48 if [ -f $CFILE ]; then
49   if ! grep -q '^[      ]*pseudo-device[        ][      ]*ppp' $CFILE; then
50     echo
51     echo "The currently-running kernel was built from configuration file"
52     echo "$CFILE, which does not include PPP."
53     echo "You need either to add a line like 'pseudo-device ppp 2' to"
54     echo "this file, or use another configuration file which includes"
55     echo "a line like this."
56     DOCONF=yes
57   fi
58 fi
59
60 if [ $DOCONF ]; then
61   echo
62   echo "You need to configure and build a new kernel."
63   echo "The procedure for doing this involves the following commands."
64   echo "(\"$CONF\" may be replaced by the name of another config file.)"
65   echo
66   echo "        cd $ARCHDIR/conf"
67   echo "        /usr/sbin/$CONFIG $CONF"
68   echo "        cd ../compile/$CONF"
69   echo "        make depend"
70   DOMAKE=yes
71 elif [ $DOMAKE ]; then
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