#!/bin/sh

echo
echo "This script will upgrade a *virgin* 1.1 source tree to 1.1.5.1"
echo


diffs="base contrib etc games gnu include lib libcrypt libexec sbin share \
  srcbin sys usrbin usrsbin"

R=/
P=`pwd`
need=22100    

ok=1

for i in $diffs; do
  if [ ! -f $i.diffs.gz ]; then
    echo "could not find $i.diffs.gz!!"
    ok=0
  fi
done
if [ $ok = 0 ]; then
  exit 1;
fi

if [ `id | awk '{print $1}'` != "uid=0(root)" ]; then
  echo "You must run as root to perform this upgrade"
  exit 1;
fi

remain=`df -k /usr/src | grep /dev/ | awk ' {print $4}'` 
if [ "$remain" -lt $need ]; then
  echo  "You need at least $need Kbytes to perform this upgrade, $remain K available"
  exit 1;
fi

echo -n "Ready to go? [y] "
read answ; if [ "$answ" = "" ]; then answ=y; fi;
if [ $answ != y ]; then exit 1; fi

echo "Patching base"
cd $R || exit 1;
zcat $P/base.diffs.gz | patch -p1 -s  || exit 1;

echo "Patching contrib"
cd $R || exit 1;
rm -rf ${R}usr/src/contrib/xntpd/adjtime
rm -rf ${R}usr/src/contrib/xntpd/compilers
rm -rf ${R}usr/src/contrib/xntpd/gadget
rm -rf ${R}usr/src/contrib/xntpd/hints
rm     ${R}usr/src/contrib/xntpd/kernel/.keep_me
rm -rf ${R}usr/src/contrib/xntpd/machines
rm -rf ${R}usr/src/contrib/xntpd/ppsclock
zcat $P/contrib.diffs.gz | patch -p1 -s  || exit 1;

echo "Patching etc"
cd $R || exit 1;
rm ${R}usr/src/etc/etc.i386/floppy.install_notes
rm ${R}usr/src/etc/etc.i386/install_notes

zcat $P/etc.diffs.gz | patch -p1 -s  || exit 1;

echo "Patching games"
cd $R || exit 1;
rm -rf ${R}usr/src/games/hack
zcat $P/games.diffs.gz | patch -p1 -s  || exit 1;

echo "Patching gnu"
cd $R || exit 1;
mv ${R}usr/src/gnu/usr.bin/gdb ${R}usr/src/gnu/usr.bin/kgdb
mv ${R}usr/src/gnu/usr.bin/kgdb/gdb.1 ${R}usr/src/gnu/usr.bin/kgdb/kgdb.1
rm -rf ${R}usr/src/gnu/usr.bin/kgdb/readline
for i in call config dial dialcode passwd port sys1 sys2; do
  mv ${R}usr/src/gnu/libexec/uucp/sample/$i ${R}usr/src/gnu/libexec/uucp/sample/$i.sample
done

for i in assert.h bstring.h ctype.h curses.h dir.h dirent.h errno.h fcntl.h gen \
  grp.h math.h memory.h netdb.h pwd.h setjmp.h signal.h stdarg.h \
  stddef.h stdio.h stdlib.h string.h strings.h sys time.h unistd.h values.h; do
  rm -rf ${R}usr/src/gnu/lib/libg++/g++-include/$i
done
rm ${R}usr/src/gnu/libexec/uucp/common_sources/conf.h

mv ${R}usr/src/gnu/usr.bin/man/catman/catman ${R}usr/src/gnu/usr.bin/man/catman/catman.sh
zcat $P/gnu.diffs.gz | patch -p1 -s  || exit 1;

echo "Patching include"
cd $R || exit 1;
zcat $P/include.diffs.gz | patch -p1 -s  || exit 1;


echo "Patching lib"
cd $R || exit 1;
rm ${R}usr/src/lib/csu.i386/crt1.c
rm ${R}usr/src/lib/libc/gen/isctype.c
rm ${R}usr/src/lib/libc/gen/setrgid.c
rm ${R}usr/src/lib/libc/gen/setruid.c
rm ${R}usr/src/lib/libc/gen/setuid.3
rm ${R}usr/src/lib/libc/stdio/fgetline.3
rm ${R}usr/src/lib/libc/stdlib/multibyte.c
zcat $P/lib.diffs.gz | patch -p1 -s  || exit 1;

if [ -d ${R}usr/src/lib/libcrypt ]; then
  echo "Patching libcrypt"
  cd $R || exit 1;
  zcat $P/libcrypt.diffs.gz | patch -p1 -s  
else
  echo "libcrypt not found. Skipping patch"
fi

echo "Patching libexec"
cd $R || exit 1;
zcat $P/libexec.diffs.gz | patch -p1 -s  || exit 1;

echo "Patching sbin"
cd $R || exit 1;
rm -rf ${R}usr/src/sbin/XNSrouted
rm -rf ${R}usr/src/sbin/routed
zcat $P/sbin.diffs.gz | patch -p1 -s  || exit 1;


echo "Patching share"
cd $R || exit 1;
rm ${R}usr/src/share/man/man4/man4.i386/lpa.4
rm ${R}usr/src/share/syscons/fonts/[a-z]*
zcat $P/share.diffs.gz | patch -p1 -s  || exit 1;

echo "Patching srcbin"
cd $R || exit 1;
mv ${R}usr/src/bin/ed/glob.c ${R}usr/src/bin/ed/glbl.c
zcat $P/srcbin.diffs.gz | patch -p1 -s  || exit 1;


echo "Patching sys"
cd $R || exit 1;
rm     ${R}usr/src/sys/i386/conf/SYSCONS
rm -rf ${R}usr/src/sys/i386/doc
rm     ${R}usr/src/sys/i386/isa/debug.h
rm     ${R}usr/src/sys/i386/isa/sound/debug.h
rm     ${R}usr/src/sys/i386/isa/sound/dsp.c
rm     ${R}usr/src/sys/i386/netboot/wd80x3.c
rm     ${R}usr/src/sys/net/ppp.h
echo >>${R}usr/src/sys/sys/syscall.h
zcat $P/sys.diffs.gz | patch -p1 -s  || exit 1;


echo "Patching usrbin"
cd $R || exit 1;
rm -rf ${R}usr/src/usr.bin/syscons
rm -rf ${R}usr/src/usr.bin/vi/include
rm -rf ${R}usr/src/usr.bin/vi/interrupt.h
rm -rf ${R}usr/src/usr.bin/vi/nex
rm -rf ${R}usr/src/usr.bin/vi/nvi
rm     ${R}usr/src/usr.bin/vi/vi.1
zcat $P/usrbin.diffs.gz | patch -p1 -s  || exit 1;

echo "Patching usrsbin"
cd $R || exit 1;
rm -rf ${R}usr/src/usr.sbin/flcopy
zcat $P/usrsbin.diffs.gz | patch -p1 -s  || exit 1;


echo "Resetting executable bit in new files"
for i in \
  usr/src/contrib/adduser/AddIt \
  usr/src/contrib/configit/ConfigIt \
  usr/src/contrib/crunch/crunchgen/mkskel.sh \
  usr/src/contrib/xntpd/include/ntp_in.h \
  usr/src/contrib/xntpd/lib/findconfig.c \
  usr/src/etc/etc.i386/EXTRACT_bin.sh \
  usr/src/etc/etc.i386/EXTRACT_secr.sh \
  usr/src/etc/etc.i386/EXTRACT_src.sh \
  usr/src/gnu/libexec/uucp/contrib/uureroute.perl \
  usr/src/gnu/libexec/uucp/contrib/uuxconv \
  usr/src/gnu/usr.bin/cc25/gnu2bsd.tcl \
  usr/src/gnu/usr.bin/gdb/doc/config.status \
  usr/src/gnu/usr.bin/ptx/examples/include.pl \
  usr/src/gnu/usr.bin/ptx/mkinstalldirs \
  usr/src/lib/libmalloc/tests/munge.sh \
  usr/src/lib/libmalloc/tests/plot.sh \
  usr/src/lib/libmalloc/tests/regress \
  usr/src/lib/libmalloc/tests/testrun.sh; do
  chmod +x ${R}$i
done



