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