blob: 9eed477f99135b74b62135573f5acd993528c915 [file] [log] [blame] [raw]
#!/bin/csh -f
#
set dir=`pwd`
set karch=`uname -m`
if ( -d /sys/arch/$karch ) set archdir="/sys/arch/$karch"
if ( -d /sys/$karch ) set archdir="/sys/$karch"
set confdir="$archdir/conf"
if ( $dir =~ */BSDOS4* ) cd ..
echo -n "Uninstalling "
foreach i (ip_fil.[ch] ip_nat.[ch] ip_frag.[ch] ip_state.[ch] fil.c \
ip_auth.[ch] ip_proxy.[ch] ip_ftp_pxy.c ip_compat.h ip_log.c \
mlf_ipl.c ipl.h)
echo -n "$i ";
/bin/rm -f /sys/netinet/$i
end
echo ""
if ( -f /sys/netinet/ip_input.c ) then
echo "Unpatching ip_input.c, ip_output.c and in_proto.c"
cat BSDOS4/ip_{in,out}put.c.diffs BSDOS4/in_proto.c.diffs | \
(cd /sys/netinet; patch -R)
else
echo "Unpatching in_proto.c"
cat BSDOS4/in_proto.c.diffs | (cd /sys/netinet; patch -R)
foreach i (ip_input.o ip_output.o)
/bin/mv -f $archdir/OBJ/$i.preipf $archdir/OBJ/$i.preipf
end
endif
echo "Unpatching /sys/conf/files"
cat BSDOS4/files.diffs | (cd /sys/conf; patch -R)
set config=`(cd $confdir; /bin/ls -1t [0-9A-Z_]*) | head -1`
echo -n "Kernel configuration to update [$config] "
set newconfig=$<
if ( "$newconfig" != "" ) then
set config="$confdir/$newconfig"
else
set newconfig=$config
endif
if ( -f $confdir/$newconfig ) then
mv $confdir/$newconfig $confdir/$newconfig.bak
endif
if ( -d $archdir/../compile/$newconfig ) then
set bak=".bak"
set dot=0
while ( -d $archdir/../compile/${newconfig}.${bak} )
set bak=".bak.$dot"
set dot=`expr 1 + $dot`
end
mv $archdir/../compile/$newconfig $archdir/../compile/${newconfig}.${bak}
endif
egrep -v IPFILTER $confdir/$newconfig.bak > $confdir/$newconfig
echo 'You will now need to run "config" and build a new kernel.'
exit 0