echo "Making links in contrib"
cd ${R}usr/src/contrib/crunch/crunchgen/ ; ln -s ${R}usr/obj/contrib/crunch/crunchgen obj
cd ${R}usr/src/contrib/crunch/crunchide/ ; ln -s ${R}usr/obj/contrib/crunch/crunchide obj
cd ${R}usr/src/contrib/manctl/ ; ln -s ${R}usr/obj/contrib/manctl obj
cd ${R}usr/src/contrib/tcpdump/tcpdump/ ; ln -s ${R}usr/obj/contrib/tcpdump/tcpdump obj
cd ${R}usr/src/contrib/tcpdump/tcpslice/ ; ln -s ${R}usr/obj/contrib/tcpdump/tcpslice obj
cd ${R}usr/src/contrib/xntpd/authstuff/ ; ln -s ${R}usr/obj/contrib/xntpd/authstuff obj
cd ${R}usr/src/contrib/xntpd/lib/ ; ln -s ${R}usr/obj/contrib/xntpd/lib obj
cd ${R}usr/src/contrib/xntpd/ntpdate/ ; ln -s ${R}usr/obj/contrib/xntpd/ntpdate obj
cd ${R}usr/src/contrib/xntpd/ntpq/ ; ln -s ${R}usr/obj/contrib/xntpd/ntpq obj
cd ${R}usr/src/contrib/xntpd/ntptrace/ ; ln -s ${R}usr/obj/contrib/xntpd/ntptrace obj
cd ${R}usr/src/contrib/xntpd/parse/ ; ln -s ${R}usr/obj/contrib/xntpd/parse obj
cd ${R}usr/src/contrib/xntpd/util/ ; ln -s ${R}usr/obj/contrib/xntpd/util obj
cd ${R}usr/src/contrib/xntpd/xntpd/ ; ln -s ${R}usr/obj/contrib/xntpd/xntpd obj
cd ${R}usr/src/contrib/xntpd/xntpdc/ ; ln -s ${R}usr/obj/contrib/xntpd/xntpdc obj
cd ${R}usr/src/contrib/xntpd/xntpres/ ; ln -s ${R}usr/obj/contrib/xntpd/xntpres obj
touch ${R}usr/src/contrib/xntpd/xntpd/minpoll

echo "Making links in games"
cd ${R}usr/src/games/arithmetic/; ln -s  ${R}usr/obj/games/arithmetic obj
cd ${R}usr/src/games/atc/; ln -s  ${R}usr/obj/games/atc obj
cd ${R}usr/src/games/backgammon/backgammon/; ln -s  ${R}usr/obj/games/backgammon/backgammon obj
cd ${R}usr/src/games/backgammon/teachgammon/; ln -s  ${R}usr/obj/games/backgammon/teachgammon obj
cd ${R}usr/src/games/banner/; ln -s  ${R}usr/obj/games/banner obj
cd ${R}usr/src/games/battlestar/; ln -s  ${R}usr/obj/games/battlestar obj
cd ${R}usr/src/games/bcd/; ln -s  ${R}usr/obj/games/bcd obj
cd ${R}usr/src/games/caesar/; ln -s  ${R}usr/obj/games/caesar obj
cd ${R}usr/src/games/canfield/canfield/; ln -s  ${R}usr/obj/games/canfield/canfield obj
cd ${R}usr/src/games/canfield/cfscores/; ln -s  ${R}usr/obj/games/canfield/cfscores obj
cd ${R}usr/src/games/cribbage/; ln -s  ${R}usr/obj/games/cribbage obj
cd ${R}usr/src/games/dm/; ln -s  ${R}usr/obj/games/dm obj
cd ${R}usr/src/games/factor/; ln -s  ${R}usr/obj/games/factor obj
cd ${R}usr/src/games/fish/; ln -s  ${R}usr/obj/games/fish obj
cd ${R}usr/src/games/fortune/datfiles/; ln -s  ${R}usr/obj/games/fortune/datfiles obj
cd ${R}usr/src/games/fortune/fortune/; ln -s  ${R}usr/obj/games/fortune/fortune obj
cd ${R}usr/src/games/fortune/strfile/; ln -s  ${R}usr/obj/games/fortune/strfile obj
cd ${R}usr/src/games/hangman/; ln -s  ${R}usr/obj/games/hangman obj
cd ${R}usr/src/games/larn/; ln -s  ${R}usr/obj/games/larn obj
cd ${R}usr/src/games/mille/; ln -s  ${R}usr/obj/games/mille obj
cd ${R}usr/src/games/monop/; ln -s  ${R}usr/obj/games/monop obj
cd ${R}usr/src/games/morse/; ln -s  ${R}usr/obj/games/morse obj
cd ${R}usr/src/games/number/; ln -s  ${R}usr/obj/games/number obj
cd ${R}usr/src/games/pom/; ln -s  ${R}usr/obj/games/pom obj
cd ${R}usr/src/games/ppt/; ln -s  ${R}usr/obj/games/ppt obj
cd ${R}usr/src/games/primes/; ln -s  ${R}usr/obj/games/primes obj
cd ${R}usr/src/games/rain/; ln -s  ${R}usr/obj/games/rain obj
cd ${R}usr/src/games/robots/; ln -s  ${R}usr/obj/games/robots obj
cd ${R}usr/src/games/rogue/; ln -s  ${R}usr/obj/games/rogue obj
cd ${R}usr/src/games/sail/; ln -s  ${R}usr/obj/games/sail obj
cd ${R}usr/src/games/snake/snake/; ln -s  ${R}usr/obj/games/snake/snake obj
cd ${R}usr/src/games/snake/snscore/; ln -s  ${R}usr/obj/games/snake/snscore obj
cd ${R}usr/src/games/trek/; ln -s  ${R}usr/obj/games/trek obj
cd ${R}usr/src/games/worm/; ln -s  ${R}usr/obj/games/worm obj
cd ${R}usr/src/games/worms/; ln -s  ${R}usr/obj/games/worms obj
cd ${R}usr/src/games/wump/; ln -s  ${R}usr/obj/games/wump obj

