]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - OpenBSD-2/unkinstall
Import IP-Filter 5.1.2 into vendor branches using the existing license that
[FreeBSD/FreeBSD.git] / OpenBSD-2 / unkinstall
1 #! /bin/sh
2 #
3 #       kinstall/minstall - install patches to kernel sources
4 #
5 # WARNING:  This script should be run exactly once on a virgin system
6 #
7 PATH=/sbin:/usr/sbin:/bin:/usr/bin; export PATH
8
9 # try to bomb out fast if anything fails....
10 set -e
11
12 argv0=`basename $0`
13 dir=`pwd`
14 karch=`uname -m`
15 archdir="/sys/arch/$karch"
16 confdir="$archdir/conf"
17
18 case "$dir" in
19 */OpenBSD-2 )
20          cd ..
21          ;;
22 esac
23
24 echo -n "Removing "
25 for i in ip_fil.[ch] ip_nat.[ch] ip_frag.[ch] ip_state.[ch] fil.c ip_compat.h ip_proxy.[ch] ip_ftp_pxy.c ip_auth.[ch] ip_log.c
26 do
27         echo -n "/sys/netinet/$i "
28         /bin/rm -f /sys/netinet/$i
29 done
30 echo
31
32 if [ -f /sys/netinet/ipfbackup.tar ] ; then
33         echo -n "Restoring old kernel sources"
34         ( cd /sys/netinet ; tar xpf ipfbackup.tar )
35 fi
36 echo
37
38 echo "Unpatching /sys/conf/files ..."
39 cat OpenBSD-2/files.diffs | (cd /sys/conf; patch -R)
40
41 echo -n "Kernel configuration to update [GENERIC] "
42 read newconfig junk
43
44 if [ -n "$newconfig" ] ; then
45         config="$confdir/$newconfig"
46 else
47         newconfig="$confdir/GENERIC"
48 fi
49
50 mv $archdir/compile/$newconfig $archdir/compile/$newconfig.bak
51 egrep -v 'IPFILTER' $confdir/$newconfig.bak > $confdir/$newconfig
52 echo 'You will now need to run "config" and build a new kernel.'
53 exit 0