]> git.ozlabs.org Git - ppp.git/blob - netbsd-1.2/kinstall.sh
update for 2.3.2
[ppp.git] / netbsd-1.2 / 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        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.2
14 DOCONF=
15 DOMAKE=
16 CONFIG=config
17
18 # Copy new versions of files into /sys/net
19
20 for f in net/if_ppp.h net/ppp-comp.h net/ppp_defs.h $SRC/bsd-comp.c \
21          $SRC/ppp-deflate.c $SRC/if_ppp.c $SRC/if_pppvar.h $SRC/ppp_tty.c \
22          $SRC/slcompress.c $SRC/slcompress.h common/zlib.c common/zlib.h; do
23   dest=$SYS/net/$(basename $f)
24   if [ -f $dest ]; then
25     if ! diff -qBI '[   ]\$[IN][de].*:.*\$' $f $dest >/dev/null; then
26       echo "Copying $f to $dest"
27       mv -f $dest $dest.orig && 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 # Tell the user to add a pseudo-device line to the configuration file
39 # and remake the kernel, if necessary.
40
41 if [ -f $CFILE ]; then
42   if ! grep -q '^[      ]*pseudo-device[        ][      ]*ppp' $CFILE; then
43     echo
44     echo "The currently-running kernel was built from configuration file"
45     echo "$CFILE, which does not include PPP."
46     echo "You need either to add a line like 'pseudo-device ppp 2' to"
47     echo "this file, or use another configuration file which includes"
48     echo "a line like this."
49     DOCONF=yes
50   fi
51 fi
52
53 if [ $DOCONF ]; then
54   echo
55   echo "You need to configure and build a new kernel."
56   echo "The procedure for doing this involves the following commands:"
57   echo "(\"$CONF\" may be replaced by the name of another config file.)"
58   echo
59   echo "        cd $ARCHDIR/conf"
60   echo "        /usr/sbin/$CONFIG $CONF"
61   echo "        cd ../compile/$CONF"
62   echo "        make depend"
63   DOMAKE=yes
64 elif [ $DOMAKE ]; then
65   echo
66   echo "You need to build a new kernel."
67   echo "The procedure for doing this involves the following commands:"
68   echo
69   echo "        cd $ARCHDIR/compile/$CONF"
70 fi
71 if [ $DOMAKE ]; then
72   echo "        make"
73   echo
74   echo "Then copy the new kernel ($ARCHDIR/compile/$CONF/netbsd)"
75   echo "to /netbsd and reboot.  (Keep a copy of the old /netbsd,"
76   echo "just in case.)"
77 fi