echo "Making links in gnu"
cd ${R}usr/src/gnu/games/chess/ ; ln -s ${R}usr/obj/gnu/games/chess obj
cd ${R}usr/src/gnu/lib/libg++/genclass/ ; ln -s ${R}usr/obj/gnu/lib/libg++/genclass obj
cd ${R}usr/src/gnu/lib/libg++/libg++/ ; ln -s ${R}usr/obj/gnu/lib/libg++/libg++ obj
cd ${R}usr/src/gnu/lib/libmalloc/ ; ln -s ${R}usr/obj/gnu/lib/libmalloc obj
cd ${R}usr/src/gnu/lib/libreadline/ ; ln -s ${R}usr/obj/gnu/lib/libreadline obj
cd ${R}usr/src/gnu/lib/libregex/ ; ln -s ${R}usr/obj/gnu/lib/libregex obj
cd ${R}usr/src/gnu/libexec/uucp/cu/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/cu obj
cd ${R}usr/src/gnu/libexec/uucp/libunix/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/libunix obj
cd ${R}usr/src/gnu/libexec/uucp/libuuconf/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/libuuconf obj
cd ${R}usr/src/gnu/libexec/uucp/libuucp/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/libuucp obj
cd ${R}usr/src/gnu/libexec/uucp/uuchk/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/uuchk obj
cd ${R}usr/src/gnu/libexec/uucp/uucico/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/uucico obj
cd ${R}usr/src/gnu/libexec/uucp/uuconv/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/uuconv obj
cd ${R}usr/src/gnu/libexec/uucp/uucp/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/uucp obj
cd ${R}usr/src/gnu/libexec/uucp/uulog/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/uulog obj
cd ${R}usr/src/gnu/libexec/uucp/uuname/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/uuname obj
cd ${R}usr/src/gnu/libexec/uucp/uupick/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/uupick obj
cd ${R}usr/src/gnu/libexec/uucp/uusched/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/uusched obj
cd ${R}usr/src/gnu/libexec/uucp/uustat/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/uustat obj
cd ${R}usr/src/gnu/libexec/uucp/uuto/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/uuto obj
cd ${R}usr/src/gnu/libexec/uucp/uux/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/uux obj
cd ${R}usr/src/gnu/libexec/uucp/uuxqt/ ; ln -s ${R}usr/obj/gnu/libexec/uucp/uuxqt obj
cd ${R}usr/src/gnu/usr.bin/as/ ; ln -s ${R}usr/obj/gnu/usr.bin/as obj
cd ${R}usr/src/gnu/usr.bin/awk/ ; ln -s ${R}usr/obj/gnu/usr.bin/awk obj
cd ${R}usr/src/gnu/usr.bin/bc/ ; ln -s ${R}usr/obj/gnu/usr.bin/bc obj
cd ${R}usr/src/gnu/usr.bin/cc/cc/ ; ln -s ${R}usr/obj/gnu/usr.bin/cc/cc obj
cd ${R}usr/src/gnu/usr.bin/cc/cc1/ ; ln -s ${R}usr/obj/gnu/usr.bin/cc/cc1 obj
cd ${R}usr/src/gnu/usr.bin/cc/cc1obj/ ; ln -s ${R}usr/obj/gnu/usr.bin/cc/cc1obj obj
cd ${R}usr/src/gnu/usr.bin/cc/cc1plus/ ; ln -s ${R}usr/obj/gnu/usr.bin/cc/cc1plus obj
cd ${R}usr/src/gnu/usr.bin/cc/cpp/ ; ln -s ${R}usr/obj/gnu/usr.bin/cc/cpp obj
cd ${R}usr/src/gnu/usr.bin/cc/lib/ ; ln -s ${R}usr/obj/gnu/usr.bin/cc/lib obj
cd ${R}usr/src/gnu/usr.bin/cc/libgcc/ ; ln -s ${R}usr/obj/gnu/usr.bin/cc/libgcc obj
cd ${R}usr/src/gnu/usr.bin/cc/libobjc/ ; ln -s ${R}usr/obj/gnu/usr.bin/cc/libobjc obj
cd ${R}usr/src/gnu/usr.bin/cpio/ ; ln -s ${R}usr/obj/gnu/usr.bin/cpio obj
cd ${R}usr/src/gnu/usr.bin/cvs/cvs/ ; ln -s ${R}usr/obj/gnu/usr.bin/cvs/cvs obj
cd ${R}usr/src/gnu/usr.bin/cvs/lib/ ; ln -s ${R}usr/obj/gnu/usr.bin/cvs/lib obj
cd ${R}usr/src/gnu/usr.bin/cvs/mkmodules/ ; ln -s ${R}usr/obj/gnu/usr.bin/cvs/mkmodules obj
cd ${R}usr/src/gnu/usr.bin/dc/ ; ln -s ${R}usr/obj/gnu/usr.bin/dc obj
cd ${R}usr/src/gnu/usr.bin/diff/ ; ln -s ${R}usr/obj/gnu/usr.bin/diff obj
cd ${R}usr/src/gnu/usr.bin/diff3/ ; ln -s ${R}usr/obj/gnu/usr.bin/diff3 obj
cd ${R}usr/src/gnu/usr.bin/gdb/bfd/ ; ln -s ${R}usr/obj/gnu/usr.bin/gdb/bfd obj
cd ${R}usr/src/gnu/usr.bin/gdb/gdb/ ; ln -s ${R}usr/obj/gnu/usr.bin/gdb/gdb obj
cd ${R}usr/src/gnu/usr.bin/gdb/libiberty/ ; ln -s ${R}usr/obj/gnu/usr.bin/gdb/libiberty obj
cd ${R}usr/src/gnu/usr.bin/gdb/mmalloc/ ; ln -s ${R}usr/obj/gnu/usr.bin/gdb/mmalloc obj
cd ${R}usr/src/gnu/usr.bin/grep/ ; ln -s ${R}usr/obj/gnu/usr.bin/grep obj
cd ${R}usr/src/gnu/usr.bin/groff/addftinfo/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/addftinfo obj
cd ${R}usr/src/gnu/usr.bin/groff/devices/devascii/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/devices/devascii obj
cd ${R}usr/src/gnu/usr.bin/groff/devices/devlatin1/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/devices/devlatin1 obj
cd ${R}usr/src/gnu/usr.bin/groff/eqn/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/eqn obj
cd ${R}usr/src/gnu/usr.bin/groff/grodvi/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/grodvi obj
cd ${R}usr/src/gnu/usr.bin/groff/groff/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/groff obj
cd ${R}usr/src/gnu/usr.bin/groff/grops/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/grops obj
cd ${R}usr/src/gnu/usr.bin/groff/grotty/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/grotty obj
cd ${R}usr/src/gnu/usr.bin/groff/indxbib/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/indxbib obj
cd ${R}usr/src/gnu/usr.bin/groff/libbib/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/libbib obj
cd ${R}usr/src/gnu/usr.bin/groff/libdriver/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/libdriver obj
cd ${R}usr/src/gnu/usr.bin/groff/libgroff/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/libgroff obj
cd ${R}usr/src/gnu/usr.bin/groff/lkbib/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/lkbib obj
cd ${R}usr/src/gnu/usr.bin/groff/lookbib/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/lookbib obj
cd ${R}usr/src/gnu/usr.bin/groff/man/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/man obj
cd ${R}usr/src/gnu/usr.bin/groff/mm/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/mm obj
cd ${R}usr/src/gnu/usr.bin/groff/nroff/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/nroff obj
cd ${R}usr/src/gnu/usr.bin/groff/pfbtops/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/pfbtops obj
cd ${R}usr/src/gnu/usr.bin/groff/pic/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/pic obj
cd ${R}usr/src/gnu/usr.bin/groff/psbb/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/psbb obj
cd ${R}usr/src/gnu/usr.bin/groff/refer/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/refer obj
cd ${R}usr/src/gnu/usr.bin/groff/tbl/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/tbl obj
cd ${R}usr/src/gnu/usr.bin/groff/tfmtodit/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/tfmtodit obj
cd ${R}usr/src/gnu/usr.bin/groff/tmac/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/tmac obj
cd ${R}usr/src/gnu/usr.bin/groff/troff/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/troff obj
cd ${R}usr/src/gnu/usr.bin/groff/xditview/ ; ln -s ${R}usr/obj/gnu/usr.bin/groff/xditview obj
cd ${R}usr/src/gnu/usr.bin/gzip/ ; ln -s ${R}usr/obj/gnu/usr.bin/gzip obj
cd ${R}usr/src/gnu/usr.bin/kgdb/ ; ln -s ${R}usr/obj/gnu/usr.bin/kgdb obj
cd ${R}usr/src/gnu/usr.bin/ld/ldconfig/ ; ln -s ${R}usr/obj/gnu/usr.bin/ld/ldconfig obj
cd ${R}usr/src/gnu/usr.bin/ld/ldd/ ; ln -s ${R}usr/obj/gnu/usr.bin/ld/ldd obj
cd ${R}usr/src/gnu/usr.bin/ld/rtld/ ; ln -s ${R}usr/obj/gnu/usr.bin/ld/rtld obj
cd ${R}usr/src/gnu/usr.bin/ld/ ; ln -s ${R}usr/obj/gnu/usr.bin/ld obj
cd ${R}usr/src/gnu/usr.bin/man/apropos/ ; ln -s ${R}usr/obj/gnu/usr.bin/man/apropos obj
cd ${R}usr/src/gnu/usr.bin/man/catman/ ; ln -s ${R}usr/obj/gnu/usr.bin/man/catman obj
cd ${R}usr/src/gnu/usr.bin/man/lib/ ; ln -s ${R}usr/obj/gnu/usr.bin/man/lib obj
cd ${R}usr/src/gnu/usr.bin/man/makewhatis/ ; ln -s ${R}usr/obj/gnu/usr.bin/man/makewhatis obj
cd ${R}usr/src/gnu/usr.bin/man/man/ ; ln -s ${R}usr/obj/gnu/usr.bin/man/man obj
cd ${R}usr/src/gnu/usr.bin/man/manpath/ ; ln -s ${R}usr/obj/gnu/usr.bin/man/manpath obj
cd ${R}usr/src/gnu/usr.bin/man/whatis/ ; ln -s ${R}usr/obj/gnu/usr.bin/man/whatis obj
cd ${R}usr/src/gnu/usr.bin/patch/ ; ln -s ${R}usr/obj/gnu/usr.bin/patch obj
cd ${R}usr/src/gnu/usr.bin/pr/ ; ln -s ${R}usr/obj/gnu/usr.bin/pr obj
cd ${R}usr/src/gnu/usr.bin/ptx/ ; ln -s ${R}usr/obj/gnu/usr.bin/ptx obj
cd ${R}usr/src/gnu/usr.bin/rcs/ci/ ; ln -s ${R}usr/obj/gnu/usr.bin/rcs/ci obj
cd ${R}usr/src/gnu/usr.bin/rcs/co/ ; ln -s ${R}usr/obj/gnu/usr.bin/rcs/co obj
cd ${R}usr/src/gnu/usr.bin/rcs/ident/ ; ln -s ${R}usr/obj/gnu/usr.bin/rcs/ident obj
cd ${R}usr/src/gnu/usr.bin/rcs/lib/ ; ln -s ${R}usr/obj/gnu/usr.bin/rcs/lib obj
cd ${R}usr/src/gnu/usr.bin/rcs/merge/ ; ln -s ${R}usr/obj/gnu/usr.bin/rcs/merge obj
cd ${R}usr/src/gnu/usr.bin/rcs/rcs/ ; ln -s ${R}usr/obj/gnu/usr.bin/rcs/rcs obj
cd ${R}usr/src/gnu/usr.bin/rcs/rcsclean/ ; ln -s ${R}usr/obj/gnu/usr.bin/rcs/rcsclean obj
cd ${R}usr/src/gnu/usr.bin/rcs/rcsdiff/ ; ln -s ${R}usr/obj/gnu/usr.bin/rcs/rcsdiff obj
cd ${R}usr/src/gnu/usr.bin/rcs/rcsfreeze/ ; ln -s ${R}usr/obj/gnu/usr.bin/rcs/rcsfreeze obj
cd ${R}usr/src/gnu/usr.bin/rcs/rcsmerge/ ; ln -s ${R}usr/obj/gnu/usr.bin/rcs/rcsmerge obj
cd ${R}usr/src/gnu/usr.bin/rcs/rlog/ ; ln -s ${R}usr/obj/gnu/usr.bin/rcs/rlog obj
cd ${R}usr/src/gnu/usr.bin/sdiff/ ; ln -s ${R}usr/obj/gnu/usr.bin/sdiff obj
cd ${R}usr/src/gnu/usr.bin/sort/ ; ln -s ${R}usr/obj/gnu/usr.bin/sort obj
cd ${R}usr/src/gnu/usr.bin/tar/ ; ln -s ${R}usr/obj/gnu/usr.bin/tar obj


