]> git.ozlabs.org Git - ppp.git/blob - freebsd-2.0/kinstall.sh
fixed up install target
[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 $SRC/bsd-comp.c \
20          $SRC/if_ppp.c $SRC/if_pppvar.h $SRC/netisr.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 # Add in patch to call PPP software interrupt routine.
51
52 d=i386
53 p=machdep.c
54 if [ -f $ARCHDIR/$d/$p ]; then
55   if ! grep -q NETISR_PPP $ARCHDIR/$d/$p; then
56     echo "Patching $ARCHDIR/$d/$p"
57     patch -p -N -d $ARCHDIR/$d < $SRC/$p.patch
58     DOMAKE=yes
59   fi
60 fi
61
62 # Tell the user to add a pseudo-device line to the configuration file.
63
64 if [ -f $CFILE ]; then
65   if ! grep -q '^[      ]*pseudo-device[        ][      ]*ppp' $CFILE; then
66     echo
67     echo "The currently-running kernel was built from configuration file"
68     echo "$CFILE, which does not include PPP."
69     echo "You need either to add a line like 'pseudo-device ppp 2' to"
70     echo "this file, or use another configuration file which includes"
71     echo "a line like this."
72     DOCONF=yes
73   fi
74 fi
75
76 if [ $DOCONF ]; then
77   echo
78   echo "You need to configure and build a new kernel."
79   echo "The procedure for doing this involves the following commands."
80   echo "(\"$CONF\" may be replaced by the name of another config file.)"
81   echo
82   echo "        cd $ARCHDIR/conf"
83   echo "        /usr/sbin/$CONFIG $CONF"
84   echo "        cd ../compile/$CONF"
85   DOMAKE=yes
86 elif [ $DOMAKE ]; then
87   echo "You need to build a new kernel."
88   echo "The procedure for doing this involves the following commands."
89   echo
90   echo "        cd $ARCHDIR/compile/$CONF"
91 fi
92 if [ $DOMAKE ]; then
93   echo "        make"
94   echo
95   echo "Then copy the new kernel ($ARCHDIR/compile/$CONF/freebsd)"
96   echo "to /freebsd and reboot.  (Keep a copy of the old /freebsd,"
97   echo "just in case.)"
98 fi