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 3.0/3.1
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 paulkf@microgate.com August 11, 1999
12 # 990911 - Added patch for ttycom.h that defines new IOCTL for sync support.
15 KPATH
=$
(uname
-v |
sed 's/.*://')
16 CONF
=$
(echo $KPATH |
sed 's;.*compile/;;')
17 SYS
=$
(echo $KPATH |
sed 's;/compile/.*$;;')
19 CFILE
=$ARCHDIR/conf
/$CONF
25 # Patch files in /usr/src/sys/net
27 for f
in if_ppp.h if_ppp.c ppp_tty.c
; do
31 echo -n "Patching $dest..."
32 if patch -s -C -N $dest < $patch 2> /dev
/null
; then
33 patch -s -N $dest < $patch
37 if patch -s -C -R $dest < $patch 2> /dev
/null
; then
38 echo "already applied."
40 echo "failed (incorrect version or already applied)."
44 echo "Warning, file $dest not found"
48 # Patch files in /usr/src/sys/sys
50 for f
in ttycom.h
; do
54 echo -n "Patching $dest..."
55 if patch -s -C -N $dest < $patch 2> /dev
/null
; then
56 patch -s -N $dest < $patch
60 if patch -s -C -R $dest < $patch 2> /dev
/null
; then
61 echo "already applied."
63 echo "failed (incorrect version or already applied)."
67 echo "Warning, file $dest not found"
71 # Patch files in /usr/include/net
73 for f
in if_ppp.h
; do
74 dest
=/usr
/include
/net
/$f
77 echo -n "Patching $dest..."
78 if patch -s -C -N $dest < $patch 2> /dev
/null
; then
79 patch -s -N $dest < $patch
83 if patch -s -C -R $dest < $patch 2> /dev
/null
; then
84 echo "already applied."
86 echo "failed (incorrect version or already applied)."
90 echo "Warning, file $dest not found"
94 # Patch files in /usr/include/sys
96 for f
in ttycom.h
; do
97 dest
=/usr
/include
/sys
/$f
100 echo -n "Patching $dest..."
101 if patch -s -C -N $dest < $patch 2> /dev
/null
; then
102 patch -s -N $dest < $patch
106 if patch -s -C -R $dest < $patch 2> /dev
/null
; then
107 echo "already applied."
109 echo "failed (incorrect version or already applied)."
113 echo "Warning, file $dest not found"
117 # Tell the user to add a pseudo-device line to the configuration file.
119 if [ -f $CFILE ]; then
120 if ! grep -q '^[ ]*pseudo-device[ ][ ]*ppp' $CFILE; then
122 echo "The currently-running kernel was built from configuration file"
123 echo "$CFILE, which does not include PPP."
124 echo "You need either to add a line like 'pseudo-device ppp 2' to"
125 echo "this file, or use another configuration file which includes"
126 echo "a line like this."
133 echo "You need to configure and build a new kernel."
134 echo "The procedure for doing this involves the following commands."
135 echo "(\"$CONF\" may be replaced by the name of another config file.)"
137 echo " cd $ARCHDIR/conf"
138 echo " /usr/sbin/$CONFIG $CONF"
139 echo " cd ../../compile/$CONF"
142 elif [ $DOMAKE ]; then
143 echo "You need to build a new kernel."
144 echo "The procedure for doing this involves the following commands."
151 echo "Then copy the new kernel ($KPATH/kernel) to /"
152 echo "and reboot. (Keep a copy of the old /kernel, just in case.)"