echo "Making links in include"
cd ${R}usr/src/include/rpcsvc/; ln -s  ${R}usr/obj/include/rpcsvc obj


echo "Making links in lib"
cd ${R}usr/src/lib/csu.i386/; ln -s  ${R}usr/obj/lib/csu.i386 obj
cd ${R}usr/src/lib/libc/; ln -s  ${R}usr/obj/lib/libc obj
cd ${R}usr/src/lib/libcurses/; ln -s  ${R}usr/obj/lib/libcurses obj
cd ${R}usr/src/lib/libf2c/; ln -s  ${R}usr/obj/lib/libf2c obj
cd ${R}usr/src/lib/libm/; ln -s  ${R}usr/obj/lib/libm obj
cd ${R}usr/src/lib/libmalloc/; ln -s  ${R}usr/obj/lib/libmalloc obj
cd ${R}usr/src/lib/libpthread/; ln -s  ${R}usr/obj/lib/libpthread obj
cd ${R}usr/src/lib/libresolv/; ln -s  ${R}usr/obj/lib/libresolv obj
cd ${R}usr/src/lib/librpcsvc/; ln -s  ${R}usr/obj/lib/librpcsvc obj
cd ${R}usr/src/lib/libskey/; ln -s  ${R}usr/obj/lib/libskey obj
cd ${R}usr/src/lib/libtelnet/; ln -s  ${R}usr/obj/lib/libtelnet obj
cd ${R}usr/src/lib/libterm/; ln -s  ${R}usr/obj/lib/libterm obj
cd ${R}usr/src/lib/libutil/; ln -s  ${R}usr/obj/lib/libutil obj
cd ${R}usr/src/lib/liby/; ln -s  ${R}usr/obj/lib/liby obj


echo "Making links in sbin"
cd ${R}usr/src/sbin/adjkerntz/; ln -s  ${R}usr/obj/sbin/adjkerntz obj
cd ${R}usr/src/sbin/badsect/; ln -s  ${R}usr/obj/sbin/badsect obj
cd ${R}usr/src/sbin/chkconfig/; ln -s  ${R}usr/obj/sbin/chkconfig obj
cd ${R}usr/src/sbin/clri/; ln -s  ${R}usr/obj/sbin/clri obj
cd ${R}usr/src/sbin/comcontrol/; ln -s  ${R}usr/obj/sbin/comcontrol obj
cd ${R}usr/src/sbin/disklabel/; ln -s  ${R}usr/obj/sbin/disklabel obj
cd ${R}usr/src/sbin/dmesg/; ln -s  ${R}usr/obj/sbin/dmesg obj
cd ${R}usr/src/sbin/dump/; ln -s  ${R}usr/obj/sbin/dump obj
cd ${R}usr/src/sbin/dumpfs/; ln -s  ${R}usr/obj/sbin/dumpfs obj
cd ${R}usr/src/sbin/fastboot/; ln -s  ${R}usr/obj/sbin/fastboot obj
cd ${R}usr/src/sbin/fdisk/; ln -s  ${R}usr/obj/sbin/fdisk obj
cd ${R}usr/src/sbin/fsck/; ln -s  ${R}usr/obj/sbin/fsck obj
cd ${R}usr/src/sbin/ft/; ln -s  ${R}usr/obj/sbin/ft obj
cd ${R}usr/src/sbin/halt/; ln -s  ${R}usr/obj/sbin/halt obj
cd ${R}usr/src/sbin/ifconfig/; ln -s  ${R}usr/obj/sbin/ifconfig obj
cd ${R}usr/src/sbin/init.bsdi/; ln -s  ${R}usr/obj/sbin/init.bsdi obj
cd ${R}usr/src/sbin/md5/; ln -s  ${R}usr/obj/sbin/md5 obj
cd ${R}usr/src/sbin/mknod/; ln -s  ${R}usr/obj/sbin/mknod obj
cd ${R}usr/src/sbin/mount/; ln -s  ${R}usr/obj/sbin/mount obj
cd ${R}usr/src/sbin/mount_isofs/; ln -s  ${R}usr/obj/sbin/mount_isofs obj
cd ${R}usr/src/sbin/mount_pcfs/; ln -s  ${R}usr/obj/sbin/mount_pcfs obj
cd ${R}usr/src/sbin/mount_procfs/; ln -s  ${R}usr/obj/sbin/mount_procfs obj
cd ${R}usr/src/sbin/mountd/; ln -s  ${R}usr/obj/sbin/mountd obj
cd ${R}usr/src/sbin/newfs/; ln -s  ${R}usr/obj/sbin/newfs obj
cd ${R}usr/src/sbin/nfsd/; ln -s  ${R}usr/obj/sbin/nfsd obj
cd ${R}usr/src/sbin/nfsiod/; ln -s  ${R}usr/obj/sbin/nfsiod obj
cd ${R}usr/src/sbin/ping/; ln -s  ${R}usr/obj/sbin/ping obj
cd ${R}usr/src/sbin/quotacheck/; ln -s  ${R}usr/obj/sbin/quotacheck obj
cd ${R}usr/src/sbin/reboot/; ln -s  ${R}usr/obj/sbin/reboot obj
cd ${R}usr/src/sbin/restore/; ln -s  ${R}usr/obj/sbin/restore obj
cd ${R}usr/src/sbin/route/; ln -s  ${R}usr/obj/sbin/route obj
cd ${R}usr/src/sbin/savecore/; ln -s  ${R}usr/obj/sbin/savecore obj
cd ${R}usr/src/sbin/scsi/; ln -s  ${R}usr/obj/sbin/scsi obj
cd ${R}usr/src/sbin/shutdown/; ln -s  ${R}usr/obj/sbin/shutdown obj
cd ${R}usr/src/sbin/slattach/; ln -s  ${R}usr/obj/sbin/slattach obj
cd ${R}usr/src/sbin/st/; ln -s  ${R}usr/obj/sbin/st obj
cd ${R}usr/src/sbin/swapon/; ln -s  ${R}usr/obj/sbin/swapon obj
cd ${R}usr/src/sbin/tunefs/; ln -s  ${R}usr/obj/sbin/tunefs obj
cd ${R}usr/src/sbin/umount/; ln -s  ${R}usr/obj/sbin/umount obj

