| #!/bin/csh -f |
| # |
| set dir=`pwd` |
| if ($dir =~ */SunOS4) cd .. |
| echo -n "Uninstalling " |
| foreach i (ip_fil.[ch] ip_nat.[ch] ip_frag.[ch] ip_state.[ch] ip_auth.[ch] \ |
| ip_proxy.[ch] ip_ftp_pxy.c fil.c ip_compat.h ip_log.c) |
| echo -n "$i " |
| /bin/rm /sys/netinet/$i |
| end |
| echo "Uninstalling ip_input.c and ip_output.c" |
| /bin/rm /sys/netinet/{ip_input.c,ip_output.c} |
| |
| echo "Unpatching /sys/sun/conf.c" |
| cat SunOS4/conf.c.diff | (cd /sys/sun; patch -R) |
| echo "Unpatching /sys/conf.common/files.cmn" |
| cat SunOS4/files.cmn.diff | (cd /sys/conf.common; patch -R) |
| echo "Unpatching /sys/netinet/in_proto.c" |
| cat SunOS4/in_proto.c.diffs | (cd /sys/netinet; patch -R) |
| |
| set karch=`/bin/arch -k` |
| set confdir="/sys/$karch/conf" |
| set config=`/bin/ls -1t $confdir | head -1` |
| |
| echo -n "Kernel configuration to update [$config] " |
| set newconfig=$< |
| if ( "$newconfig" == "" ) then |
| set newconfig=$config |
| endif |
| echo "Updating $newconfig..." |
| if ( -d /sys/$karch/$newconfig ) then |
| mv /sys/$karch/$newconfig /sys/$karch/$newconfig.bak |
| endif |
| mv $confdir/$newconfig $confdir/$newconfig.bak |
| egrep -v 'options.*IPFILTER' $confdir/$newconfig.bak > $confdir/$newconfig |
| echo "Running config $newconfig" |
| cd $confdir |
| config $newconfig |
| echo "Building a new kernel" |
| cd ../$newconfig |
| make |
| if ($status == 0) then |
| echo "New kernel is: /sys/$karch/$newconfig/vmunix" |
| ls -ls /sys/$karch/$newconfig/vmunix |
| endif |
| exit 0 |