Add include/linux/if_pppol2tp.h, missed in a previous commit
[mpls-ppp.git] / netbsd-1.1 / kinstall.sh
blobbf25ae23021adae0025d9a000c4427a2f0d5c709
1 #!/bin/sh
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.
6 # Paul Mackerras 11-Dec-95
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=
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
24 # Copy new versions of files into /sys/net
26 for f in include/net/if_ppp.h include/net/ppp-comp.h include/net/ppp_defs.h \
27 $SRC/bsd-comp.c $SRC/ppp-deflate.c \
28 $SRC/if_ppp.c $SRC/if_pppvar.h $SRC/ppp_tty.c \
29 $SRC/slcompress.c $SRC/slcompress.h common/zlib.c common/zlib.h; do
30 dest=$SYS/net/$(basename $f)
31 if [ -f $dest ]; then
32 if ! diff -qBI '[ ]\$[IN][de].*:.*\$' $f $dest >/dev/null; then
33 echo "Copying $f to $dest"
34 mv -f $dest $dest.orig && echo " (old version saved in $dest.orig)"
35 cp $f $dest
36 DOMAKE=yes
38 else
39 echo "Copying $f to $dest"
40 cp $f $dest
41 DOMAKE=yes
43 done
45 OLDFILES=files.oldconf
46 NEWFILES=files
47 OLDCONFIG=config.old
48 NEWCONFIG=config
50 if [ -f $SYS/conf/$OLDFILES ]; then
51 if ! grep -q ppp-deflate $SYS/conf/$OLDFILES; then
52 echo "Patching $SYS/conf/$OLDFILES"
53 patch -N $SYS/conf/$OLDFILES <$SRC/files.oldconf.patch
54 if [ $CONFIG = $OLDCONFIG ]; then
55 DOCONF=yes
59 if [ -f $SYS/conf/$NEWFILES ]; then
60 if ! grep -q ppp-deflate $SYS/conf/$NEWFILES; then
61 echo "Patching $SYS/conf/$NEWFILES"
62 patch -N $SYS/conf/$NEWFILES <$SRC/files.patch
63 if [ $CONFIG = $NEWCONFIG ]; then
64 DOCONF=yes
69 # Tell the user to add a pseudo-device line to the configuration file
70 # and remake the kernel, if necessary.
72 if [ -f $CFILE ]; then
73 if ! grep -q '^[ ]*pseudo-device[ ][ ]*ppp' $CFILE; then
74 echo
75 echo "The currently-running kernel was built from configuration file"
76 echo "$CFILE, which does not include PPP."
77 echo "You need either to add a line like 'pseudo-device ppp 2' to"
78 echo "this file, or use another configuration file which includes"
79 echo "a line like this."
80 DOCONF=yes
84 if [ $DOCONF ]; then
85 echo
86 echo "You need to configure and build a new kernel."
87 echo "The procedure for doing this involves the following commands:"
88 echo "(\"$CONF\" may be replaced by the name of another config file.)"
89 echo
90 echo " cd $ARCHDIR/conf"
91 echo " /usr/sbin/$CONFIG $CONF"
92 echo " cd ../compile/$CONF"
93 echo " make depend"
94 DOMAKE=yes
95 elif [ $DOMAKE ]; then
96 echo
97 echo "You need to build a new kernel."
98 echo "The procedure for doing this involves the following commands:"
99 echo
100 echo " cd $ARCHDIR/compile/$CONF"
102 if [ $DOMAKE ]; then
103 echo " make"
104 echo
105 echo "Then copy the new kernel ($ARCHDIR/compile/$CONF/netbsd)"
106 echo "to /netbsd and reboot. (Keep a copy of the old /netbsd,"
107 echo "just in case.)"