echo "Uudecoding in share"
cd ${R}usr/src/share/syscons/fonts
for i in altc-8x16 cp865-8x14 iso-8x16 koi8-8x8 alt-8x14 \
  cp850-8x14 cp865-8x16 iso-8x8 koi8c-8x16 alt-8x16 \
  cp850-8x16 cp865-8x8 koi8-8x14 alt-8x8 cp850-8x8 \
  iso-8x14 koi8-8x16 koi8b-8x16 altb-8x16; do
  uudecode $i.fnt;
done
echo "Making links in share"
cd ${R}usr/src/share/locale/; ln -s  ${R}usr/obj/share/locale obj
cd ${R}usr/src/share/man/man1/; ln -s  ${R}usr/obj/share/man/man1 obj
cd ${R}usr/src/share/man/man3/; ln -s  ${R}usr/obj/share/man/man3 obj
cd ${R}usr/src/share/man/man4/man4.i386/; ln -s  ${R}usr/obj/share/man/man4/man4.i386 obj
cd ${R}usr/src/share/man/man4/; ln -s  ${R}usr/obj/share/man/man4 obj
cd ${R}usr/src/share/man/man5/; ln -s  ${R}usr/obj/share/man/man5 obj
cd ${R}usr/src/share/man/man7/; ln -s  ${R}usr/obj/share/man/man7 obj
cd ${R}usr/src/share/man/man8/man8.i386/; ln -s  ${R}usr/obj/share/man/man8/man8.i386 obj
cd ${R}usr/src/share/man/man8/; ln -s  ${R}usr/obj/share/man/man8 obj
cd ${R}usr/src/share/me/; ln -s  ${R}usr/obj/share/me obj
cd ${R}usr/src/share/syscons/fonts/; ln -s  ${R}usr/obj/share/syscons/fonts obj
cd ${R}usr/src/share/syscons/keymaps/; ln -s  ${R}usr/obj/share/syscons/keymaps obj
cd ${R}usr/src/share/syscons/scrnmaps/; ln -s  ${R}usr/obj/share/syscons/scrnmaps obj
cd ${R}usr/src/share/termcap/; ln -s  ${R}usr/obj/share/termcap obj
cd ${R}usr/src/share/zoneinfo/; ln -s  ${R}usr/obj/share/zoneinfo obj


