head	1.58;
access;
symbols
	RELEASE_2_0:1.50
	BETA_2_0:1.50
	ALPHA_2_0:1.22;
locks; strict;
comment	@# @;


1.58
date	95.12.30.18.50.17;	author peter;	state dead;
branches;
next	1.57;

1.57
date	95.12.07.10.32.56;	author peter;	state dead;
branches;
next	1.56;

1.56
date	95.01.12.16.18.16;	author jkh;	state Exp;
branches;
next	1.55;

1.55
date	94.12.29.20.09.59;	author jkh;	state Exp;
branches;
next	1.54;

1.54
date	94.12.17.06.57.44;	author jkh;	state Exp;
branches;
next	1.53;

1.53
date	94.12.02.15.52.54;	author jkh;	state Exp;
branches;
next	1.52;

1.52
date	94.11.30.11.58.28;	author jkh;	state Exp;
branches;
next	1.51;

1.51
date	94.11.28.22.13.03;	author jkh;	state Exp;
branches;
next	1.50;

1.50
date	94.11.21.09.50.02;	author jkh;	state Exp;
branches;
next	1.49;

1.49
date	94.11.21.08.33.55;	author jkh;	state Exp;
branches;
next	1.48;

1.48
date	94.11.21.02.17.06;	author jkh;	state Exp;
branches;
next	1.47;

1.47
date	94.11.20.14.49.46;	author jkh;	state Exp;
branches;
next	1.46;

1.46
date	94.11.18.16.27.51;	author jkh;	state Exp;
branches;
next	1.45;

1.45
date	94.11.18.13.59.49;	author jkh;	state Exp;
branches;
next	1.44;

1.44
date	94.11.18.13.58.25;	author jkh;	state Exp;
branches;
next	1.43;

1.43
date	94.11.18.12.54.37;	author jkh;	state Exp;
branches;
next	1.42;

1.42
date	94.11.18.11.01.22;	author jkh;	state Exp;
branches;
next	1.41;

1.41
date	94.11.18.10.05.29;	author jkh;	state Exp;
branches;
next	1.40;

1.40
date	94.11.17.11.53.11;	author jkh;	state Exp;
branches;
next	1.39;

1.39
date	94.11.16.07.51.41;	author jkh;	state Exp;
branches;
next	1.38;

1.38
date	94.11.15.13.40.00;	author jkh;	state Exp;
branches;
next	1.37;

1.37
date	94.11.13.07.27.35;	author jkh;	state Exp;
branches;
next	1.36;

1.36
date	94.11.13.06.32.40;	author jkh;	state Exp;
branches;
next	1.35;

1.35
date	94.11.13.03.48.55;	author jkh;	state Exp;
branches;
next	1.34;

1.34
date	94.11.13.01.20.37;	author jkh;	state Exp;
branches;
next	1.33;

1.33
date	94.11.12.06.22.25;	author jkh;	state Exp;
branches;
next	1.32;

1.32
date	94.11.12.06.12.27;	author jkh;	state Exp;
branches;
next	1.31;

1.31
date	94.11.12.05.04.21;	author jkh;	state Exp;
branches;
next	1.30;

1.30
date	94.11.11.23.29.26;	author jkh;	state Exp;
branches;
next	1.29;

1.29
date	94.11.11.10.55.02;	author jkh;	state Exp;
branches;
next	1.28;

1.28
date	94.11.11.08.34.03;	author jkh;	state Exp;
branches;
next	1.27;

1.27
date	94.11.11.08.33.03;	author jkh;	state Exp;
branches;
next	1.26;

1.26
date	94.11.11.07.33.50;	author jkh;	state Exp;
branches;
next	1.25;

1.25
date	94.11.10.23.43.25;	author jkh;	state Exp;
branches;
next	1.24;

1.24
date	94.11.10.05.27.57;	author jkh;	state Exp;
branches;
next	1.23;

1.23
date	94.11.09.23.02.11;	author jkh;	state Exp;
branches;
next	1.22;

1.22
date	94.11.09.20.16.09;	author jkh;	state Exp;
branches;
next	1.21;

1.21
date	94.11.09.02.49.04;	author jkh;	state Exp;
branches;
next	1.20;

1.20
date	94.11.09.00.10.04;	author jkh;	state Exp;
branches;
next	1.19;

1.19
date	94.11.09.00.05.42;	author jkh;	state Exp;
branches;
next	1.18;

1.18
date	94.11.08.23.59.04;	author jkh;	state Exp;
branches;
next	1.17;

1.17
date	94.11.08.19.51.48;	author jkh;	state Exp;
branches;
next	1.16;

1.16
date	94.11.08.18.36.46;	author jkh;	state Exp;
branches;
next	1.15;

1.15
date	94.11.08.13.58.34;	author jkh;	state Exp;
branches;
next	1.14;

1.14
date	94.11.08.13.28.06;	author jkh;	state Exp;
branches;
next	1.13;

1.13
date	94.11.08.13.20.15;	author jkh;	state Exp;
branches;
next	1.12;

1.12
date	94.11.08.13.08.18;	author jkh;	state Exp;
branches;
next	1.11;

1.11
date	94.11.08.12.45.04;	author jkh;	state Exp;
branches;
next	1.10;

1.10
date	94.11.08.12.34.57;	author jkh;	state Exp;
branches;
next	1.9;

1.9
date	94.11.08.11.14.44;	author jkh;	state Exp;
branches;
next	1.8;

1.8
date	94.11.08.07.48.05;	author jkh;	state Exp;
branches;
next	1.7;

1.7
date	94.11.08.07.45.15;	author jkh;	state Exp;
branches;
next	1.6;

1.6
date	94.11.08.07.24.51;	author jkh;	state Exp;
branches;
next	1.5;

1.5
date	94.11.08.03.48.58;	author jkh;	state Exp;
branches;
next	1.4;

1.4
date	94.11.07.13.43.26;	author jkh;	state Exp;
branches;
next	1.3;

1.3
date	94.11.07.11.30.15;	author jkh;	state Exp;
branches;
next	1.2;

1.2
date	94.11.07.06.23.07;	author jkh;	state Exp;
branches;
next	1.1;

1.1
date	94.11.06.04.07.41;	author jkh;	state Exp;
branches;
next	;


desc
@@


1.58
log
@recording cvs-1.6 file death
@
text
@#!/stand/sh
#
# bininst - perform the last stage of installation by somehow getting
# a bindist onto the user's disk and unpacking it.  The name bininst
# is actually something of a misnomer, since this utility will install
# more than just the bindist set.
#
# Written:  November 11th, 1994
# Copyright (C) 1994 by Jordan K. Hubbard
#
# Permission to copy or use this software for any purpose is granted
# provided that this message stay intact, and at this location (e.g. no
# putting your name on top after doing something trivial like reindenting
# it, just to make it look like you wrote it!).
#
# $Id: bininst,v 1.57 1995/12/07 10:32:56 peter dead peter $

if [ "${_BININST_LOADED_}" = "yes" ]; then
	error "Error, $0 loaded more than once!"
	return 1
else
	_BININST_LOADED_=yes
fi

# Grab the miscellaneous functions.
. /stand/miscfuncs.sh

# Grab the installation routines
. /stand/instdist.sh

# Grab the network setup routines
. /stand/netinst.sh

# Deal with trigger-happy users.
trap interrupt 1 2 15

