]> git.ozlabs.org Git - ppp.git/blob - freebsd-2.2.8/kinstall.sh
Previously, 64-bit compilation was dependent upon the version of the OS,
[ppp.git] / freebsd-2.2.8 / kinstall.sh
1 #!/bin/sh
2
3 # This script modifies the kernel sources in /usr/src/sys to install
4 # ppp-2.3.  It is intended to be run in the ppp-2.3 directory.
5 #
6 # This works for FreeBSD 2.2.8
7 # Most of the kernel files are already part of the kernel source
8 # but, this updates them for synchronous HDLC operation
9 #
10 # Paul Fulghum          19-Apr-99
11
12 KPATH=$(uname -v | sed 's/.*://')
13 CONF=$(echo $KPATH | sed 's;.*compile/;;')
14 SYS=$(echo $KPATH | sed 's;/compile/.*$;;')
15 ARCHDIR=$SYS/i386
16 CFILE=$ARCHDIR/conf/$CONF
17 SRC=freebsd-2.2.8
18 DOCONF=
19 DOMAKE=
20 CONFIG=config
21
22 # Patch files in /usr/src/sys/net
23
24 for f in if_ppp.h if_ppp.c ppp_tty.c ; do
25   dest=$SYS/net/$f
26   patch=$SRC/patch.$f
27   if [ -f $dest ]; then
28      echo -n "Patching $dest..."
29      if patch -s -C -N $dest < $patch 2> /dev/null; then
30         patch -s -N $dest < $patch
31         echo "successful."
32         DOMAKE=yes
33      else
34         if patch -s -C -R $dest < $patch 2> /dev/null; then
35            echo "already applied."
36         else
37            echo "failed (incorrect version or already applied)."
38         fi
39      fi
40   else
41     echo "Warning, file $dest not found"
42   fi
43 done
44
45 for f in if_ppp.h ; do
46   dest=/usr/include/net/$f
47   patch=$SRC/patch.$f
48   if [ -f $dest ]; then
49      echo -n "Patching $dest..."
50      if patch -s -C -N $dest < $patch 2> /dev/null; then
51         patch -s -N $dest < $patch
52         echo "successful."
53         DOMAKE=yes
54      else
55         if patch -s -C -R $dest < $patch 2> /dev/null; then
56            echo "already applied."
57         else
58            echo "failed (incorrect version or already applied)."
59         fi
60      fi
61   else
62     echo "Warning, file $dest not found"
63   fi
64 done
65
66 # Tell the user to add a pseudo-device line to the configuration file.
67
68 if [ -f $CFILE ]; then
69   if ! grep -q '^[      ]*pseudo-device[        ][      ]*ppp' $CFILE; then
70     echo
71     echo "The currently-running kernel was built from configuration file"
72     echo "$CFILE, which does not include PPP."
73     echo "You need either to add a line like 'pseudo-device ppp 2' to"
74     echo "this file, or use another configuration file which includes"
75     echo "a line like this."
76     DOCONF=yes
77   fi
78 fi
79
80 if [ $DOCONF ]; then
81   echo
82   echo "You need to configure and build a new kernel."
83   echo "The procedure for doing this involves the following commands."
84   echo "(\"$CONF\" may be replaced by the name of another config file.)"
85   echo
86   echo "        cd $ARCHDIR/conf"
87   echo "        /usr/sbin/$CONFIG $CONF"
88   echo "        cd ../../compile/$CONF"
89   echo "        make depend"
90   DOMAKE=yes
91 elif [ $DOMAKE ]; then
92   echo "You need to build a new kernel."
93   echo "The procedure for doing this involves the following commands."
94   echo
95   echo "        cd $KPATH"
96 fi
97 if [ $DOMAKE ]; then
98   echo "        make"
99   echo
100   echo "Then copy the new kernel ($KPATH/kernel) to /"
101   echo "and reboot.  (Keep a copy of the old /kernel, just in case.)"
102 fi