echo "Making links in usrbin"
cd ${R}usr/src/usr.bin/ar/ ; ln -s  ${R}usr/obj/usr.bin/ar obj
cd ${R}usr/src/usr.bin/at/ ; ln -s  ${R}usr/obj/usr.bin/at obj
cd ${R}usr/src/usr.bin/basename/ ; ln -s  ${R}usr/obj/usr.bin/basename obj
cd ${R}usr/src/usr.bin/bdes/ ; ln -s  ${R}usr/obj/usr.bin/bdes obj
cd ${R}usr/src/usr.bin/biff/ ; ln -s  ${R}usr/obj/usr.bin/biff obj
cd ${R}usr/src/usr.bin/cal/ ; ln -s  ${R}usr/obj/usr.bin/cal obj
cd ${R}usr/src/usr.bin/calendar/ ; ln -s  ${R}usr/obj/usr.bin/calendar obj
cd ${R}usr/src/usr.bin/cap_mkdb/ ; ln -s  ${R}usr/obj/usr.bin/cap_mkdb obj
cd ${R}usr/src/usr.bin/chat/ ; ln -s  ${R}usr/obj/usr.bin/chat obj
cd ${R}usr/src/usr.bin/checknr/ ; ln -s  ${R}usr/obj/usr.bin/checknr obj
cd ${R}usr/src/usr.bin/chpass/ ; ln -s  ${R}usr/obj/usr.bin/chpass obj
cd ${R}usr/src/usr.bin/cksum/ ; ln -s  ${R}usr/obj/usr.bin/cksum obj
cd ${R}usr/src/usr.bin/cmp/ ; ln -s  ${R}usr/obj/usr.bin/cmp obj
cd ${R}usr/src/usr.bin/col/ ; ln -s  ${R}usr/obj/usr.bin/col obj
cd ${R}usr/src/usr.bin/colcrt/ ; ln -s  ${R}usr/obj/usr.bin/colcrt obj
cd ${R}usr/src/usr.bin/colrm/ ; ln -s  ${R}usr/obj/usr.bin/colrm obj
cd ${R}usr/src/usr.bin/column/ ; ln -s  ${R}usr/obj/usr.bin/column obj
cd ${R}usr/src/usr.bin/comm/ ; ln -s  ${R}usr/obj/usr.bin/comm obj
cd ${R}usr/src/usr.bin/compress/ ; ln -s  ${R}usr/obj/usr.bin/compress obj
cd ${R}usr/src/usr.bin/crontab/ ; ln -s  ${R}usr/obj/usr.bin/crontab obj
cd ${R}usr/src/usr.bin/ctags/ ; ln -s  ${R}usr/obj/usr.bin/ctags obj
cd ${R}usr/src/usr.bin/cut/ ; ln -s  ${R}usr/obj/usr.bin/cut obj
cd ${R}usr/src/usr.bin/dirname/ ; ln -s  ${R}usr/obj/usr.bin/dirname obj
cd ${R}usr/src/usr.bin/du/ ; ln -s  ${R}usr/obj/usr.bin/du obj
cd ${R}usr/src/usr.bin/elvis/ ; ln -s  ${R}usr/obj/usr.bin/elvis obj
cd ${R}usr/src/usr.bin/elvisrecover/ ; ln -s  ${R}usr/obj/usr.bin/elvisrecover obj
cd ${R}usr/src/usr.bin/env/ ; ln -s  ${R}usr/obj/usr.bin/env obj
cd ${R}usr/src/usr.bin/error/ ; ln -s  ${R}usr/obj/usr.bin/error obj
cd ${R}usr/src/usr.bin/expand/ ; ln -s  ${R}usr/obj/usr.bin/expand obj
cd ${R}usr/src/usr.bin/f2c/ ; ln -s  ${R}usr/obj/usr.bin/f2c obj
cd ${R}usr/src/usr.bin/false/ ; ln -s  ${R}usr/obj/usr.bin/false obj
cd ${R}usr/src/usr.bin/file/ ; ln -s  ${R}usr/obj/usr.bin/file obj
cd ${R}usr/src/usr.bin/find/ ; ln -s  ${R}usr/obj/usr.bin/find obj
cd ${R}usr/src/usr.bin/finger/ ; ln -s  ${R}usr/obj/usr.bin/finger obj
cd ${R}usr/src/usr.bin/fmt/ ; ln -s  ${R}usr/obj/usr.bin/fmt obj
cd ${R}usr/src/usr.bin/fold/ ; ln -s  ${R}usr/obj/usr.bin/fold obj
cd ${R}usr/src/usr.bin/fpr/ ; ln -s  ${R}usr/obj/usr.bin/fpr obj
cd ${R}usr/src/usr.bin/from/ ; ln -s  ${R}usr/obj/usr.bin/from obj
cd ${R}usr/src/usr.bin/fsplit/ ; ln -s  ${R}usr/obj/usr.bin/fsplit obj
cd ${R}usr/src/usr.bin/fstat/ ; ln -s  ${R}usr/obj/usr.bin/fstat obj
cd ${R}usr/src/usr.bin/ftp/ ; ln -s  ${R}usr/obj/usr.bin/ftp obj
cd ${R}usr/src/usr.bin/getopt/ ; ln -s  ${R}usr/obj/usr.bin/getopt obj
cd ${R}usr/src/usr.bin/gprof/ ; ln -s  ${R}usr/obj/usr.bin/gprof obj
cd ${R}usr/src/usr.bin/groups/ ; ln -s  ${R}usr/obj/usr.bin/groups obj
cd ${R}usr/src/usr.bin/head/ ; ln -s  ${R}usr/obj/usr.bin/head obj
cd ${R}usr/src/usr.bin/hexdump/ ; ln -s  ${R}usr/obj/usr.bin/hexdump obj
cd ${R}usr/src/usr.bin/id/ ; ln -s  ${R}usr/obj/usr.bin/id obj
cd ${R}usr/src/usr.bin/indent/ ; ln -s  ${R}usr/obj/usr.bin/indent obj
cd ${R}usr/src/usr.bin/ipcrm/ ; ln -s  ${R}usr/obj/usr.bin/ipcrm obj
cd ${R}usr/src/usr.bin/ipcs/ ; ln -s  ${R}usr/obj/usr.bin/ipcs obj
cd ${R}usr/src/usr.bin/join/ ; ln -s  ${R}usr/obj/usr.bin/join obj
cd ${R}usr/src/usr.bin/key/ ; ln -s  ${R}usr/obj/usr.bin/key obj
cd ${R}usr/src/usr.bin/keyinfo/ ; ln -s  ${R}usr/obj/usr.bin/keyinfo obj
cd ${R}usr/src/usr.bin/keyinit/ ; ln -s  ${R}usr/obj/usr.bin/keyinit obj
cd ${R}usr/src/usr.bin/ktrace/kdump/ ; ln -s  ${R}usr/obj/usr.bin/ktrace/kdump obj
cd ${R}usr/src/usr.bin/ktrace/ktrace/ ; ln -s  ${R}usr/obj/usr.bin/ktrace/ktrace obj
cd ${R}usr/src/usr.bin/last/ ; ln -s  ${R}usr/obj/usr.bin/last obj
cd ${R}usr/src/usr.bin/lastcomm/ ; ln -s  ${R}usr/obj/usr.bin/lastcomm obj
cd ${R}usr/src/usr.bin/leave/ ; ln -s  ${R}usr/obj/usr.bin/leave obj
cd ${R}usr/src/usr.bin/lex/lib/ ; ln -s  ${R}usr/obj/usr.bin/lex/lib obj
cd ${R}usr/src/usr.bin/lex/ ; ln -s  ${R}usr/obj/usr.bin/lex obj
cd ${R}usr/src/usr.bin/locate/bigram/ ; ln -s  ${R}usr/obj/usr.bin/locate/bigram obj
cd ${R}usr/src/usr.bin/locate/code/ ; ln -s  ${R}usr/obj/usr.bin/locate/code obj
cd ${R}usr/src/usr.bin/locate/locate/ ; ln -s  ${R}usr/obj/usr.bin/locate/locate obj
cd ${R}usr/src/usr.bin/lock/ ; ln -s  ${R}usr/obj/usr.bin/lock obj
cd ${R}usr/src/usr.bin/logger/ ; ln -s  ${R}usr/obj/usr.bin/logger obj
cd ${R}usr/src/usr.bin/login/ ; ln -s  ${R}usr/obj/usr.bin/login obj
cd ${R}usr/src/usr.bin/logname/ ; ln -s  ${R}usr/obj/usr.bin/logname obj
cd ${R}usr/src/usr.bin/look/ ; ln -s  ${R}usr/obj/usr.bin/look obj
cd ${R}usr/src/usr.bin/lorder/ ; ln -s  ${R}usr/obj/usr.bin/lorder obj
cd ${R}usr/src/usr.bin/m4/ ; ln -s  ${R}usr/obj/usr.bin/m4 obj
cd ${R}usr/src/usr.bin/machine/ ; ln -s  ${R}usr/obj/usr.bin/machine obj
cd ${R}usr/src/usr.bin/mail/ ; ln -s  ${R}usr/obj/usr.bin/mail obj
cd ${R}usr/src/usr.bin/make/ ; ln -s  ${R}usr/obj/usr.bin/make obj
cd ${R}usr/src/usr.bin/mesg/ ; ln -s  ${R}usr/obj/usr.bin/mesg obj
cd ${R}usr/src/usr.bin/mkdep/ ; ln -s  ${R}usr/obj/usr.bin/mkdep obj
cd ${R}usr/src/usr.bin/mkfifo/ ; ln -s  ${R}usr/obj/usr.bin/mkfifo obj
cd ${R}usr/src/usr.bin/mkstr/ ; ln -s  ${R}usr/obj/usr.bin/mkstr obj
cd ${R}usr/src/usr.bin/more/ ; ln -s  ${R}usr/obj/usr.bin/more obj
cd ${R}usr/src/usr.bin/msgs/ ; ln -s  ${R}usr/obj/usr.bin/msgs obj
cd ${R}usr/src/usr.bin/mt/ ; ln -s  ${R}usr/obj/usr.bin/mt obj
cd ${R}usr/src/usr.bin/netstat/ ; ln -s  ${R}usr/obj/usr.bin/netstat obj
cd ${R}usr/src/usr.bin/nfsstat/ ; ln -s  ${R}usr/obj/usr.bin/nfsstat obj
cd ${R}usr/src/usr.bin/nice/ ; ln -s  ${R}usr/obj/usr.bin/nice obj
cd ${R}usr/src/usr.bin/nm/ ; ln -s  ${R}usr/obj/usr.bin/nm obj
cd ${R}usr/src/usr.bin/nohup/ ; ln -s  ${R}usr/obj/usr.bin/nohup obj
cd ${R}usr/src/usr.bin/pagesize/ ; ln -s  ${R}usr/obj/usr.bin/pagesize obj
cd ${R}usr/src/usr.bin/passwd/ ; ln -s  ${R}usr/obj/usr.bin/passwd obj
cd ${R}usr/src/usr.bin/paste/ ; ln -s  ${R}usr/obj/usr.bin/paste obj
cd ${R}usr/src/usr.bin/printenv/ ; ln -s  ${R}usr/obj/usr.bin/printenv obj
cd ${R}usr/src/usr.bin/printf/ ; ln -s  ${R}usr/obj/usr.bin/printf obj
cd ${R}usr/src/usr.bin/quota/ ; ln -s  ${R}usr/obj/usr.bin/quota obj
cd ${R}usr/src/usr.bin/ranlib/ ; ln -s  ${R}usr/obj/usr.bin/ranlib obj
cd ${R}usr/src/usr.bin/rdist/ ; ln -s  ${R}usr/obj/usr.bin/rdist obj
cd ${R}usr/src/usr.bin/ref/ ; ln -s  ${R}usr/obj/usr.bin/ref obj
cd ${R}usr/src/usr.bin/renice/ ; ln -s  ${R}usr/obj/usr.bin/renice obj
cd ${R}usr/src/usr.bin/rev/ ; ln -s  ${R}usr/obj/usr.bin/rev obj
cd ${R}usr/src/usr.bin/rsh/ ; ln -s  ${R}usr/obj/usr.bin/rsh obj
cd ${R}usr/src/usr.bin/rlogin/ ; ln -s  ${R}usr/obj/usr.bin/rlogin obj
cd ${R}usr/src/usr.bin/rpcgen/ ; ln -s  ${R}usr/obj/usr.bin/rpcgen obj
cd ${R}usr/src/usr.bin/rpcinfo/ ; ln -s  ${R}usr/obj/usr.bin/rpcinfo obj
cd ${R}usr/src/usr.bin/rup/ ; ln -s  ${R}usr/obj/usr.bin/rup obj
cd ${R}usr/src/usr.bin/ruptime/ ; ln -s  ${R}usr/obj/usr.bin/ruptime obj
cd ${R}usr/src/usr.bin/rusers/ ; ln -s  ${R}usr/obj/usr.bin/rusers obj
cd ${R}usr/src/usr.bin/rwall/ ; ln -s  ${R}usr/obj/usr.bin/rwall obj
cd ${R}usr/src/usr.bin/rwho/ ; ln -s  ${R}usr/obj/usr.bin/rwho obj
cd ${R}usr/src/usr.bin/script/ ; ln -s  ${R}usr/obj/usr.bin/script obj
cd ${R}usr/src/usr.bin/sed/ ; ln -s  ${R}usr/obj/usr.bin/sed obj
cd ${R}usr/src/usr.bin/shar/ ; ln -s  ${R}usr/obj/usr.bin/shar obj
cd ${R}usr/src/usr.bin/showmount/ ; ln -s  ${R}usr/obj/usr.bin/showmount obj
cd ${R}usr/src/usr.bin/size/ ; ln -s  ${R}usr/obj/usr.bin/size obj
cd ${R}usr/src/usr.bin/soelim/ ; ln -s  ${R}usr/obj/usr.bin/soelim obj
cd ${R}usr/src/usr.bin/split/ ; ln -s  ${R}usr/obj/usr.bin/split obj
cd ${R}usr/src/usr.bin/strings/ ; ln -s  ${R}usr/obj/usr.bin/strings obj
cd ${R}usr/src/usr.bin/strip/ ; ln -s  ${R}usr/obj/usr.bin/strip obj
cd ${R}usr/src/usr.bin/su/ ; ln -s  ${R}usr/obj/usr.bin/su obj
cd ${R}usr/src/usr.bin/symorder/ ; ln -s  ${R}usr/obj/usr.bin/symorder obj
cd ${R}usr/src/usr.bin/tail/ ; ln -s  ${R}usr/obj/usr.bin/tail obj
cd ${R}usr/src/usr.bin/talk/ ; ln -s  ${R}usr/obj/usr.bin/talk obj
cd ${R}usr/src/usr.bin/tcopy/ ; ln -s  ${R}usr/obj/usr.bin/tcopy obj
cd ${R}usr/src/usr.bin/tee/ ; ln -s  ${R}usr/obj/usr.bin/tee obj
cd ${R}usr/src/usr.bin/telnet/ ; ln -s  ${R}usr/obj/usr.bin/telnet obj
cd ${R}usr/src/usr.bin/tftp/ ; ln -s  ${R}usr/obj/usr.bin/tftp obj
cd ${R}usr/src/usr.bin/time/ ; ln -s  ${R}usr/obj/usr.bin/time obj
cd ${R}usr/src/usr.bin/tip/ ; ln -s  ${R}usr/obj/usr.bin/tip obj
cd ${R}usr/src/usr.bin/tn3270/mset/ ; ln -s  ${R}usr/obj/usr.bin/tn3270/mset obj
cd ${R}usr/src/usr.bin/tn3270/tn3270/ ; ln -s  ${R}usr/obj/usr.bin/tn3270/tn3270 obj
cd ${R}usr/src/usr.bin/tn3270/tools/mkastods/ ; ln -s  ${R}usr/obj/usr.bin/tn3270/tools/mkastods obj
cd ${R}usr/src/usr.bin/tn3270/tools/mkastosc/ ; ln -s  ${R}usr/obj/usr.bin/tn3270/tools/mkastosc obj
cd ${R}usr/src/usr.bin/tn3270/tools/mkdctype/ ; ln -s  ${R}usr/obj/usr.bin/tn3270/tools/mkdctype obj
cd ${R}usr/src/usr.bin/tn3270/tools/mkdstoas/ ; ln -s  ${R}usr/obj/usr.bin/tn3270/tools/mkdstoas obj
cd ${R}usr/src/usr.bin/tn3270/tools/mkhits/ ; ln -s  ${R}usr/obj/usr.bin/tn3270/tools/mkhits obj
cd ${R}usr/src/usr.bin/touch/ ; ln -s  ${R}usr/obj/usr.bin/touch obj
cd ${R}usr/src/usr.bin/tput/ ; ln -s  ${R}usr/obj/usr.bin/tput obj
cd ${R}usr/src/usr.bin/tr/ ; ln -s  ${R}usr/obj/usr.bin/tr obj
cd ${R}usr/src/usr.bin/true/ ; ln -s  ${R}usr/obj/usr.bin/true obj
cd ${R}usr/src/usr.bin/tset/ ; ln -s  ${R}usr/obj/usr.bin/tset obj
cd ${R}usr/src/usr.bin/tsort/ ; ln -s  ${R}usr/obj/usr.bin/tsort obj
cd ${R}usr/src/usr.bin/tty/ ; ln -s  ${R}usr/obj/usr.bin/tty obj
cd ${R}usr/src/usr.bin/ul/ ; ln -s  ${R}usr/obj/usr.bin/ul obj
cd ${R}usr/src/usr.bin/uname/ ; ln -s  ${R}usr/obj/usr.bin/uname obj
cd ${R}usr/src/usr.bin/unexpand/ ; ln -s  ${R}usr/obj/usr.bin/unexpand obj
cd ${R}usr/src/usr.bin/unifdef/ ; ln -s  ${R}usr/obj/usr.bin/unifdef obj
cd ${R}usr/src/usr.bin/uniq/ ; ln -s  ${R}usr/obj/usr.bin/uniq obj
cd ${R}usr/src/usr.bin/unvis/ ; ln -s  ${R}usr/obj/usr.bin/unvis obj
cd ${R}usr/src/usr.bin/users/ ; ln -s  ${R}usr/obj/usr.bin/users obj
cd ${R}usr/src/usr.bin/uudecode/ ; ln -s  ${R}usr/obj/usr.bin/uudecode obj
cd ${R}usr/src/usr.bin/uuencode/ ; ln -s  ${R}usr/obj/usr.bin/uuencode obj
cd ${R}usr/src/usr.bin/vacation/ ; ln -s  ${R}usr/obj/usr.bin/vacation obj
cd ${R}usr/src/usr.bin/vgrind/ ; ln -s  ${R}usr/obj/usr.bin/vgrind obj
cd ${R}usr/src/usr.bin/vi/ ; ln -s  ${R}usr/obj/usr.bin/vi obj
cd ${R}usr/src/usr.bin/vis/ ; ln -s  ${R}usr/obj/usr.bin/vis obj
cd ${R}usr/src/usr.bin/vmstat/ ; ln -s  ${R}usr/obj/usr.bin/vmstat obj
cd ${R}usr/src/usr.bin/w/ ; ln -s  ${R}usr/obj/usr.bin/w obj
cd ${R}usr/src/usr.bin/wall/ ; ln -s  ${R}usr/obj/usr.bin/wall obj
cd ${R}usr/src/usr.bin/wc/ ; ln -s  ${R}usr/obj/usr.bin/wc obj
cd ${R}usr/src/usr.bin/what/ ; ln -s  ${R}usr/obj/usr.bin/what obj
cd ${R}usr/src/usr.bin/whereis/ ; ln -s  ${R}usr/obj/usr.bin/whereis obj
cd ${R}usr/src/usr.bin/which/ ; ln -s  ${R}usr/obj/usr.bin/which obj
cd ${R}usr/src/usr.bin/who/ ; ln -s  ${R}usr/obj/usr.bin/who obj
cd ${R}usr/src/usr.bin/whoami/ ; ln -s  ${R}usr/obj/usr.bin/whoami obj
cd ${R}usr/src/usr.bin/whois/ ; ln -s  ${R}usr/obj/usr.bin/whois obj
cd ${R}usr/src/usr.bin/window/ ; ln -s  ${R}usr/obj/usr.bin/window obj
cd ${R}usr/src/usr.bin/write/ ; ln -s  ${R}usr/obj/usr.bin/write obj
cd ${R}usr/src/usr.bin/xargs/ ; ln -s  ${R}usr/obj/usr.bin/xargs obj
cd ${R}usr/src/usr.bin/xinstall/ ; ln -s  ${R}usr/obj/usr.bin/xinstall obj
cd ${R}usr/src/usr.bin/xstr/ ; ln -s  ${R}usr/obj/usr.bin/xstr obj
cd ${R}usr/src/usr.bin/yacc/ ; ln -s  ${R}usr/obj/usr.bin/yacc obj
cd ${R}usr/src/usr.bin/yes/ ; ln -s  ${R}usr/obj/usr.bin/yes obj

