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.
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
10 # Paul Fulghum 19-Apr-99
12 KPATH=$(uname -v | sed 's/.*://')
13 CONF=$(echo $KPATH | sed 's;.*compile/;;')
14 SYS=$(echo $KPATH | sed 's;/compile/.*$;;')
16 CFILE=$ARCHDIR/conf/$CONF
22 # Patch files in /usr/src/sys/net
24 for f in if_ppp.h if_ppp.c ppp_tty.c ; do
28 echo -n "Patching $dest..."
29 if patch -s -C -N $dest < $patch 2> /dev/null; then
30 patch -s -N $dest < $patch
34 if patch -s -C -R $dest < $patch 2> /dev/null; then
35 echo "already applied."
37 echo "failed (incorrect version or already applied)."
41 echo "Warning, file $dest not found"
45 for f in if_ppp.h ; do
46 dest=/usr/include/net/$f
49 echo -n "Patching $dest..."
50 if patch -s -C -N $dest < $patch 2> /dev/null; then
51 patch -s -N $dest < $patch
55 if patch -s -C -R $dest < $patch 2> /dev/null; then
56 echo "already applied."
58 echo "failed (incorrect version or already applied)."
62 echo "Warning, file $dest not found"
66 # Tell the user to add a pseudo-device line to the configuration file.
68 if [ -f $CFILE ]; then
69 if ! grep -q '^[ ]*pseudo-device[ ][ ]*ppp' $CFILE; then
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."
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.)"
86 echo " cd $ARCHDIR/conf"
87 echo " /usr/sbin/$CONFIG $CONF"
88 echo " cd ../../compile/$CONF"
91 elif [ $DOMAKE ]; then
92 echo "You need to build a new kernel."
93 echo "The procedure for doing this involves the following commands."
100 echo "Then copy the new kernel ($KPATH/kernel) to /"
101 echo "and reboot. (Keep a copy of the old /kernel, just in case.)"