]> git.ozlabs.org Git - ppp.git/blob - freebsd-2.0/kinstall.sh
f865255c325d193f1d6988d530c368eef1fee647
[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.2.  It is intended to be run in the ppp-2.2 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 netbsd/bsd-comp.c \
20          $SRC/if_ppp.c $SRC/if_pppvar.h $SRC/ppp_tty.c \
21          $SRC/pppcompress.c $SRC/pppcompress.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
27       echo " (old version saved in $dest.orig)"
28       cp $f $dest
29       DOMAKE=yes
30     fi
31   else
32     echo "Copying $f to $dest"
33     cp $f $dest
34     DOMAKE=yes
35   fi
36 done
37
38 # Add extra stuff to /sys/conf/files
39
40 if [ -f $SYS/conf/files ]; then
41   if ! grep -q ppp_tty $SYS/conf/files; then
42     echo "Patching $SYS/conf/files"
43     patch -p -N -d $SYS/conf <$SRC/files.patch
44     if [ $CONFIG = config ]; then
45       DOCONF=yes
46     fi
47   fi
48 fi
49
50 # Tell the user to add a pseudo-device line to the configuration file.
51
52 if [ -f $CFILE ]; then
53   if ! grep -q '^[      ]*pseudo-device[        ][      ]*ppp' $CFILE; then
54     echo
55     echo "The currently-running kernel was built from configuration file"
56     echo "$CFILE, which does not include PPP."
57     echo "You need either to add a line like 'pseudo-device ppp 2' to"
58     echo "this file, or use another configuration file which includes"
59     echo "a line like this."
60     DOCONF=yes
61   fi
62 fi
63
64 if [ $DOCONF ]; then
65   echo
66   echo "You need to configure and build a new kernel."
67   echo "The procedure for doing this involves the following commands."
68   echo "(\"$CONF\" may be replaced by the name of another config file.)"
69   echo
70   echo "        cd $ARCHDIR/conf"
71   echo "        /usr/sbin/$CONFIG $CONF"
72   echo "        cd ../../compile/$CONF"
73   echo "        make depend"
74   DOMAKE=yes
75 elif [ $DOMAKE ]; then
76   echo "You need to build a new kernel."
77   echo "The procedure for doing this involves the following commands."
78   echo
79   echo "        cd $SYS/compile/$CONF"
80 fi
81 if [ $DOMAKE ]; then
82   echo "        make"
83   echo
84   echo "Then copy the new kernel ($SYS/compile/$CONF/kernel) to /"
85   echo "and reboot.  (Keep a copy of the old /kernel, just in case.)"
86 fi