summaryrefslogtreecommitdiff
path: root/OpenBSD/unkinstall
diff options
context:
space:
mode:
Diffstat (limited to 'OpenBSD/unkinstall')
-rw-r--r--OpenBSD/unkinstall53
1 files changed, 53 insertions, 0 deletions
diff --git a/OpenBSD/unkinstall b/OpenBSD/unkinstall
new file mode 100644
index 0000000000000..c4f77f7a64411
--- /dev/null
+++ b/OpenBSD/unkinstall
@@ -0,0 +1,53 @@
+#! /bin/sh
+#
+# kinstall/minstall - install patches to kernel sources
+#
+# WARNING: This script should be run exactly once on a virgin system
+#
+PATH=/sbin:/usr/sbin:/bin:/usr/bin; export PATH
+
+# try to bomb out fast if anything fails....
+set -e
+
+argv0=`basename $0`
+dir=`pwd`
+karch=`uname -m`
+archdir="/sys/arch/$karch"
+confdir="$archdir/conf"
+
+case "$dir" in
+*/OpenBSD )
+ cd ..
+ ;;
+esac
+
+echo -n "Removing "
+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
+do
+ echo -n "/sys/netinet/$i "
+ /bin/rm -f /sys/netinet/$i
+done
+echo
+
+if [ -f /sys/netinet/ipfbackup.tar ] ; then
+ echo -n "Restoring old kernel sources"
+ ( cd /sys/netinet ; tar xpf ipfbackup.tar )
+fi
+echo
+
+echo "Unpatching /sys/conf/files ..."
+cat OpenBSD/files.diffs | (cd /sys/conf; patch -R)
+
+echo -n "Kernel configuration to update [GENERIC] "
+read newconfig junk
+
+if [ -n "$newconfig" ] ; then
+ config="$confdir/$newconfig"
+else
+ newconfig="$confdir/GENERIC"
+fi
+
+mv $archdir/compile/$newconfig $archdir/compile/$newconfig.bak
+egrep -v 'IPFILTER' $confdir/$newconfig.bak > $confdir/$newconfig
+echo 'You will now need to run "config" and build a new kernel.'
+exit 0