# set initial defaults
set_defaults()
{
	network_set_defaults
	media_set_defaults
	INSTALLING="yes"
	mkdir -p ${TMP}
	cp /stand/etc/* /etc
}

# Print welcome banner.
welcome()
{
	dialog --title "Welcome to FreeBSD!" --msgbox \
"Installation may now proceed from tape, CDROM, a network (NFS or ftp
over ethernet, SLIP or parallel port) or DOS (existing hard disk
partition or floppies).  If you're installing over a network, make
sure your cables are plugged in and ready to go.  If you're installing
from tape, CDROM or floppies, now would be a good time to remember
where you put the distribution media! :-)  Please remove the cpio
floppy from the drive and press return." -1 -1
}

do_last_config()
{
	DONE=""
	while [ "${DONE}" = "" ]; do
	dialog --title "Final Configuration!" --menu \
"We now come to the end of the installation.  If there's a\n\
floppy in the boot drive, now would probably be a good time\n\
to remove it as the system will reboot when you exit the shell\n\
at the end of this stage.\n\n\
Please select one of the following options:" -1 -1 5 \
"tzsetup" "Configure your time zone" \
"network" "Configure networking" \
"user" "Add a user name for yourself to the system" \
"guest" "Simply add a user \"guest\" with all default options" \
"done" "Exit the installation." 2> ${TMP}/menu.tmp.$$
	RETVAL=$?
	CHOICE=`cat ${TMP}/menu.tmp.$$`
	rm -f ${TMP}/menu.tmp.$$
	if ! handle_rval ${RETVAL}; then exit 0; fi

	case ${CHOICE} in
	tzsetup)
		dialog --clear
		sh /stand/tzsetup
		dialog --clear
	;;

	network)
		network_setup
	;;

	user)
		sh /stand/adduser.sh -i
	;;

	guest)
		sh /stand/adduser.sh
	;;

	done)
		DONE="yes"
	;;
	esac
	done

	dialog --title "Auf Wiedersehen!" --msgbox \
"Don't forget that the login name \"root\" has no password.
If you didn't create any users with adduser, you can at least log in
as this user.  Also be aware that root is the _superuser_, which means
that you can easily wipe out your system if you're not careful!

There are many useful pre-compiled packages for ${DISTNAME}
available which you may also wish to investigate.  Look in:

        ftp://ftp.freebsd.org/pub/FreeBSD/${DISTNAME}/packages

Any install-related comments to jkh@@freebsd.org, phk@@freebsd.org or
paul@@freebsd.org.

We sincerely hope you enjoy FreeBSD 2.0!

		The FreeBSD Project Team" -1 -1
}

welcome
set_defaults

while [ "${INSTALLING}" = "yes" ]; do
	if media_select_distribution; then
		if media_chose; then
			for xx in ${MEDIA_DISTRIBUTIONS}; do
				MEDIA_DISTRIBUTION=`eval echo \`echo $xx\``
				media_install_set
			done
		fi
	else
		do_last_config
		INSTALLING="no"
	fi
done
echo; echo "Spawning shell.  Exit shell to continue with new bindist."
echo "Progress <installation completed>" > /dev/ttyv1
/stand/sh
exit 20
@


1.57
log
@Update the -current sources from the 2.1 branch.

Approved (in spirit) by: jkh
@
text
@d16 1
a16 1
# $Id: bininst,v 1.56 1995/01/12 16:18:16 jkh Exp peter $
@


1.56
log
@A slicker way of eliminating bogus quotes.
Ask less questions about the temporary directory if instructed to.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.55 1994/12/29 20:09:59 jkh Exp $
@


1.55
log
@Nuke out gratutious newlines.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.54 1994/12/17 06:57:44 jkh Exp $
d131 1
a131 1
				MEDIA_DISTRIBUTION=`echo $xx | sed -e 's/"//g'`
@


1.54
log
@First cut at making multiple distributions loadable in a single pass.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.53 1994/12/02 15:52:54 jkh Exp $
d130 2
a131 1
			for MEDIA_DISTRIBUTION in ${MEDIA_DISTRIBUTIONS}; do
@


1.53
log
@Josh Littlefield's fixes for my extreme boneheadedness.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.52 1994/11/30 11:58:28 jkh Exp $
d130 3
a132 1
			media_install_set
@


1.52
log
@Merge in more creature-confort changes, plus some spelling and general
badness fixes from Keith.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.51 1994/11/28 22:13:03 jkh Exp $
d71 1
a71 1
"network" "Configure networking"
@


1.51
log
@First shot at fixing all the various bugs reported so far in the
installation.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.50 1994/11/21 09:50:02 jkh Exp $
d19 1
a19 1
	echo "Error, $0 loaded more than once!"
@


1.50
log
@Allow users to specify both a timezone AND add users.  Whoops!
We're all pretty nuked at this point..
@
text
@d16 1
a16 1
# $Id: bininst,v 1.49 1994/11/21 08:33:55 jkh Exp $
d18 1
a18 1
if [ "$_BININST_LOADED_" = "yes" ]; then
a24 5
# Set some useful variables
HOME=/; export HOME
TMP=/tmp


d42 1
a42 1
	installing="yes"
d50 1
a50 2
	dialog --title "Welcome to FreeBSD!" $clear \
	--msgbox \
d56 2
a57 2
where you put the distribution media! :-)  If you're set and ready
to go, please remove the cpio floppy from the drive and press return!" -1 -1
d62 2
a63 4
	if [ "$hostname" = "" ]; then network_basic_setup; fi

	done=""
	while [ "$done" = "" ]; do
d69 1
a69 1
Please select one of the following options:" -1 -1 4 \
d71 1
d75 2
a76 2
	retval=$?
	choice=`cat ${TMP}/menu.tmp.$$`
d78 1
a78 1
	if ! handle_rval $retval; then exit 0; fi
d80 1
a80 1
	case $choice in
d87 4
d100 1
a100 1
		done="yes"
d127 1
a127 1
while [ "$installing" = "yes" ]; do
d134 1
a134 1
		installing="no"
@


1.49
log
@Make sure new machines always have a host name.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.48 1994/11/21 02:17:06 jkh Exp $
d70 2
a94 1
		dialog --clear
a98 1
		dialog --clear
d102 3
d106 1
@


1.48
log
@Invoke tzsetup properly, since we have no /bin/sh at this stage.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.47 1994/11/20 14:49:46 jkh Exp $
d45 1
d68 2
@


1.47
log
@o	Add Michael Reifenberger's mini-adduser script.
o	Optionally invoke tzsetup or adduser from the last stage.
o	Add tzsetup and friends to cpio floppy.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.46 1994/11/18 16:27:51 jkh Exp $
d85 1
a85 1
		tzsetup
@


1.46
log
@Grrrr!  Dialog menus just bail out without saying anything when the
menu items aren't unique enough.  After half an hour of head-scratching,
here are the disgusting convolutions required to work around the problem.
Sigh..
@
text
@d16 1
a16 1
# $Id: bininst,v 1.45 1994/11/18 13:59:49 jkh Exp $
d67 39
a105 11
	dialog --title "Auf Wiedersehen!" \
--msgbox "We now come to the end of the installation.  Please remove
any floppies from the drive before exiting this dialog.  At this point in
time, there's nothing fancy here, but for the release we plan to
ask some additional questions about time zone setup, what sort of
mail client this host is, etc.  We just ran out of time for ALPHA!
At the very least, you may wish to check out the 'tzsetup' command;
it will at least handle the first checklist item for you. \n
The login name \"root\" has no password.  If you're new to UN*X, log
in as root when prompted for a user name and run vipw to add a new
user for yourself.
d107 2
a108 2
There are also many useful pre-compiled packages for ${DISTNAME}
available which you may wish to investigate.  Look in:
d110 1
a110 1
	ftp://ftp.freebsd.org/pub/FreeBSD/${DISTNAME}/packages
d113 5
a117 1
paul@@freebsd.org." -1 -1
@


1.45
log
@Tell user to remove floppy from the drive before rebooting, too.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.44 1994/11/18 13:58:25 jkh Exp $
d56 7
a62 8
"We're now ready to install one or more packed distribution sets onto
your machine.  Installation may be done from tape, CDROM, a network
(NFS or ftp over ethernet, SLIP or parallel port) or DOS (existing
hard disk partition or floppies).  If you're installing over a network,
make sure your cables are plugged in and ready to go.  If you're
installing from tape, CD or floppies, now would be a good time to
remember where you put the distribution media! :-)  If you're set and
ready to go, please remove the cpio floppy from the drive and press return!" -1 -1
@


1.44
log
@Tell silly users to remove the cpio floppy from the drive now.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.43 1994/11/18 12:54:37 jkh Exp $
d69 2
a70 1
--msgbox "We now come to the end of the installation.  At this point in
@


1.43
log
@1. Unify my coding style.
2. Fix a couple of errors that kept media_install_set from working.
3. Fix another error that disabled media_select_distribution
@
text
@d16 1
a16 1
# $Id: bininst,v 1.42 1994/11/18 11:01:22 jkh Exp $
d63 1
a63 1
ready to go, please press return!" -1 -1
@


1.42
log
@1. Use dynamic sizing code throughout.
2. Add support for *dist menu to have an up-to-date idea of how big each
   distribution is going to be.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.41 1994/11/18 10:05:29 jkh Exp $
d43 2
a44 1
set_defaults() {
d46 1
a46 1
	installing=1
d52 2
a53 1
welcome() {
d91 1
a91 1
while [ $installing -eq 1 ]; do
d94 1
a94 1
			install_set
d98 1
a98 1
		installing=0
@


1.41
log
@1. Use cpio instead of tar again.  Bruce's comments made me paranoid.
2. Invoke sub-scripts using absolute paths.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.40 1994/11/17 11:53:11 jkh Exp $
d44 1
a44 1
	set_media_defaults
d54 8
a61 8
"We're now ready to install one or more packed distribution
sets onto your machine.  Installation may be done from tape,
CD, network (NFS or ftp over ethernet, SLIP or parallel port),
a DOS partition or DOS floppies.  If you're installing over
the network, make sure your cables are plugged in and ready to
go.  If you're installing from tape, CD or floppies, now would
be a good time to remember where you put the distribution
media! :-)  If you're set up and ready to go, please press return!" 16 72
@


1.40
log
@Eliminate the use of cpio in extraction.  The stupid thing whines too much,
and it doesn't support --unlink.  I think it's time to nuke cpio completely
out of the installation process, unless someone can think of a really good
reason to keep it (and don't say multiple volume extraction since we a) don't
use it anywhere anyway, and b) tar supports that too, now).
@
text
@d16 1
a16 1
# $Id: bininst,v 1.39 1994/11/16 07:51:41 jkh Exp $
d31 1
a31 1
. miscfuncs.sh
d34 1
a34 1
. instdist.sh
d37 1
a37 1
. netinst.sh
@


1.39
log
@1. Split these scripts into smaller distinct functional units that will
   be callable _after_ installation in 2.1's system admin tools.  This is
   almost totally revamped now.

2. Support installation from DOS partition or floppy.

3. Many stray bogons eliminated.  Perhaps a few introduced.  One more
   rev should fix this up, once I've spammed my test machine a couple of
   times.

4. Installation from CD now *really* possible.

5. Allow user to specify arbitary subdirectories for NFS mountpoints -
   UFS, NFS and CD distributions now share many common elements.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.38 1994/11/15 13:40:00 jkh Exp $
d83 1
a83 1
paul@@freebsd.org." 22 72
@


1.38
log
@Change CD devices to the correct ones.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.37 1994/11/13 07:27:35 jkh Exp $
d18 6
a23 6
# Some useful constants.
PATH=/usr/bin:/usr/sbin:/bin:/sbin:/stand
export PATH

TAR=tar
TAR_FLAGS=xvf
d25 2
a28 4
IFCONFIG=ifconfig

ROUTE=route
ROUTE_FLAGS="add default"
d30 2
a31 2
HOME=/
export HOME
d33 2
d36 2
a37 6
interrupt() {
	if dialog --clear --title "User Interrupt Requested" \
	  --yesno "Do you wish to abort the installation?" 5 70; then
		exit 0;
	fi
}
d42 1
a42 1
# Set the initial state of the system.
d44 1
a44 16
	media_type=""
	media_device=""
	clear="--clear"
	ipaddr=""
	hostname=""
	ether_intr=""
	domain=""
	netmask="0xffffff00"
	ifconfig_flags=""
	remote_hostip=""
	tmp_dir="/usr/tmp"
	ftp_path="ftp://ftp.freebsd.org/pub/FreeBSD/2.0-ALPHA/bindist"
	nfs_path=""
	cdrom_path=""
	serial_interface="/dev/tty00"
	serial_speed="38400"
a49 56
# Handle the return value from a dialog, doing some pre-processing
# so that each client doesn't have to.
handle_rval() {
	case $1 in
	0)
		return 0
	;;
	255)
		PS1="subshell# " /stand/sh
	;;
	*)
		return 1
	;;
	esac
}

# A simple user-confirmation dialog.
confirm() {
	dialog --title "User Confirmation" --msgbox "$*" 8 72
}

# A simple message box dialog.
message() {
	dialog --title "Progress" --infobox "$*" 5 72
}

# A simple error dialog.
error() {
	dialog --title "Error!" --msgbox "$*" 10 72
}

# Something isn't supported yet! :-(
not_supported() {
	dialog --title "Sorry!" \
	--msgbox "This feature is not supported in the current version of the \
installation tools.  Barring some sort of fatal accident, we do \
expect it to be in the release.  Please press RETURN to go on." 10 60
}

# Get a string from the user
input()
{
	dialog --title "$title" $clear \
	--inputbox "$*" 17 72 "$default_value" 2> ${TMP}/inputbox.tmp.$$
	if ! handle_rval $?; then rm -f ${TMP}/inputbox.tmp.$$; return 1; fi
	answer=`cat ${TMP}/inputbox.tmp.$$`
	rm -f ${TMP}/inputbox.tmp.$$
}

# Ask a networking question
network_dialog()
{
	title="Network Configuration"
	if ! input "$*"; then return 1; fi
}

d53 9
a61 434
--msgbox " We're now ready to install one or more packed distribution
sets onto your machine.  At the minimum, you need a bindist
distribution, though a secrdist is also useful if you want your
system to use the same DES and/or Kerberos security model used
by other commercial systems (though the md5 based FreeBSD model
is not bad in and of itself).  The secrdist is also a bit of a
special case since it cannot be legally obtained via U.S. ftp
sites from outside the U.S. due to export restrictions, but
non-U.S. versions are also available.  See the release notes for
more information on obtaining a secrdist for your part of the
world.  If you wish to run a 1.x binary (and can't simply recompile
it from source), it's also recommended that you install the
compat1xdist.  If you're interested in doing FreeBSD development,
a srcdist is also very highly recommended!  Finally, many useful
pre-compiled packages are available and may be obtained from:

	ftp://ftp.freebsd.org/pub/FreeBSD/2.0-ALPHA/packages" 22 72
	if ! handle_rval $?; then return 1; fi
}

# Get values into $media_type and $media_device.  Call network initialization
# if necessary.
choose_media() {
	while [ "$media_device" = "" ]; do

	dialog $clear --title "Installation From" \
--menu "Before installing a distribution, you need to chose \n\
and/or configure your method of installation.  Please pick from \n\
one of the following options.  If none of the listed options works \n\
for you then your best bet may be to simply hit ESC twice to get \n\
a subshell and proceed manually on your own.  If you are already \n\
finished with installation, select cancel to go on.\n\n\
	Please choose one of the following:" 20 72 7 \
	"?Kern" "Please show me the kernel boot messages again!" \
	"Tape" "Load distribution from SCSI, QIC or floppy tape" \
	"CDROM" "Load distribution from SCSI or Mitsumi CDROM" \
        "DOS" "Load from DOS floppies or a DOS hard disk partition" \
        "FTP" "Load distribution using FTP" \
        "UFS" "Load the distribution from existing UFS partition" \
        "NFS" "Load the distribution over NFS" 2> ${TMP}/menu.tmp.$$
	retval=$?
	choice=`cat ${TMP}/menu.tmp.$$`
	rm -f ${TMP}/menu.tmp.$$
	if ! handle_rval $retval; then return 1; fi

	case $choice in
	?Kern)
		if dmesg > ${TMP}/dmesg.out; then
			dialog $clear \
			--title "What do I have in this machine again?" \
			--textbox ${TMP}/dmesg.out 22 76
		else
			error "Couldn't get dmesg information! :-("
		fi
	;;

	Tape)
		dialog $clear --title "Chose Tape Type" \
--menu "Which type of tape drive do you have attached to your \n\
system?  FreeBSD supports the following types:\n\n\
		Choose one of the following:" 20 72 3 \
		"SCSI" "SCSI tape drive attached to supported SCSI controller" \
		"QIC" "QIC tape drive (Colorado Jumbo, etc)" \
		"floppy" "Floppy tape drive" \
			2> ${TMP}/menu.tmp.$$
		retval=$?
		choice=`cat ${TMP}/menu.tmp.$$`
		rm -f ${TMP}/menu.tmp.$$
		if ! handle_rval $retval; then continue; fi
		media_type=tape;
		case $choice in
			SCSI)
				media_device=/dev/rst0
			;;
			QIC)
				media_device=/dev/rwt0
			;;
			floppy)
				media_device=ftape
			;;
		esac
	;;

	CDROM)
		dialog $clear --title "Chose CDROM Type" \
--menu "Which type of CDROM drive do you have attached to your \n\
system?  FreeBSD supports the following types:\n\n\
		Choose one of the following:" 15 72 2 \
		"SCSI" "SCSI CDROM drive attached to supported SCSI controller" \
		"Mitsumi" "Mitsumi CDROM drive" \
			2> ${TMP}/menu.tmp.$$
		retval=$?
		choice=`cat ${TMP}/menu.tmp.$$`
		rm -f ${TMP}/menu.tmp.$$
		if ! handle_rval $retval; then continue; fi
		media_type=cdrom;
		case $choice in
			SCSI)
				media_device=/dev/cd0a
			;;
			Mitsumi)
				media_device=/dev/mcd0a
			;;
		esac
	;;

	DOS)
		not_supported
	;;

	FTP)
		if ! setup_network; then continue; fi
		title="FTP Installation Information"
		default_value="$ftp_path"
		if ! input \
"Please specify the machine and directory location of the
distribution you wish to load.  This should be either a \"URL style\"
specification (e.g. ftp://ftp.freeBSD.org/pub/FreeBSD/...) or simply
the name of a host to connect to.  If only a host name is specified,
the installation assumes that you will properly connect and \"mget\"
the files yourself.\n\n"; then continue; fi
		media_type=ftp
		media_device=$answer
		ftp_path=$media_device
	;;

	NFS)
		if ! setup_network; then continue; fi
		title="NFS Installation Information"
		default_value="$nfs_path"
		if ! input \
"Please specify the machine and directory location of the
distribution you wish to load.  This must be in machine:dir
format (e.g. zooey:/a/FreeBSD/bindist).  The remote directory
must be be exported to your machine (or globally) for this to
work!\n\n"; then continue; fi
		media_type=nfs
		nfs_path=$answer
		if ! mount_nfs $nfs_path /mnt > /dev/ttyv1 2>&1; then
			error "Unable to mount $nfs_path"
		else
			media_device=$nfs_path
			message "$nfs_path mounted successfully"
		fi
	;;

	UFS)
		dialog $clear --title "User Intervention Requested" --msgbox "
Please mount the filesystem you wish to use somewhere convenient and
exit the shell when you're through.  I'll ask you for the location
of the distribution when we come back." 12 72
		dialog --clear
		/stand/sh
		title="Please enter directory"
		default_value="/mnt/bindist"
		if input "Ok, now give me the full pathname of the directory where you've got the distribution."; then
			if [ ! -f $answer/extract.sh ]; then
				error "That's not a valid distribution"
			else
				media_type=ufs
				media_device=$answer
			fi
		fi
	;;
	esac
	done
}

# Set the location of our temporary unpacking directory.
set_tmpdir()
{
	title="Chose temporary directory"
	default_value="/usr/tmp"
	if ! input \
"Please specify the name of a directory containing enough free
space to hold the temporary files for this distribution.  At
minimum, a binary distribution will require around 21MB of
temporary space.  At maximum, a srcdist may take 40MB or more.
If the directory you specify does not exist, it will be created
for you.  If you do not have enough free space to hold both the
packed and unpacked distribution files, consider using the NFS
or CDROM installation methods as they require no temporary
storage.\n\n"; then return 1; fi
	tmp_dir=$answer
	mkdir -p $tmp_dir
	return 0
}

cd_tmpdir()
{
	if ! cd $tmp_dir; then
		error "No such file or directory for ${tmp_dir}, sorry!  Please fix this and try again."
		return 1
	fi
}

rm_tmpdir()
{
	if dialog --title "Delete contents?" $clear \
        --yesno "Do you wish to delete the contents of ${tmp_dir}?" 5 72; then
		rm -rf $tmp_dir/*
	fi
}

setup_network_ether()
{
	dialog $clear --title "Ethernet Interface Name" \
	--menu "Please select the type of ethernet interface you have:\n\n" \
	 20 76 6 \
	"ed0" "WD80x3, SMC, Novell NE[21]000 or 3C503 generic NIC at 0x280/5" \
	"ed1" "Same as above, but at address 0x300 and IRQ 5" \
	"de0" "DEC PCI ethernet adapter (or compatible)" \
	"ie0" "AT&T StarLan and EN100 family at 0x360 and IRQ 7" \
	"is0" "Isolan 4141-0 or Isolink 4110 at 0x280 and IRQ 7" \
	"ze0" "PCMCIA IBM or National card at 0x300 and IRQ 5" \
	  2> ${TMP}/menu.tmp.$$

	retval=$?
	interface=`cat ${TMP}/menu.tmp.$$`
	rm -f ${TMP}/menu.tmp.$$
	if ! handle_rval $retval; then return 1; fi
}

setup_network_slip()
{
	clear=""
	default_value=""
	if ! network_dialog "What is the IP number for the remote host?"; then return 1; fi
	remote_hostip=$answer
	interface=sl0

	default_value=$serial_interface
	if ! network_dialog "What is the name of the serial interface?"; then return 1; fi
	serial_interface=$answer

	default_value=$serial_speed
	if ! network_dialog "What speed is the serial interface?"; then return 1; fi
	serial_speed=$answer
	clear="--clear"

	if dialog $clear --title "Dial" --yesno "Do you need to dial the phone or otherwise talk to the modem?"; then
		mkdir -p /var/log
		touch -f /var/log/aculog	> /dev/null 2>&1
		chmod 666 /var/log/aculog	> /dev/null 2>&1
		confirm "You may now dialog with your modem and set up the slip connection.\nBe sure to disable DTR sensitivity (usually with AT&D0) or the modem may\nhang up when you exit 'cu'.  Use ~. to exit cu and continue."
		dialog --clear
		cu -l $serial_interface -s $serial_speed
		dialog --clear
	fi
}

setup_network_plip()
{
	default_value=""
	if ! network_dialog "What is the IP number for the remote host?"; then return 1; fi
	remote_hostip=$answer
	interface=lp0
}

setup_network()
{
	done=0
	while [ "$interface" = "" ]; do
		clear="--clear"
		dialog $clear --title "Set up network interface" \
		--menu "Please select the type of network connection you have:\n\n" \
		15 72 3 \
		"ether" "A supported ethernet card" \
		"SLIP" "A point-to-point SLIP (Serial Line IP) connection" \
		"PLIP" "A Parallel-Line IP setup (sort of like lap-link)" \
		2> ${TMP}/menu.tmp.$$

		retval=$?
		choice=`cat ${TMP}/menu.tmp.$$`
		rm -f ${TMP}/menu.tmp.$$
		if ! handle_rval $retval; then return 1; fi
		case $choice in
		ether)
			if ! setup_network_ether; then continue; fi
		;;

		SLIP)
			if ! setup_network_slip; then continue; fi
		;;

		PLIP)
			if ! setup_network_plip; then continue; fi
		;;
		esac	
		if [ "$interface" = "" ]; then	continue; fi

		clear=""
		default_value=""
		if ! network_dialog "What is the fully qualified name of this host?"; then clear="--clear"; return 1; fi
		hostname=$answer
		echo $hostname > /etc/myname
		hostname $hostname

		default_value=`echo $hostname | sed -e 's/[^.]*\.//'`
		if network_dialog "What is the domain name of this host (Internet, not YP/NIS)?"; then
			domain=$answer
		fi

		default_value=""
		if ! network_dialog "What is the IP address of this host?"; then clear="--clear"; return 1; fi
		ipaddr=$answer

        	echo "$ipaddr    $hostname `echo $hostname | sed -e 's/\.$domain//'`" >> /etc/hosts

		default_value="$netmask"
		if network_dialog "Please specify the netmask"; then
			if [ "$answer" != "" ]; then
				netmask=$answer
			fi
		fi

		default_value=""
		if network_dialog "Any extra flags to ifconfig?" ; then
			ifconfig_flags=$answer
		fi
		echo "Progress <$IFCONFIG $interface $ipaddr $remote_hostip netmask $netmask $ifconfig_flags>" >/dev/ttyv1
		if ! $IFCONFIG $interface $ipaddr $remote_hostip netmask $netmask $ifconfig_flags > /dev/ttyv1 2>&1 ; then
			error "Unable to configure interface $interface"
			ipaddr=""; interface=""
			continue
		fi
		if [ "$interface" = "sl0" ]; then
			slattach -a -s $serial_speed $serial_interface
		fi
		echo "$ipaddr $remote_hostip netmask $netmask $ifconfig_flags" > /etc/hostname.$interface
		default_value=""
		if network_dialog "If you have a default gateway, enter its IP address"; then
			if [ "$answer" != "" ]; then
				gateway=$answer
				echo "Progress <$ROUTE $ROUTE_FLAGS $gateway>" > /dev/ttyv1 2>&1
				$ROUTE $ROUTE_FLAGS $gateway > /dev/ttyv1 2>&1
			fi
		fi

		default_value=""
		if network_dialog "If you have a name server, enter its IP address"; then
			if [ "$answer" != "" ]; then
				nameserver=$answer
				echo "domain $domain" > /etc/resolv.conf
				echo "nameserver $nameserver" >> /etc/resolv.conf
			fi
		fi
	done
}

extract_dist()
{
	if [ -f extract.sh ]; then
		message "Extracting distribution..  Please wait!"
		sh ./extract.sh < /dev/ttyv1 > /dev/ttyv1 2>&1
	else    
		error "Improper distribution.  No installation script found."  
	fi
}

install_set()
{
	case $media_type in
	tape)
		if ! set_tmpdir; then return; fi
		if ! cd_tmpdir; then return; fi
		confirm "Please mount tape for ${media_device}."
		if [ "$media_device" = "ftape" ]; then
			dialog --title "Results of tape extract" $clear \
			  --prgbox "ft | $TAR $TAR_FLAGS -" 10 72
		else
			dialog --title "Results of tape extract" $clear \
			  --prgbox "$TAR $TAR_FLAGS $media_device" 10 72
		fi
		extract_dist
		rm_tmpdir
	;;

	cdrom)
		if ! mount_cd9660 $media_device /mnt > /dev/ttyv1 2>&1; then
			error "Unable to mount $media_device on /mnt"
		else
			title="CDROM Information"
			default_value="$cdrom_path"
			if ! input "Directory on CD containing distribution"; then return; fi
			cdrom_path=$answer
			cd /mnt/$cdrom_path
			extract_dist
		fi
		return
	;;

	dos)
		if ! set_tmpdir; then return; fi
		if ! cd_tmpdir; then return; fi
		not_supported
		return
	;;
	ftp)
		if ! set_tmpdir; then return; fi
		if ! cd_tmpdir; then return; fi
		if ! echo $media_device | grep -v 'ftp://'; then
			message "Fetching distribution using ncftp.  Use ALT-F2 to see output, ALT-F1 to return."
			if ! ncftp $media_device/* < /dev/null > /dev/ttyv1 2>&1; then
				error "Couldn't fetch distribution from ${media_device}!"
			else
				extract_dist
			fi
		else
			dialog --clear
			ftp $media_device
			dialog --clear
			extract_dist
		fi
		rm_tmpdir
		return
	;;

	nfs)
		message "Extracting from NFS directory"
		cd /mnt
		extract_dist
		cd /
		umount /mnt > /dev/tty1 2>&1
		return
	;;

	ufs)
		message "Unpacking from prepared UFS directory"
		cd $media_device
		extract_dist
		cd /
	;;
	esac
d77 7
a83 1
Any install-related comments to jkh, phk or paul (@@freebsd.org)." 18 72
d90 4
a93 3
	if choose_media; then
		install_set
		media_device=""; media_type=""
@


1.37
log
@There were some bogons with redirection to /dev/ttyv1 lurking here.
Fix them.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.36 1994/11/13 06:32:40 jkh Exp $
d226 1
a226 1
				media_device=/dev/cd0d
d229 1
a229 1
				media_device=/dev/mcd0d
@


1.36
log
@Adjust the size of the input box.  It looks a bit funkier now,
but at least the code is smaller!
@
text
@d16 1
a16 1
# $Id: bininst,v 1.35 1994/11/13 03:48:55 jkh Exp $
d482 1
a482 1
		sh ./extract.sh > /dev/ttyv1 2>&1
@


1.35
log
@Support ufs installations.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.33 1994/11/12 06:22:25 jkh Exp $
d112 1
a112 1
	--inputbox "$*" 10 60 "$default_value" 2> ${TMP}/inputbox.tmp.$$
d301 4
a304 4
	if input \
"Please specify the name of a directory containing enough
free space to hold the temporary files for this distribution.
At minimum, a binary distribution will require around 21MB of
@


1.34
log
@Change the name of the TROUBLE-2.0 file to TROUBLESHOOTING; it just makes
more sense.
@
text
@d108 2
a109 1
network_dialog()
d111 1
a111 1
	dialog --title "Network Information" $clear \
d113 1
a113 1
	if ! handle_rval $?; then return 1; fi
d118 7
d178 1
a178 1
			--textbox ${TMP}/dmesg.out
d240 4
a243 2
		dialog --title "FTP Installation Information" $clear \
--inputbox "Please specify the machine and directory location of the
d248 1
a248 2
the files yourself.\n\n" \ 16 72 "$ftp_path" 2> ${TMP}/inputbox.tmp.$$
		if ! handle_rval $?; then continue; fi
d250 1
a250 1
		media_device=`cat ${TMP}/inputbox.tmp.$$`
a251 1
		rm -f ${TMP}/inputbox.tmp.$$
d256 4
a259 2
		dialog --title "NFS Installation Information" $clear \
--inputbox "Please specify the machine and directory location of the
d263 1
a263 2
work!\n\n" \ 14 72 "$nfs_path" 2> ${TMP}/inputbox.tmp.$$
		if ! handle_rval $?; then continue; fi
d265 1
a265 1
		nfs_path=`cat ${TMP}/inputbox.tmp.$$`
d275 17
a291 1
		dialog --title "User Intervention Requested"
d299 4
a302 2
	dialog --title "Chose temporary directory" $clear \
--inputbox "Please specify the name of a directory containing enough
d310 2
a311 4
storage.\n\n" \ 18 72 "/usr/tmp" 2> ${TMP}/inputbox.tmp.$$
	if ! handle_rval $?; then return 1; fi
	tmp_dir=`cat ${TMP}/inputbox.tmp.$$`
	rm -f ${TMP}/inputbox.tmp.$$
a456 1
		rm -f ${TMP}/inputbox.tmp.$$
d510 4
a513 6
			dialog --title "CDROM Information" $clear \
			--inputbox "Directory on CD containing distribution" \
			10 60 "$cdrom_path" 2> ${TMP}/inputbox.tmp.$$
			if ! handle_rval $?; then return; fi
			cdrom_path=`cat ${TMP}/inputbox.tmp.$$`
			rm -f ${TMP}/inputbox.tmp.$$
d553 7
@


1.33
log
@Drat!  For CDROM, we need to mount_cd9660 not just mount (slap!).
@
text
@d16 1
a16 1
# $Id: bininst,v 1.32 1994/11/12 06:12:27 jkh Exp $
d152 2
a153 1
	Please choose one of the following:" 20 72 5 \
d158 1
a159 1

d166 10
d202 1
d225 1
d229 1
d245 1
d264 3
@


1.32
log
@Remove ed2.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.31 1994/11/12 05:04:21 jkh Exp $
d465 1
a465 1
		if ! mount $media_device /mnt > /dev/ttyv1 2>&1; then
@


1.31
log
@I blew the redirects on the slip stuff.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.30 1994/11/11 23:29:26 jkh Exp $
d293 1
a293 1
	 20 76 7 \
a295 1
	"ed2" "Same as above, but at address 0x300 and IRQ 10" \
@


1.30
log
@ncftp can't interact with us.  Redirect its input from /dev/null.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.29 1994/11/11 10:55:02 jkh Exp $
d328 2
a329 2
		touch -f /var/log/aculog	>& /dev/null
		chmod 666 /var/log/aculog	>& /dev/null
@


1.29
log
@Try and make this just a little bit more self-explanatory.  Still
a LONG way to go..
@
text
@d16 1
a16 1
# $Id: bininst,v 1.28 1994/11/11 08:34:03 jkh Exp $
d492 1
a492 1
			if ! ncftp $media_device/* > /dev/ttyv1 2>&1; then
@


1.28
log
@Make sure /var/log exists so that cu doesn't complain.
@
text
@d12 3
a14 3
# provided that this message stay intact, and at this location (e.g. no putting
# your name on top after doing something trivial like reindenting it, just
# to make it look like you wrote it!).
d16 1
a16 1
# $Id: bininst,v 1.27 1994/11/11 08:33:03 jkh Exp $
d21 1
d24 1
d26 1
d28 1
d31 1
d35 1
d124 6
a129 6
by other commercial systems (the FreeBSD model is md5 based,
and not bad in and of itself though).  The secrdist is also a
bit of a special case since it cannot be legally obtained via
U.S. ftp sites from outside the U.S. due to export restrictions,
but non-U.S. versions are also available.  See the release notes
for more information on obtaining a secrdist for your part of the
d313 1
a313 1
	if ! network_dialog "What is the IP number for the remote host"; then return 1; fi
d318 1
a318 1
	if ! network_dialog "What is the name of the serial interface"; then return 1; fi
d322 1
a322 1
	if ! network_dialog "What speed is the serial interface"; then return 1; fi
d340 1
a340 1
	if ! network_dialog "What is the IP number for the remote host"; then return 1; fi
d379 1
a379 1
		if ! network_dialog "What is the fully qualified name of this host"; then clear="--clear"; return 1; fi
d385 1
a385 1
		if network_dialog "What is the domain name of this host (Internet, not YP/NIS)"; then
d390 1
a390 1
		if ! network_dialog "What is the IP address of this host"; then clear="--clear"; return 1; fi
d491 1
a491 1
			message "Fetching distribution using ncftp.  Use ALT-F2 to see output."
@


1.27
log
@Add cu (and cu slip dialog) so that poor SLIP users can dial their modems
before initiating a slip transfer.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.26 1994/11/11 07:33:50 jkh Exp $
d321 1
@


1.26
log
@Add de0 to list of ethernet drivers.  This list will be dynamic shortly..
Add an interrupt handler for trigger-happy users.
Add domain to resolv.conf
More general cleanup in preparation for this script being split into
several scripts.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.25 1994/11/10 23:43:25 jkh Exp $
d81 1
a81 1
	dialog --title "Please Confirm" --msgbox "$*" 6 72
d319 9
@


1.25
log
@Experimental floppy-tape suport.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.24 1994/11/10 05:27:57 jkh Exp $
d30 10
d287 1
a287 1
	 20 76 6 \
d291 1
d414 2
a415 1
				echo "nameserver $nameserver" > /etc/resolv.conf
@


1.24
log
@Enable support for Lucifer's floppies.
More stylistic drick-drack in bininst.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.23 1994/11/09 23:02:11 jkh Exp $
d137 1
a137 1
	"Tape" "Load distribution from SCSI or QIC tape" \
d153 1
a153 1
		Choose one of the following:" 20 72 2 \
d156 1
d170 3
d426 7
a432 2
		dialog --title "Results of tape extract" $clear \
			--prgbox "$TAR $TAR_FLAGS $media_device" 10 72
@


1.23
log
@[Changes are now for BETA]

This attempts to make the installion a little less grating by not
clearing the screen every time a like-sized dialog is going to splat
on top of another one.  If you don't want the screen to clear, set
clear="", otherwise leave it set to (or set it back to) "--clear".

It can't be set to "" all the time since then small dialogs appearing
on top of big dialogs look funky.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.22 1994/11/09 20:16:09 jkh Exp $
d103 1
a103 1
	dialog --title "Welcome to FreeBSD" $clear \
d110 11
a120 6
bit of a special case since it cannot be legally obtained from
the U.S. due to export restrictions, but non-U.S. versions are
also available.  See the release notes for more information on
obtaining a secrdist for your part of the world.  If you're
interested in doing FreeBSD development, a srcdist is also
highly recommended!" 18 72
a316 1
	clear="--clear"
d318 1
d321 1
a321 1
		20 72 3 \
d333 2
a334 2
		if ! setup_network_ether; then continue; fi
	;;
d336 21
a356 3
	SLIP)
		if ! setup_network_slip; then continue; fi
	;;
d358 12
a369 5
	PLIP)
		if ! setup_network_plip; then continue; fi
	;;
	esac	
	if [ "$interface" = "" ]; then	continue; fi
d371 12
a382 23
	clear=""
	default_value=""
	if ! network_dialog "What is the fully qualified name of this host"; then return 1; fi
	hostname=$answer
	echo $hostname > /etc/myname
	hostname $hostname

	default_value=`echo $hostname | sed -e 's/[^.]*\.//'`
	if network_dialog "What is the domain name of this host (Internet, not YP/NIS)"; then
		domain=$answer
	fi

	default_value=""
	if ! network_dialog "What is the IP address of this host"; then clear="--clear"; return 1; fi
	ipaddr=$answer

        echo "$ipaddr    $hostname `echo $hostname | sed -e s/\.$domain//`" \
             >> /etc/hosts

	default_value="$netmask"
	if network_dialog "Please specify the netmask"; then
		if [ "$answer" != "" ]; then
			netmask=$answer
d384 9
a392 23
	fi

	default_value=""
	if network_dialog "Any extra flags to ifconfig?" ; then
		ifconfig_flags=$answer
	fi
	echo "Progress <$IFCONFIG $interface $ipaddr $remote_hostip netmask $netmask $ifconfig_flags>" >/dev/ttyv1
	if ! $IFCONFIG $interface $ipaddr $remote_hostip netmask $netmask $ifconfig_flags > /dev/ttyv1 2>&1 ; then
		error "Unable to configure interface $interface"
		ipaddr=""; interface=""
		continue
	fi
	if [ "$interface" = "sl0" ]; then
		slattach -a -s $serial_speed $serial_interface
	fi
	rm -f ${TMP}/inputbox.tmp.$$
	echo "$ipaddr $remote_hostip netmask $netmask $ifconfig_flags" > /etc/hostname.$interface
	default_value=""
	if network_dialog "If you have a default gateway, enter its IP address (otherwise cancel)"; then
		if [ "$answer" != "" ]; then
			gateway=$answer
			echo "Progress <$ROUTE $ROUTE_FLAGS $gateway>" > /dev/ttyv1 2>&1
			$ROUTE $ROUTE_FLAGS $gateway > /dev/ttyv1 2>&1
a393 1
	fi
d395 6
a400 5
	default_value=""
	if network_dialog "If you have a name server, enter its IP address (otherwise cancel)"; then
		if [ "$answer" != "" ]; then
			nameserver=$answer
			echo "nameserver $nameserver" > /etc/resolv.conf
a401 1
	fi
a402 1
	clear="--clear"
@


1.22
log
@One last formatting change.  Done.
@
text
@d16 1
a16 1
# $Id: bininst,v 1.21 1994/11/09 02:49:04 jkh Exp $
d32 17
a48 16
	media_type="" ;
	media_device="" ;
	ipaddr="" ;
	hostname="" ;
	ether_intr="" ;
	domain="" ;
	netmask="0xffffff00" ;
	ifconfig_flags="" ;
	remote_hostip="" ;
	tmp_dir="/usr/tmp" ;
	ftp_path="ftp://ftp.freebsd.org/pub/FreeBSD/2.0-ALPHA/bindist" ;
	nfs_path="" ;
	cdrom_path="" ;
	serial_interface="/dev/tty00" ;
	serial_speed="38400" ;
	installing=1 ;
d92 9
d103 1
a103 1
	dialog --title "Welcome to FreeBSD" --clear \
d124 1
a124 1
	dialog --clear --title "Installation From" \
d145 1
a145 1
		dialog --clear --title "Chose Tape Type" \
d167 1
a167 1
		dialog --clear --title "Chose CDROM Type" \
d193 1
a193 1
		dialog --title "FTP Installation Information" --clear \
d208 1
a208 1
		dialog --title "NFS Installation Information" --clear \
d231 1
a231 1
	dialog --title "Chose temporary directory" --clear \
d258 1
a258 1
	if dialog --title "Delete contents?" --clear \
d266 1
a266 1
	dialog --clear --title "Ethernet Interface Name" \
d285 1
d298 1
a308 9
network_dialog()
{
	dialog --title "Network Information" --clear \
	--inputbox "$*" 10 60 "$default_value" 2> ${TMP}/inputbox.tmp.$$
	if ! handle_rval $?; then return 1; fi
	answer=`cat ${TMP}/inputbox.tmp.$$`
	rm -f ${TMP}/inputbox.tmp.$$
}

d312 1
d314 1
a314 1
		dialog --clear --title "Set up network interface" \
d341 1
d354 1
a354 1
	if ! network_dialog "What is the IP address of this host"; then return 1; fi
d399 1
d419 1
a419 1
		dialog --title "Results of tape extract" --clear \
d429 1
a429 1
			dialog --title "CDROM Information" --clear \
@


1.21
log
@Remove ppp from the list of options - we don't even have ppp in the default
kernel, and ppp people can generally use SLIP.

A few more formatting changes.

Make slip installation work.
@
text
@d16 1
a16 1
# $Id$
d483 3
a485 1
user for yourself.\nAny install-related comments to jkh, phk or paul (@@freebsd.org)." 18 72
@


1.20
log
@Sigh.  I'm sleepy, and I just read this again.  Have it make sense this time.
@
text
@d8 1
a8 1
# November 11th, 1994
d12 1
a12 1
# provided that this message stay intact, and at this location (no putting
d16 1
d45 2
d96 1
a96 1
installation though a secrdist is also useful if you want your
d103 3
a105 1
obtaining a secrdist for your part of the world." 15 72
d114 7
a120 7
	dialog --clear --title "Chose installation media" \
--menu "Before we begin the installation, we need to chose and possibly \n\
configure your method of installation.  Please pick from one of \n\
the following options.  If your option isn't listed here, your \n\
best bet may be to simply hit ESC twice to get a subshell and \n\
proceed manually on your own.  If you are finished installing, \n\
select cancel.\n\n\
d122 2
a123 2
	"Tape" "Load installation from SCSI or QIC tape" \
	"CDROM" "Load installation from SCSI or Mitsumi CDROM" \
d125 1
a125 1
        "FTP" "Load the distribution over ftp" \
d135 1
a135 1
		dialog --clear --title "Chose tape type" \
d157 1
a157 1
		dialog --clear --title "Chose CDROM type" \
d186 4
a189 5
specification (e.g. something like ftp://ftp.freeBSD.org/pub/...) or
simply the name of a host to connect to.  If only a host name is
specified, the installation assumes that you will properly connect
and \"mget\" the files yourself.\n\n" \
16 72 "$ftp_path" 2> ${TMP}/inputbox.tmp.$$
d200 4
a203 4
distribution you wish to load.  This should be in machine:dir
syntax (e.g. zooey:/a/FreeBSD/bindist).  The remote directory
should also, of course, be exported!\n\n" \
16 72 "$nfs_path" 2> ${TMP}/inputbox.tmp.$$
d227 4
a230 2
for you.\n\n" \
16 72 "/usr/tmp" 2> ${TMP}/inputbox.tmp.$$
d257 1
a257 1
	--menu "Please select the type of ethernet device you have:\n\n" \
d275 4
a278 2
	not_supported
}
d280 7
a286 3
setup_network_ppp()
{
	not_supported
d292 1
a292 1
	if ! network_dialog "What is the ip number for the remote host"; then return 1; fi
d312 1
a312 1
		20 72 4 \
a314 1
		"PPP" "A point-to-point protocol link" \
a330 4
	PPP)
		if ! setup_network_ppp; then continue; fi
	;;

d372 3
d399 1
a399 1
		message "Extracting distribution\nPlease wait!"
d482 2
a483 2
in as root when prompted for a user name and run vipw to add a new user
for yourself.\nAny install-related comments to jkh, phk or paul (@@freebsd.org)." 15 72
@


1.19
log
@Add a long-needed comment about logging in as root.
@
text
@d470 4
a473 4
it will at least handle the first checklist item for you.  The login
\"root\" has no password.  If you're new to UN*X, log in as root and
run vipw to add a new user.  Thanks!  Any install-related comments to
jkh, phk or paul (@@freebsd.org)." 15 72
@


1.18
log
@Just some last tweaks to make NFS install more friendly.
@
text
@d470 4
a473 2
it will at least handle the first checklist item for you.  Thanks!
\nAny install-related comments to jkh, phk or paul (@@freebsd.org)." 15 72
@


1.17
log
@Use mount_nfs directly for NFS install.
Add mount_nfs to the cpio floppy.

Thanks, Michael R.!
Submitted by:	mr
@
text
@d207 1
d389 1
a389 1
		message "Extracting distribution"
d452 1
@


1.16
log
@Add full support for NFS installation.  Add support for CD installation,
even though we don't use it yet (I may burn some one-offs tonite though! :-).
@
text
@d203 1
a203 1
		if ! mount $nfs_path /mnt > /dev/ttyv1 2>&1; then
@


1.15
log
@Put in a hook to communicate properly with sysinstall.
@
text
@d41 3
a43 1
	ftp_path="ftp://ftp.freebsd.org/pub/FreeBSD/2.0-ALPHA/bindist"
d70 5
d113 3
a115 2
best bet may be to simply hit ESC twice to get a subshell and proceed \n\
manually on your own.  If you are finished installing, select cancel.\n\n\
d193 15
a207 2
		setup_network
		not_supported
d297 8
a304 8
	dialog --clear --title "Set up network interface" \
	--menu "Please select the type of network connection you have:\n\n" \
	20 72 4 \
	"ether" "A supported ethernet card" \
	"SLIP" "A point-to-point SLIP (Serial Line IP) connection" \
        "PPP" "A point-to-point protocol link" \
        "PLIP" "A Parallel-Line IP setup (sort of like lap-link)" \
        2> ${TMP}/menu.tmp.$$
d306 6
a311 6
	retval=$?
	choice=`cat ${TMP}/menu.tmp.$$`
	rm -f ${TMP}/menu.tmp.$$
	if ! handle_rval $retval; then return 1; fi
	case $choice in
	ether)
d359 1
a359 1
	if ! $IFCONFIG $interface $ipaddr $remote_hostip netmask $netmask $ifconfig_flags 2>&1 > /dev/ttyv1 ; then
d370 2
a371 2
			echo "Progress <$ROUTE $ROUTE_FLAGS $gateway>" > /dev/ttyv1
			$ROUTE $ROUTE_FLAGS $gateway 2>&1 > /dev/ttyv1
d385 10
d404 1
a404 5
		if [ -f extract.sh ]; then
			sh ./extract.sh
		else
			error "This isn't a proper distribution.  No installation script found."
		fi
d409 12
a420 1
		not_supported
d434 2
a435 1
			if ! ncftp $media_device/* 2>&1 > /dev/ttyv1; then
d438 1
a438 5
				if [ -f extract.sh ]; then
					sh ./extract.sh
				else
					error "This isn't a proper distribution.  No installation script found."
				fi
d441 1
d443 2
a444 5
			if [ -f extract.sh ]; then
				sh ./extract.sh
			else
				error "No installation script found.  Please grab the right bits."
			fi
d451 4
a454 1
		not_supported
@


1.14
log
@Remove the redirects for extract.sh.  Upon further reflection, you
need to see the output on the main vty.  cpio likes to open /dev/tty
for its output! :-(
@
text
@d448 1
a448 1
echo; echo "Exiting to shell"
d450 2
a451 1
exec /stand/sh
@


1.13
log
@I was being too conservative in my estimation of disk space.  Bump
these values up a bit after being yelled at by Poul.
@
text
@d374 1
a374 1
			sh ./extract.sh 2>&1 > /dev/ttyv1
d400 1
a400 1
					sh ./extract.sh 2>&1 > /dev/ttyv1
d408 1
a408 1
				sh ./extract.sh 2>&1 > /dev/ttyv1
@


1.12
log
@Add a little user-proofing.
@
text
@d198 4
a201 3
At minimum, a binary distribution will require around 10MB.
At maximum, a srcdist may take 60MB or more.  If the directory
you specify does not exist, it will be created for you.\n\n" \
@


1.11
log
@Whoops - forgot to set the interface name for lp0.
@
text
@d327 3
a329 1
		netmask=$answer
d346 5
a350 3
		gateway=$answer
		echo "Progress <$ROUTE $ROUTE_FLAGS $gateway>" > /dev/ttyv1
		$ROUTE $ROUTE_FLAGS $gateway 2>&1 > /dev/ttyv1
d355 4
a358 2
		nameserver=$answer
		echo "nameserver $nameserver" > /etc/resolv.conf
@


1.10
log
@Some changes from Michael Reifenberger.  Thanks, Michael!
@
text
@d259 1
@


1.9
log
@11th hour fixes to get the install just right.  Fix some bugs
in how ftp transfers were done, make sure all output goes to /dev/ttyv1
for debugging, add in the parallel-IP support so Poul will stop
squeaking (for the moment, anyway).
@
text
@d24 2
d342 1
a342 1
	if network_dialog "If you have a gateway, enter its IP address (otherwise cancel)"; then
d344 2
a345 2
		echo "Progress <route add default $gateway>" > /dev/ttyv1
		route add default $gateway 2>&1 > /dev/ttyv1
d418 1
a418 1
	dialog --title "Aufwiedersehen!" \
@


1.8
log
@Sorry about last commit message (or lack thereof) - slip of the fingers.
Adjust the docs to point out how to get a sub-shell during the install.
Add an entry for the PCMCIA ethernet driver.
@
text
@d24 2
a25 2
ROUTE=route
ROUTE_FLAGS="add default"
d35 1
a35 1
	netmask="" ;
d37 1
d39 1
d42 1
d82 10
a91 9
--msgbox "Hi!  Nice to see you've made it this far.  We're now ready to
install one or more packed distribution sets onto your machine.
At the minimum, you need a bindist installation though a
secrdist is also useful if you want your system to have any kind
of effective security.  The secrdist is a bit of a special case
since it cannot be legally obtained from the U.S. due to export
restrictions, but non-U.S. versions are also available.  See the
release notes for more information on where to obtain a secrdist
for your part of the world." 15 72
d104 2
a105 2
best bet may be to simply hit ESC twice to get a shell and proceed \n\
manually on your own. \n\n\
d175 1
a175 1
16 72 "ftp://ftp.freebsd.org/pub/FreeBSD/2.0-ALPHA/bindist/" 2> ${TMP}/inputbox.tmp.$$
d179 1
a203 1
	echo wahoo
d254 12
a265 1
	not_supported
a302 6
	dialog --title "Hostname Information" --clear \
	--inputbox "Please specify the name of this host" 5 60 "foo" \
	2> ${TMP}/inputbox.tmp.$$
	if ! handle_rval $?; then return 1; fi
	hostname=`cat ${TMP}/inputbox.tmp.$$`
	rm -f ${TMP}/inputbox.tmp.$$
d304 10
a313 6
	dialog --title "Address Information" --clear \
	--inputbox "Please specify the IP address of this host" 5 60 "" \
	2> ${TMP}/inputbox.tmp.$$
	if ! handle_rval $?; then return 1; fi
	ipaddr=`cat ${TMP}/inputbox.tmp.$$`
	rm -f ${TMP}/inputbox.tmp.$$
d315 10
a324 7
	dialog --title "Netmask Information" --clear \
	--inputbox "Please specify the netmask" 5 60 "0xffffff00" \
	2> ${TMP}/inputbox.tmp.$$
	if handle_rval $?; then
		netmask=`cat ${TMP}/inputbox.tmp.$$`
	else
		netmask="0xffffff00"
a325 1
	rm -f ${TMP}/inputbox.tmp.$$
d327 3
a329 5
	dialog --title "Extra Information" --clear \
	--inputbox "Any extra flags to ifconfig?" 5 60 "" \
	2> ${TMP}/inputbox.tmp.$$
	if handle_rval $?; then
		ifconfig_flags=`cat ${TMP}/inputbox.tmp.$$`
d331 2
a332 1
	if ! $IFCONFIG $interface netmask $netmask $ifconfig_flags 2>/dev/ttyv1 ; then
d338 7
d346 4
a349 10
	dialog --title "Gateway host" --clear \
	--inputbox "Please specify the gateway host, if any" 5 60 "" \
	2> ${TMP}/inputbox.tmp.$$
	if handle_rval $?; then
		gateway=`cat ${TMP}/inputbox.tmp.$$`
		if [ "$gateway" = "" ]; then
			:;
		else
			$ROUTE $route_flags $gateway 2>/dev/ttyv1
		fi
a350 1
	rm -f ${TMP}/inputbox.tmp.$$
d364 1
a364 1
			sh ./extract.sh
d386 1
a386 1
			if ! ncftp $media_device/* ; then
d390 1
a390 1
					sh ./extract.sh
d398 1
a398 1
				sh ./extract.sh
d419 5
a423 5
ask some additional questions about time zone setup, your name
server, what sort of mail client this host is, etc.  We just ran
out of time for ALPHA!  At the very least, you may wish to check
out the 'tzsetup' command - it will at least handle the first
checklist item for you.  Thanks!" 15 72
d438 2
@


1.7
log
@Reviewed by:
Submitted by:
Obtained from:
@
text
@d223 1
a223 1
	 20 76 5 \
d229 1
@


1.6
log
@Trim back the confirm dialog.
Increase the amount of space available to the ethernet setup dialog
Put in a last parting-shot dialog telling you to run tzsetup, and promising
to do this for you later.
Adjust flags to ifconfig - they were bogus.
@
text
@d100 1
a100 1
best bet may be to simply select CANCEL to get a shell and proceed \n\
@


1.5
log
@Actually allow the poor user to get out of the script.
@
text
@d60 1
a60 1
	dialog --title "Please Confirm" --msgbox "$*" 4 72
d120 1
a120 1
		"SCSI" "SCSI tape drive attached to standard SCSI controller" \
d142 1
a142 1
		"SCSI" "SCSI CDROM drive attached to standard SCSI controller" \
d223 6
a228 4
	 20 72 4 \
	"ed0" "WD80x3, SMC, Novell NE1000/2000 or 3C503 generic NIC" \
	"ie0" "AT&T StarLan and EN100 family" \
	"is0" "Isolan 4141-0 or Isolink 4110 Ethernet controller" \
d317 1
a317 1
	if ! $IFCONFIG inet $interface netmask $netmask $ifconfig_flags 2>/dev/ttyv1 ; then
d399 12
d419 1
a419 1
		confirm "Exiting per user request.";
@


1.4
log
@Commit latest working sources.  Go to bed.
@
text
@d60 1
a60 1
	dialog --title "Please Confirm" --msgbox "$*" 10 72
d315 1
a315 1
	if ! $IFCONFIG inet $interface netmask $netmask $ifconfig_flags ; then
d330 1
a330 1
			$ROUTE $route_flags $gateway
d409 1
@


1.3
log
@Fix a botch Poul introduced.
@
text
@d23 3
d27 1
d31 6
d42 2
d50 1
a50 2
		echo "User aborted installation, invoking shell.";
		exec /stand/sh
d58 1
d63 1
d68 1
d71 3
a73 3
        --msgbox "This feature is not supported in the current version of the \
installation tools but will be in the release, barring \
some sort of fatal accident.  Please press RETURN to go on." 10 60
d76 1
d91 2
d163 1
d175 1
d178 1
d185 1
d194 2
a195 2
16 72 "/usr${TMP}" 2> ${TMP}/inputbox.tmp.$$
		if ! handle_rval $?; then continue; fi
d197 1
d199 1
d205 1
a205 1
	if ! cd $tmp_dir 2> /dev/null; then
d207 1
a207 1
		return
a208 1
	return 0
d219 118
d341 2
a342 2
		if ! set_tmpdir; then return 1; fi
		if ! cd_tmpdir; then return 1; fi
d344 1
a344 1
		dialog --title "Extract from tape" --clear \
d360 2
a361 2
		if ! set_tmpdir; then return 1; fi
		if ! cd_tmpdir; then return 1; fi
d366 2
a367 2
		if ! set_tmpdir; then return 1; fi
		if ! cd_tmpdir; then return 1; fi
d369 1
a369 1
			if ! ncftp $media_device/* 2>/dev/null; then
@


1.2
log
@Beat this quite a bit more into shape.  Almost there - time to test at
least one major install method.
@
text
@d22 1
d29 1
d65 8
a72 10
install one or more packed distribution sets onto your machine.  At
the minimum, you need a bindist installation. A secrdist is also
useful if you want your system to have any kind of effective
security.  The secrdist is a bit of a special case since it cannot
be legally obtained from the U.S. due to export restrictions, but
non-U.S. versions are also available.  See the release notes for more
information on where to obtain a secrdist for your part of the world.
In the menus and dialogs that follow, you may use your arrow keys to
move up and down, as well as your PageUp and PageDown keys to scroll.
If you wish to abort while in a dialog, hit ESC twice." 15 72
d90 1
a90 1
        "NFS" "Load the distribution over NFS" 2> /tmp/menu.tmp.$$
d93 2
a94 2
	choice=`cat /tmp/menu.tmp.$$`
	rm -f /tmp/menu.tmp.$$
d105 1
a105 1
			2> /tmp/menu.tmp.$$
d107 2
a108 2
		choice=`cat /tmp/menu.tmp.$$`
		rm -f /tmp/menu.tmp.$$
d127 1
a127 1
			2> /tmp/menu.tmp.$$
d129 2
a130 2
		choice=`cat /tmp/menu.tmp.$$`
		rm -f /tmp/menu.tmp.$$
d153 1
a153 1
16 72 "ftp://ftp.freebsd.org/pub/FreeBSD/2.0-ALPHA/bindist/" 2> /tmp/inputbox.tmp.$$
d156 1
a156 1
		media_device=`cat /tmp/inputbox.tmp.$$`
d173 1
a173 1
16 72 "/usr/tmp" 2> /tmp/inputbox.tmp.$$
d175 1
a175 1
	tmp_dir=`cat /tmp/inputbox.tmp.$$`
@


1.1
log
@1. The gzip'd docs aren't going to work - there's no scroll-back for
   process output dialogs (or any way to stop the output, for that matter!).
2. Install the very first cut of my bininst stage6 script.  VERY rough,
   it doesn't actually do anything just yet, but I need to make sure that
   it's at least executed for the moment.
@
text
@d16 6
a21 1
DIALOG=${DIALOG=/usr/bin/dialog}
d26 2
a27 1
	inst_dir="/usr/tmp" ;
d45 8
d54 1
a54 1
	$DIALOG --title "Sorry!" \
d61 1
a61 1
	$DIALOG --title "Welcome to FreeBSD" --clear \
d64 9
a72 9
the minimum, you need a bindist installation. A secrdist is also useful
if you want your system to have any kind of effective security.
The secrdist is a bit of a special case since it cannot be legally
obtained from the U.S. due to export restrictions, but non-U.S.
versions are also available.  See the release notes for more information
on where to obtain a secrdist for your part of the world.  In the menus
and dialogs that follow, you may use your arrow keys to move up and down,
as well as your PageUp and PageDown keys to scroll.  If you wish to abort
while in a dialog, hit ESC twice." 15 77
d79 1
a79 1
	$DIALOG --clear --title "Chose installation media" \
d85 1
a85 1
	Please choose one of the following:" 20 70 5 \
d99 1
a99 1
		$DIALOG --clear --title "Chose tape type" \
d102 1
a102 1
		Choose one of the following:" 20 70 2 \
d121 20
a140 1
		not_supported
d146 1
a146 1
		$DIALOG --title "FTP Installation Information" --clear \
d148 6
a153 3
distribution you wish to load.  This should be a \"URL style\"
specification (e.g. something like ftp://ftp.freeBSD.org/pub/...)\n\n" \
16 70 'ftp://ftp.freebsd.org/pub/FreeBSD/2.0-ALPHA/bindist/' 2> /tmp/inputbox.tmp.$$
d165 32
d199 56
a254 1
	echo Installing from $media_type on $media_device
d258 1
d260 1
a260 1
while :; do
d263 1
d265 2
a266 2
		echo "Exiting per user request.";
		exit 0;
@
