5 if ( -d /sys/arch/$karch ) set archdir="/sys/arch/$karch"
6 if ( -d /sys/$karch ) set archdir="/sys/$karch"
7 set confdir="$archdir/conf"
9 if ( $dir =~ */FreeBSD* ) cd ..
11 foreach i (ip_{auth,fil,frag,nat,pool,proxy,scan,state,sync}.[ch] fil.c \
12 ip_*_pxy.c mlf_ipl.c ipl.h ip_compat.h ip_log.c)
15 chmod 644 /sys/netinet/$i
18 /bin/cp $i /usr/include/netinet/$i
19 chmod 644 /usr/include/netinet/$i
24 echo "Copying /usr/include/osreldate.h to /sys/sys"
25 cp /usr/include/osreldate.h /sys/sys
26 echo "Patching ip_input.c, ip_output.c and in_proto.c"
27 cat FreeBSD-2.2/ip_{in,out}put.c.diffs FreeBSD-2.2/in_proto.c.diffs | \
28 (cd /sys/netinet; patch)
30 if ( -f /sys/conf/files.newconf ) then
31 echo "Patching /sys/conf/files.newconf"
32 cat FreeBSD-2.2/files.newconf.diffs | (cd /sys/conf; patch)
33 echo "Patching /sys/conf/files"
34 cat FreeBSD-2.2/files.diffs | (cd /sys/conf; patch)
36 if ( -f /sys/conf/files.oldconf ) then
37 echo "Patching /sys/conf/files.oldconf"
38 cat FreeBSD-2.2/files.oldconf.diffs | (cd /sys/conf; patch)
39 echo "Patching /sys/conf/files"
40 cat FreeBSD-2.2/filez.diffs | (cd /sys/conf; patch)
43 set config=`(cd $confdir; /bin/ls -1t [0-9A-Z_]*) | head -1`
44 echo -n "Kernel configuration to update [$config] "
46 if ( "$newconfig" != "" ) then
47 set config="$confdir/$newconfig"
51 echo "Re-config'ing $newconfig..."
52 if ( -f $confdir/$newconfig ) then
53 mv $confdir/$newconfig $confdir/$newconfig.bak
55 if ( -d $archdir/../compile/$newconfig ) then
58 while ( -d $archdir/../compile/${newconfig}.${bak} )
60 set dot=`expr 1 + $dot`
62 mv $archdir/../compile/$newconfig $archdir/../compile/${newconfig}.${bak}
64 awk '{print $0;if($2=="INET"){print"options IPFILTER"}}' \
65 $confdir/$newconfig.bak > $confdir/$newconfig
66 echo 'You will now need to run "config" and build a new kernel.'