echo "Making links in usrsbin"
cd ${R}usr/src/usr.sbin/XNSrouted/; ln -s  ${R}usr/obj/usr.sbin/XNSrouted obj
cd ${R}usr/src/usr.sbin/ac/; ln -s  ${R}usr/obj/usr.sbin/ac obj
cd ${R}usr/src/usr.sbin/accton/; ln -s  ${R}usr/obj/usr.sbin/accton obj
cd ${R}usr/src/usr.sbin/arp/; ln -s  ${R}usr/obj/usr.sbin/arp obj
cd ${R}usr/src/usr.sbin/bad144/; ln -s  ${R}usr/obj/usr.sbin/bad144 obj
cd ${R}usr/src/usr.sbin/chown/; ln -s  ${R}usr/obj/usr.sbin/chown obj
cd ${R}usr/src/usr.sbin/chroot/; ln -s  ${R}usr/obj/usr.sbin/chroot obj
cd ${R}usr/src/usr.sbin/config/; ln -s  ${R}usr/obj/usr.sbin/config obj
cd ${R}usr/src/usr.sbin/cron/; ln -s  ${R}usr/obj/usr.sbin/cron obj
cd ${R}usr/src/usr.sbin/dbsym/; ln -s  ${R}usr/obj/usr.sbin/dbsym obj
cd ${R}usr/src/usr.sbin/dev_mkdb/; ln -s  ${R}usr/obj/usr.sbin/dev_mkdb obj
cd ${R}usr/src/usr.sbin/diskpart/; ln -s  ${R}usr/obj/usr.sbin/diskpart obj
cd ${R}usr/src/usr.sbin/edquota/; ln -s  ${R}usr/obj/usr.sbin/edquota obj
cd ${R}usr/src/usr.sbin/fdcontrol/; ln -s  ${R}usr/obj/usr.sbin/fdcontrol obj
cd ${R}usr/src/usr.sbin/fdformat/; ln -s  ${R}usr/obj/usr.sbin/fdformat obj
cd ${R}usr/src/usr.sbin/ftinfo/; ln -s  ${R}usr/obj/usr.sbin/ftinfo obj
cd ${R}usr/src/usr.sbin/gettable/; ln -s  ${R}usr/obj/usr.sbin/gettable obj
cd ${R}usr/src/usr.sbin/htable/; ln -s  ${R}usr/obj/usr.sbin/htable obj
cd ${R}usr/src/usr.sbin/inetd/; ln -s  ${R}usr/obj/usr.sbin/inetd obj
cd ${R}usr/src/usr.sbin/iostat/; ln -s  ${R}usr/obj/usr.sbin/iostat obj
cd ${R}usr/src/usr.sbin/kbdcontrol/; ln -s  ${R}usr/obj/usr.sbin/kbdcontrol obj
cd ${R}usr/src/usr.sbin/kgmon/; ln -s  ${R}usr/obj/usr.sbin/kgmon obj
cd ${R}usr/src/usr.sbin/kvm_mkdb/; ln -s  ${R}usr/obj/usr.sbin/kvm_mkdb obj
cd ${R}usr/src/usr.sbin/lpr/filters/; ln -s  ${R}usr/obj/usr.sbin/lpr/filters obj
cd ${R}usr/src/usr.sbin/lpr/lpc/; ln -s  ${R}usr/obj/usr.sbin/lpr/lpc obj
cd ${R}usr/src/usr.sbin/lpr/lpd/; ln -s  ${R}usr/obj/usr.sbin/lpr/lpd obj
cd ${R}usr/src/usr.sbin/lpr/lpq/; ln -s  ${R}usr/obj/usr.sbin/lpr/lpq obj
cd ${R}usr/src/usr.sbin/lpr/lpr/; ln -s  ${R}usr/obj/usr.sbin/lpr/lpr obj
cd ${R}usr/src/usr.sbin/lpr/lprm/; ln -s  ${R}usr/obj/usr.sbin/lpr/lprm obj
cd ${R}usr/src/usr.sbin/lpr/lptest/; ln -s  ${R}usr/obj/usr.sbin/lpr/lptest obj
cd ${R}usr/src/usr.sbin/lpr/pac/; ln -s  ${R}usr/obj/usr.sbin/lpr/pac obj
cd ${R}usr/src/usr.sbin/mrouted/; ln -s  ${R}usr/obj/usr.sbin/mrouted obj
cd ${R}usr/src/usr.sbin/lptcontrol/; ln -s  ${R}usr/obj/usr.sbin/lptcontrol obj
cd ${R}usr/src/usr.sbin/mtree/; ln -s  ${R}usr/obj/usr.sbin/mtree obj
cd ${R}usr/src/usr.sbin/named/; ln -s  ${R}usr/obj/usr.sbin/named obj
cd ${R}usr/src/usr.sbin/named/tools/nslookup/; ln -s  ${R}usr/obj/usr.sbin/named/tools/nslookup obj
cd ${R}usr/src/usr.sbin/named/tools/nsquery/; ln -s  ${R}usr/obj/usr.sbin/named/tools/nsquery obj
cd ${R}usr/src/usr.sbin/named/tools/nstest/; ln -s  ${R}usr/obj/usr.sbin/named/tools/nstest obj
cd ${R}usr/src/usr.sbin/named/xfer/; ln -s  ${R}usr/obj/usr.sbin/named/xfer obj
cd ${R}usr/src/usr.sbin/portmap/; ln -s  ${R}usr/obj/usr.sbin/portmap obj
cd ${R}usr/src/usr.sbin/pppstats/; ln -s  ${R}usr/obj/usr.sbin/pppstats obj
cd ${R}usr/src/usr.sbin/pwd_mkdb/; ln -s  ${R}usr/obj/usr.sbin/pwd_mkdb obj
cd ${R}usr/src/usr.sbin/quotaon/; ln -s  ${R}usr/obj/usr.sbin/quotaon obj
cd ${R}usr/src/usr.sbin/repquota/; ln -s  ${R}usr/obj/usr.sbin/repquota obj
cd ${R}usr/src/usr.sbin/rmt/; ln -s  ${R}usr/obj/usr.sbin/rmt obj
cd ${R}usr/src/usr.sbin/routed/query/; ln -s  ${R}usr/obj/usr.sbin/routed/query obj
cd ${R}usr/src/usr.sbin/routed/trace/; ln -s  ${R}usr/obj/usr.sbin/routed/trace obj
cd ${R}usr/src/usr.sbin/routed/; ln -s  ${R}usr/obj/usr.sbin/routed obj
cd ${R}usr/src/usr.sbin/rwhod/; ln -s  ${R}usr/obj/usr.sbin/rwhod obj
cd ${R}usr/src/usr.sbin/sa/; ln -s  ${R}usr/obj/usr.sbin/sa obj
cd ${R}usr/src/usr.sbin/sendmail/mailstats/; ln -s  ${R}usr/obj/usr.sbin/sendmail/mailstats obj
cd ${R}usr/src/usr.sbin/sendmail/makemap/; ln -s  ${R}usr/obj/usr.sbin/sendmail/makemap obj
cd ${R}usr/src/usr.sbin/sendmail/praliases/; ln -s  ${R}usr/obj/usr.sbin/sendmail/praliases obj
cd ${R}usr/src/usr.sbin/sendmail/src/; ln -s  ${R}usr/obj/usr.sbin/sendmail/src obj
cd ${R}usr/src/usr.sbin/sliplogin/; ln -s  ${R}usr/obj/usr.sbin/sliplogin obj
cd ${R}usr/src/usr.sbin/slstat/; ln -s  ${R}usr/obj/usr.sbin/slstat obj
cd ${R}usr/src/usr.sbin/swapinfo/; ln -s  ${R}usr/obj/usr.sbin/swapinfo obj
cd ${R}usr/src/usr.sbin/syslogd/; ln -s  ${R}usr/obj/usr.sbin/syslogd obj
cd ${R}usr/src/usr.sbin/timed/timed/; ln -s  ${R}usr/obj/usr.sbin/timed/timed obj
cd ${R}usr/src/usr.sbin/timed/timedc/; ln -s  ${R}usr/obj/usr.sbin/timed/timedc obj
cd ${R}usr/src/usr.sbin/traceroute/; ln -s  ${R}usr/obj/usr.sbin/traceroute obj
cd ${R}usr/src/usr.sbin/trpt/; ln -s  ${R}usr/obj/usr.sbin/trpt obj
cd ${R}usr/src/usr.sbin/trsp/; ln -s  ${R}usr/obj/usr.sbin/trsp obj
cd ${R}usr/src/usr.sbin/vidcontrol/; ln -s  ${R}usr/obj/usr.sbin/vidcontrol obj
cd ${R}usr/src/usr.sbin/vipw/; ln -s  ${R}usr/obj/usr.sbin/vipw obj
cd ${R}usr/src/usr.sbin/xten/; ln -s  ${R}usr/obj/usr.sbin/xten obj
cd ${R}usr/src/usr.sbin/yp/ypbind/; ln -s  ${R}usr/obj/usr.sbin/yp/ypbind obj
cd ${R}usr/src/usr.sbin/yp/ypcat/; ln -s  ${R}usr/obj/usr.sbin/yp/ypcat obj
cd ${R}usr/src/usr.sbin/yp/ypmatch/; ln -s  ${R}usr/obj/usr.sbin/yp/ypmatch obj
cd ${R}usr/src/usr.sbin/yp/yppoll/; ln -s  ${R}usr/obj/usr.sbin/yp/yppoll obj
cd ${R}usr/src/usr.sbin/yp/ypset/; ln -s  ${R}usr/obj/usr.sbin/yp/ypset obj
cd ${R}usr/src/usr.sbin/yp/ypwhich/; ln -s  ${R}usr/obj/usr.sbin/yp/ypwhich obj
cd ${R}usr/src/usr.sbin/yp/; ln -s  ${R}usr/obj/usr.sbin/yp obj


echo
echo "Upgrade completed! if you want to remove .orig files, then type "
echo "   find ${R}usr/src -name \*.orig -exec rm {} \;"
  
exit 0
