# Copyright (c) 1995 by the Student Information Processing Board
# 	  of the Massachusetts Institute of Technology
#  
# Permission to use, copy, modify, and distribute this software
# and its documentation for any purpose and without fee is
# hereby granted, provided that the above copyright notice
# appear in all copies and that both that copyright notice and
# this permission notice appear in supporting documentation,
# and that the names of M.I.T. and the M.I.T. S.I.P.B. not be
# used in advertising or publicity pertaining to distribution
# of the software without specific, written prior permission.
# M.I.T. and the M.I.T. S.I.P.B. make no representations about
# the suitability of this software for any purpose.  It is
# provided "as is" without express or implied warranty.
#
#	$Id: unpack.sh,v 1.3 1996/01/21 19:10:05 ghudson Exp ghudson $
#	$Source: /mit/netbsd/dev/install/server/RCS/unpack.sh,v $

# /tmp/vars inputs:
#	kernel		whether this system is adp or other
#	athenarev	Athena version number
#	installdir	installation directory for FTPing tarfiles

. /tmp/vars
. /utils

echo ""
echo "Starting extraction.  This will take about 10 minutes from a dorm"
echo "machine, and at least 90 minutes from an ILG on the frame relay."

cd /mnt
ftp -n $distsite << EOM
user anonymous netbsdinstaller@
cd $installdir
bin
get base.tar.gz "|/extract base"
get comp.tar.gz "|/extract comp"
get etc.tar.gz "|/extract etc"
get games.tar.gz "|/extract games"
get man.tar.gz "|/extract man"
get misc.tar.gz "|/extract misc"
get secr.tar.gz "|/extract secr"
get text.tar.gz "|/extract text"
EOM

echo ""
echo -n "Copying kernel... "
cp /usr/distrib/generic-$kernel /mnt/netbsd
echo "done."

echo -n "Making device nodes... "
chroot /mnt sh -c 'cd /dev; sh MAKEDEV all'
echo "done."

sync

