1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00

First shot at fixing all the various bugs reported so far in the

installation.
This commit is contained in:
Jordan K. Hubbard 1994-11-28 22:13:07 +00:00
parent aef8c83d89
commit 50d89503a4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4855
6 changed files with 352 additions and 308 deletions

View File

@ -13,20 +13,15 @@
# 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.49 1994/11/21 08:33:55 jkh Exp $
# $Id: bininst,v 1.50 1994/11/21 09:50:02 jkh Exp $
if [ "$_BININST_LOADED_" = "yes" ]; then
if [ "${_BININST_LOADED_}" = "yes" ]; then
echo "Error, $0 loaded more than once!"
return 1
else
_BININST_LOADED_=yes
fi
# Set some useful variables
HOME=/; export HOME
TMP=/tmp
# Grab the miscellaneous functions.
. /stand/miscfuncs.sh
@ -44,7 +39,7 @@ set_defaults()
{
network_set_defaults
media_set_defaults
installing="yes"
INSTALLING="yes"
mkdir -p ${TMP}
cp /stand/etc/* /etc
}
@ -52,45 +47,47 @@ set_defaults()
# Print welcome banner.
welcome()
{
dialog --title "Welcome to FreeBSD!" $clear \
--msgbox \
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! :-) If you're set and ready
to go, please remove the cpio floppy from the drive and press return!" -1 -1
where you put the distribution media! :-) Please remove the cpio
floppy from the drive and press return." -1 -1
}
do_last_config()
{
if [ "$hostname" = "" ]; then network_basic_setup; fi
done=""
while [ "$done" = "" ]; do
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 4 \
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.$$`
RETVAL=$?
CHOICE=`cat ${TMP}/menu.tmp.$$`
rm -f ${TMP}/menu.tmp.$$
if ! handle_rval $retval; then exit 0; fi
if ! handle_rval ${RETVAL}; then exit 0; fi
case $choice in
case ${CHOICE} in
tzsetup)
dialog --clear
sh /stand/tzsetup
dialog --clear
;;
network)
network_setup
;;
user)
sh /stand/adduser.sh -i
;;
@ -100,7 +97,7 @@ Please select one of the following options:" -1 -1 4 \
;;
done)
done="yes"
DONE="yes"
;;
esac
done
@ -127,14 +124,14 @@ We sincerely hope you enjoy FreeBSD 2.0!
welcome
set_defaults
while [ "$installing" = "yes" ]; do
while [ "${INSTALLING}" = "yes" ]; do
if media_select_distribution; then
if media_chose; then
media_install_set
fi
else
do_last_config
installing="no"
INSTALLING="no"
fi
done
echo; echo "Spawning shell. Exit shell to continue with new bindist."

View File

@ -21,7 +21,7 @@ ln sh -sh # init invokes the shell this way
progs badsect basename chown clri disklabel dmesg dump dmesg fdisk fsck ft
progs getopt ifconfig init mknod mount mount_cd9660 mount_msdos mount_nfs
progs newfs ping reboot restore route swapon umount
progs newfs ping pppd reboot restore route swapon umount
ln dump rdump
ln restore rrestore
ln reboot halt

View File

@ -10,9 +10,9 @@
# putting your name on top after doing something trivial like reindenting
# it, just to make it look like you wrote it!).
#
# $Id: instdist.sh,v 1.30 1994/11/24 20:52:16 jkh Exp $
# $Id: instdist.sh,v 1.31 1994/11/27 13:03:00 ats Exp $
if [ "$_INSTINST_SH_LOADED_" = "yes" ]; then
if [ "${_INSTINST_SH_LOADED_}" = "yes" ]; then
return 0
else
_INSTINST_SH_LOADED_=yes
@ -21,47 +21,34 @@ fi
# Grab the miscellaneous functions.
. /stand/miscfuncs.sh
# Set some reasonable defaults.
TAR=tar
TAR_FLAGS="--unlink -xvf"
MNT=/mnt
# Set the initial state for media installation.
media_set_defaults()
{
media_type=""
media_device=""
media_distribution=""
distrib_subdir=""
clear=""
ipaddr=""
hostname=""
ether_intr=""
domain=""
netmask="0xffffff00"
ifconfig_flags=""
remote_hostip=""
tmp_dir="/usr/tmp"
ftp_path=""
nfs_path=""
nfs_options=""
serial_interface="/dev/tty00"
serial_speed="38400"
MEDIA_TYPE=""
MEDIA_DEVICE=""
MEDIA_DISTRIBUTION=""
DISTRIB_SUBDIR=""
TMPDIR="/usr/tmp"
FTP_PATH=""
NFS_PATH=""
}
# Set the installation media to undefined.
media_reset()
{
media_device=""
media_type=""
media_distribution=""
MEDIA_DEVICE=""
MEDIA_TYPE=""
MEDIA_DISTRIBUTION=""
FTP_PATH=""
NFS_PATH=""
NFS_OPTIONS=""
}
# Set the location of our temporary unpacking directory.
media_set_tmpdir()
{
title="Chose temporary directory"
default_value="/usr/tmp"
TITLE="Chose temporary directory"
DEFAULT_VALUE="${TMPDIR}"
if ! input \
"Please specify the name of a directory containing enough free
space to hold the temporary files for this distribution. At
@ -72,15 +59,15 @@ 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."; then return 1; fi
tmp_dir=$answer
mkdir -p $tmp_dir
TMPDIR=${ANSWER}
mkdir -p ${TMPDIR}
return 0
}
media_cd_tmpdir()
{
if ! cd $tmp_dir > /dev/ttyv1 2>&1; then
error "No such file or directory for ${tmp_dir}, sorry! Please fix this and try again."
if ! cd ${TMPDIR} > /dev/ttyv1 2>&1; then
error "No such file or directory for ${TMPDIR}, sorry! Please fix this and try again."
return 1
fi
}
@ -88,16 +75,15 @@ media_cd_tmpdir()
media_rm_tmpdir()
{
cd /
if dialog --title "Delete contents?" $clear --yesno \
"Do you wish to delete the contents of ${tmp_dir}?" -1 -1; then
rm -rf $tmp_dir/*
if dialog --title "Delete contents?" --yesno \
"Do you wish to delete the contents of ${TMPDIR}?" -1 -1; then
rm -rf ${TMPDIR}/*
fi
}
media_select_ftp_site()
{
dialog $clear --title "Please specify an ftp site" \
--menu \
dialog --title "Please specify an ftp site" --menu \
"FreeBSD is distributed from a number of sites on the Internet.\n\
Please select the site closest to you or \"other\" if you'd like\n\
to specify another choice. Also note that not all sites carry\n\
@ -115,50 +101,50 @@ binary set are only guaranteed to be available from the Primary site." \
"Russia" "ftp://ftp.kiae.su/FreeBSD/${DISTNAME}" \
"other" "None of the above. I want to specify my own." \
2> ${TMP}/menu.tmp.$$
retval=$?
answer=`cat ${TMP}/menu.tmp.$$`
RETVAL=$?
ANSWER=`cat ${TMP}/menu.tmp.$$`
rm -f ${TMP}/menu.tmp.$$
if ! handle_rval $retval; then return 1; fi
case $answer in
if ! handle_rval ${RETVAL}; then return 1; fi
case ${ANSWER} in
Primary)
ftp_path="ftp://ftp.freebsd.org/pub/FreeBSD/${DISTNAME}"
FTP_PATH="ftp://ftp.freebsd.org/pub/FreeBSD/${DISTNAME}"
;;
U.S-2)
ftp_path="ftp://ftp.dataplex.net/pub/FreeBSD/${DISTNAME}"
FTP_PATH="ftp://ftp.dataplex.net/pub/FreeBSD/${DISTNAME}"
;;
U.S-3)
ftp_path="ftp://kryten.atinc.com/pub/FreeBSD/${DISTNAME}"
FTP_PATH="ftp://kryten.atinc.com/pub/FreeBSD/${DISTNAME}"
;;
U.S-4)
ftp_path="ftp://ref.tfs.com/pub/FreeBSD/${DISTNAME}"
FTP_PATH="ftp://ref.tfs.com/pub/FreeBSD/${DISTNAME}"
;;
Taiwan)
ftp_path="ftp://netbsd.csie.nctu.edu.tw/pub/FreeBSD/${DISTNAME}"
FTP_PATH="ftp://netbsd.csie.nctu.edu.tw/pub/FreeBSD/${DISTNAME}"
;;
Australia)
ftp_path="ftp://ftp.physics.usyd.edu.au/FreeBSD/${DISTNAME}"
FTP_PATH="ftp://ftp.physics.usyd.edu.au/FreeBSD/${DISTNAME}"
;;
France)
ftp_path="ftp://ftp.ibp.fr/pub/FreeBSD/${DISTNAME}"
FTP_PATH="ftp://ftp.ibp.fr/pub/FreeBSD/${DISTNAME}"
;;
Finland)
ftp_path="ftp://nic.funet.fi:/pub/unix/FreeBSD/${DISTNAME}"
FTP_PATH="ftp://nic.funet.fi:/pub/unix/FreeBSD/${DISTNAME}"
;;
Russia)
ftp_path="ftp://ftp.kiae.su/FreeBSD/${DISTNAME}"
FTP_PATH="ftp://ftp.kiae.su/FreeBSD/${DISTNAME}"
;;
other)
title="FTP Installation Information"
default_value="$ftp_path"
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\"
@ -166,7 +152,7 @@ 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."; then return 1; fi
ftp_path=$answer
FTP_PATH=${ANSWER}
;;
esac
}
@ -177,9 +163,13 @@ media_extract_dist()
message "Verifying checksums for distribution. Please wait!"
if sh ./do_cksum.sh; then
if [ -f extract.sh ]; then
message "Extracting ${media_distribution} distribution. Please wait!"
sh ./extract.sh < /dev/ttyv1 > /dev/ttyv1 2>&1
dialog $clear --title "Extraction Complete" --msgbox "Please press return to continue" -1 -1
message "Extracting ${MEDIA_DISTRIBUTION} distribution. Please wait!"
if [ -f ./.is_interactive]; then
sh ./extract.sh
else
sh ./extract.sh < /dev/ttyv1 > /dev/ttyv1 2>&1
fi
dialog --title "Extraction Complete" --msgbox "Please press return to continue" -1 -1
else
error "No installation script found!"
fi
@ -193,10 +183,10 @@ media_extract_dist()
media_install_set()
{
case $media_type in
case ${MEDIA_TYPE} in
cdrom|nfs|ufs|doshd)
if ! cd ${media_device}/${media_distribution} > /dev/ttyv1 2>&1; then
error "Unable to cd to ${media_device}/${media_distribution} directory."
if ! cd ${MEDIA_DEVICE}/${MEDIA_DISTRIBUTION} > /dev/ttyv1 2>&1; then
error "Unable to cd to ${MEDIA_DEVICE}/${MEDIA_DISTRIBUTION} directory."
media_reset
else
media_extract_dist
@ -208,13 +198,17 @@ media_install_set()
tape)
if ! media_set_tmpdir; then return; fi
if ! media_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
confirm "Please mount tape for ${MEDIA_DEVICE}."
if [ "${MEDIA_DEVICE}" = "ftape" ]; then
progress "${FT_CMD} | ${TAR_CMD} ${TAR_FLAGS} -"
dialog --title "Results of floppy tape extract" \
--prgbox "${FT_CMD} | ${TAR_CMD} ${TAR_FLAGS} -" \
10 72
else
dialog --title "Results of tape extract" $clear \
--prgbox "$TAR $TAR_FLAGS $media_device" 10 72
progress "${TAR_CMD} ${TAR_FLAGS} ${MEDIA_DEVICE}"
dialog --title "Results of tape extraction" \
--prgbox "${TAR_CMD} ${TAR_FLAGS} ${MEDIA_DEVICE}" \
10 72
fi
media_extract_dist
media_rm_tmpdir
@ -223,19 +217,21 @@ media_install_set()
dosfd)
if ! media_set_tmpdir; then return; fi
if ! media_cd_tmpdir; then return; fi
copying="yes"
while [ "$copying" = "yes" ]; do
COPYING="yes"
progress "Preparing to extract from DOS floppies"
while [ "${COPYING}" = "yes" ]; do
progress "Asking for DOS diskette"
if dialog --title "Insert distribution diskette" \
$clear --yesno "Please enter the next diskette and press OK to continue or Cancel if finished" -1 -1; then
--yesno "Please enter the next diskette and select <OK> to continue or <Cancel> if finished" -1 -1; then
umount ${MNT} > /dev/null 2>&1
if ! mount_msdos ${media_device} ${MNT}; then
if ! mount_msdos ${MEDIA_DEVICE} ${MNT}; then
error "Unable to mount floppy! Please correct."
else
( tar -cf - -C ${MNT} . | tar -xvf - ) >/dev/ttyv1 2>&1
( ${TAR_CMD} -cf - -C ${MNT} . | ${TAR_CMD} -xvf - ) >/dev/ttyv1 2>&1
umount ${MNT}
fi
else
copying="no"
COPYING="no"
fi
done
media_extract_dist
@ -246,16 +242,16 @@ media_install_set()
ftp)
if ! media_set_tmpdir; then return; fi
if ! media_cd_tmpdir; then return; fi
if ! echo $media_device | grep -q -v 'ftp://'; then
if ! echo ${MEDIA_DEVICE} | grep -q -v 'ftp://'; then
message "Fetching distribution using ncftp.\nUse ALT-F2 to see output, ALT-F1 to return."
if ! ncftp $media_device/${media_distribution}/* < /dev/null > /dev/ttyv1 2>&1; then
error "Couldn't fetch ${media_distribution} distribution from\n${media_device}!"
if ! ncftp ${MEDIA_DEVICE}/${MEDIA_DISTRIBUTION}/* < /dev/null > /dev/ttyv1 2>&1; then
error "Couldn't fetch ${MEDIA_DISTRIBUTION} distribution from\n${MEDIA_DEVICE}!"
else
media_extract_dist
fi
else
dialog --clear
ftp $media_device
ftp ${MEDIA_DEVICE}
dialog --clear
media_extract_dist
fi
@ -267,10 +263,10 @@ media_install_set()
media_select_distribution()
{
media_distribution=""
while [ "$media_distribution" = "" ]; do
MEDIA_DISTRIBUTION=""
while [ "${MEDIA_DISTRIBUTION}" = "" ]; do
dialog $clear --title "Please specify a distribution to load" \
dialog --title "Please specify a distribution to load" \
--menu \
"FreeBSD is separated into a number of distributions for ease of\n\
installation. With repeated passes through this screen, you'll be\n\
@ -280,57 +276,56 @@ from the U.S. Please don't endanger U.S. ftp sites by getting it\n\
illegally, thanks! When finished, select <Cancel>." \
-1 -1 10 \
"?diskfree" "How much disk space do I have free?" \
"bindist" "Binary base files (mandatory - $BINSIZE)" \
"games" "Games and other frivolities (optional - $GAMESIZE)" \
"manpages" "Manual pages (optional - $MANSIZE)" \
"proflibs" "Profiled libraries (optional - $PROFSIZE)" \
"dict" "Spelling checker dictionary files (optional - $DICTSIZE)" \
"srcdist" "Sources for everything but DES (optional - $SRCSIZE)" \
"secrdist" "DES encryption code (and sources) (optional - $SECRSIZE)" \
"compat1xdist" "FreeBSD 1.x binary compatability (optional - $COMPATSIZE)" \
"XFree86-3.1" "The XFree86 3.1 distribution (optional - $X11SIZE)" \
"bindist" "Binary base files (mandatory - ${BINSIZE})" \
"games" "Games and other frivolities (optional - ${GAMESIZE})" \
"manpages" "Manual pages (optional - ${MANSIZE})" \
"proflibs" "Profiled libraries (optional - ${PROFSIZE})" \
"dict" "Spelling checker dictionary files (optional - ${DICTSIZE})" \
"srcdist" "Sources for everything but DES (optional - ${SRCSIZE})" \
"secrdist" "DES encryption code (and sources) (optional - ${SECRSIZE})" \
"compat1xdist" "FreeBSD 1.x binary compatability (optional - ${COMPATSIZE})" \
"XFree86-3.1" "The XFree86 3.1 distribution (optional - ${X11SIZE})" \
2> ${TMP}/menu.tmp.$$
retval=$?
media_distribution=`cat ${TMP}/menu.tmp.$$`
RETVAL=$?
MEDIA_DISTRIBUTION=`cat ${TMP}/menu.tmp.$$`
rm -f ${TMP}/menu.tmp.$$
if ! handle_rval $retval; then return 1; fi
if [ "$media_distribution" = "?diskfree" ]; then
if ! handle_rval ${RETVAL}; then return 1; fi
if [ "${MEDIA_DISTRIBUTION}" = "?diskfree" ]; then
if df -k > ${TMP}/df.out; then
dialog $clear \
--title "How much free space do I have?" \
--textbox ${TMP}/df.out 15 76
dialog --title "How much free space do I have?" \
--textbox ${TMP}/df.out 15 76
else
error "Couldn't get disk usage information! :-("
fi
media_distribution=""
MEDIA_DISTRIBUTION=""
fi
done
}
media_get_possible_subdir()
{
if [ -f ${MNT}/${media_distribution}/extract.sh ]; then return; fi
default_value="$distrib_subdir"
title="Distribution Subdirectory"
if [ -f ${MNT}/${MEDIA_DISTRIBUTION}/extract.sh ]; then return; fi
DEFAULT_VALUE="${DISTRIB_SUBDIR}"
TITLE="Distribution Subdirectory"
if input \
"If the distributions are in a subdirectory of the mount point,
please enter it here (no leading slash - it should be relative
to the mount point). The directory you enter should be the
*parent* directory of any distribution subdirectories."; then
if [ "$answer" != "" ]; then
media_device=${media_device}/$answer
distrib_subdir=$answer
if [ "${ANSWER}" != "" ]; then
MEDIA_DEVICE=${MEDIA_DEVICE}/${ANSWER}
DISTRIB_SUBDIR=${ANSWER}
fi
fi
}
# Get values into $media_type and $media_device. Call network initialization
# Get values into $MEDIA_TYPE and $MEDIA_DEVICE. Call network initialization
# if necessary.
media_chose()
{
while [ "$media_device" = "" ]; do
while [ "${MEDIA_DEVICE}" = "" ]; do
dialog $clear --title "Installation From" \
dialog --title "Installation From" \
--menu \
"Before installing a distribution, you need to chose and/or configure\n\
a method of installation. Please pick from one of the following options.\n\
@ -345,99 +340,99 @@ to proceed." -1 -1 7 \
"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.$$`
RETVAL=$?
CHOICE=`cat ${TMP}/menu.tmp.$$`
rm -f ${TMP}/menu.tmp.$$
if ! handle_rval $retval; then return 1; fi
if ! handle_rval ${RETVAL}; then return 1; fi
case $choice in
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
dialog --title "Kernel boot message output" \
--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\
dialog --title "Chose Tape Type" --menu \
"Which type of tape drive do you have attached to your \n\
system? FreeBSD supports the following types:\n" -1 -1 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.$$`
"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
if ! handle_rval ${RETVAL}; then continue; fi
MEDIA_TYPE=tape;
case ${CHOICE} in
SCSI)
media_device=/dev/rst0
MEDIA_DEVICE=/dev/rst0
;;
QIC)
media_device=/dev/rwt0
MEDIA_DEVICE=/dev/rwt0
;;
floppy)
media_device=ftape
MEDIA_DEVICE=ftape
;;
esac
;;
CDROM)
dialog $clear --title "Chose CDROM Type" \
--menu "Which type of CDROM drive do you have attached to your \n\
dialog --title "Chose CDROM Type" --menu \
"Which type of CDROM drive do you have attached to your \n\
system? FreeBSD supports the following types:\n" -1 -1 2 \
"SCSI" "SCSI CDROM drive attached to supported SCSI controller" \
"Mitsumi" "Mitsumi CDROM drive" \
2> ${TMP}/menu.tmp.$$
retval=$?
choice=`cat ${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
if ! handle_rval ${RETVAL}; then continue; fi
MEDIA_TYPE=cdrom;
case ${CHOICE} in
SCSI)
media_device=/dev/cd0a
MEDIA_DEVICE=/dev/cd0a
;;
Mitsumi)
media_device=/dev/mcd0a
MEDIA_DEVICE=/dev/mcd0a
;;
esac
umount ${MNT} > /dev/null 2>&1
if ! mount_cd9660 $media_device ${MNT} > /dev/ttyv1 2>&1; then
error "Unable to mount $media_device on ${MNT}"
media_device=""
if ! mount_cd9660 ${MEDIA_DEVICE} ${MNT} > /dev/ttyv1 2>&1; then
error "Unable to mount ${MEDIA_DEVICE} on ${MNT}"
MEDIA_DEVICE=""
else
media_device=${MNT}
MEDIA_DEVICE=${MNT}
media_get_possible_subdir
fi
;;
DOS)
default_value="/dev/fd0"
DEFAULT_VALUE="/dev/fd0"
if input \
"Please specify the device pointing at your DOS partition or
floppy media. For a hard disk, this might be something like
/dev/wd0h or /dev/sd0h (as identified in the disklabel editor).
For the "A" floppy drive, it's /dev/fd0, for the "B" floppy
drive it's /dev/fd1\n"; then
media_device=$answer
if echo $media_device | grep -q -v 'fd://'; then
MEDIA_DEVICE=${ANSWER}
if echo ${MEDIA_DEVICE} | grep -q -v fd; then
umount ${MNT} > /dev/null 2>&1
if ! mount_msdos $media_device ${MNT} > /dev/ttyv1 2>&1; then
error "Unable to mount $media_device"
media_device=""
if ! mount_msdos ${MEDIA_DEVICE} ${MNT} > /dev/ttyv1 2>&1; then
error "Unable to mount ${MEDIA_DEVICE}"
MEDIA_DEVICE=""
else
media_type=doshd
media_device=${MNT}
MEDIA_TYPE=doshd
MEDIA_DEVICE=${MNT}
media_get_possible_subdir
fi
else
media_type=dosfd
MEDIA_TYPE=dosfd
fi
fi
;;
@ -445,59 +440,59 @@ drive it's /dev/fd1\n"; then
FTP)
if ! network_setup; then continue; fi
if media_select_ftp_site; then
media_type=ftp
media_device=$ftp_path
MEDIA_TYPE=ftp
MEDIA_DEVICE=${FTP_PATH}
fi
;;
NFS)
if ! network_setup; then continue; fi
title="NFS Installation Information"
default_value="$nfs_path"
TITLE="NFS Installation Information"
DEFAULT_VALUE="${NFS_PATH}"
if ! input \
"Please specify a machine and directory mount point for the
distribution you wish to load. This must be in machine:dir
format (e.g. zooey:/a/FreeBSD/${DISTNAME}). The remote
directory *must* be be exported to your machine (or globally)
for this to work!\n"; then continue; fi
nfs_path=$answer
NFS_PATH=${ANSWER}
default_value=""
DEFAULT_VALUE="${NFS_OPTIONS}"
if input \
"Do you wish to specify any options to NFS? If you're installing
from a Sun 4.1.x system, you may wish to specify \`resvport' to send
from a Sun 4.1.x system, you may wish to specify \`-o resvport' to send
NFS requests over a privileged port (use this if you get nasty
\`\`credential too weak'' errors from the server). When using a slow
ethernet card or network link, \`-r=1024,-w=1024' may also prove helpful.
ethernet card or network link, \`-o -r=1024,-w=1024' may also prove helpful.
Options, if any, should be separated by commas."; then
if [ "$answer" != "" ]; then
nfs_options="-o $answer"
if [ "${ANSWER}" != "" ]; then
NFS_OPTIONS="${ANSWER}"
fi
fi
media_type=nfs
nfs_path=$answer
MEDIA_TYPE=nfs
NFS_PATH=${ANSWER}
umount ${MNT} > /dev/null 2>&1
if ! mount_nfs $nfs_options $nfs_path ${MNT} > /dev/ttyv1 2>&1; then
error "Unable to mount $nfs_path"
if ! mount_nfs ${NFS_OPTIONS} ${NFS_PATH} ${MNT} > /dev/ttyv1 2>&1; then
error "Unable to mount ${NFS_PATH}"
else
message "$nfs_path mounted successfully"
media_device=${MNT}
message "${NFS_PATH} mounted successfully"
MEDIA_DEVICE=${MNT}
media_get_possible_subdir
fi
;;
UFS)
dialog $clear --title "User Intervention Requested" --msgbox "
dialog --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." -1 -1
of the distribution's parent directory when we come back." -1 -1
dialog --clear
/stand/sh
title="Please enter directory"
default_value="${MNT}"
TITLE="Please enter directory"
DEFAULT_VALUE="${MNT}"
if input "Ok, now give me the full pathname of the parent directorys for the distribution(s)."; then
media_type=ufs
media_device=$answer
MEDIA_TYPE=ufs
MEDIA_DEVICE=${ANSWER}
fi
;;
esac

View File

@ -10,9 +10,9 @@
# putting your name on top after doing something trivial like reindenting
# it, just to make it look like you wrote it!).
#
# $Id: miscfuncs.sh,v 1.9 1994/11/21 07:33:21 jkh Exp $
# $Id: miscfuncs.sh,v 1.10 1994/11/22 09:02:46 jkh Exp $
if [ "$_MISCFUNCS_SH_LOADED_" = "yes" ]; then
if [ "${_MISCFUNCS_SH_LOADED_}" = "yes" ]; then
return 0
else
_MISCFUNCS_SH_LOADED_=yes
@ -22,7 +22,10 @@ PATH=/usr/bin:/usr/sbin:/bin:/sbin:/stand
export PATH
# Keep this current with the distribution!
DISTNAME=2.0-RELEASE
DISTNAME="2.0-RELEASE"
# Express or Custom install?
INSTALL_TYPE=""
# Flagrant guesses for now. These need to be hand-edited or, much better yet,
# automatically done as part of the release process. When that's the case,
@ -39,6 +42,25 @@ SECRSIZE="4MB"
COMPATSIZE="3MB"
X11SIZE="50MB"
# Paths
ETC="/etc"
MNT="/mnt"
HOME=/; export HOME
TMP=/tmp
# Commands and flags
FT_CMD= "ft"
TAR_CMD= "tar"
TAR_FLAGS= "--unlink -xvf"
IFCONFIG_CMD= "ifconfig"
ROUTE_CMD= "route"
ROUTE_FLAGS= "add default"
HOSTNAME_CMD= "hostname"
SLATTACH_CMD= "slattach"
SLATTACH_FLAGS= "-l -a -s"
PPPD_CMD= "pppd"
PPPD_FLAGS= "crtscts defaultroute -ip -mn netmask $netmask"
interrupt()
{
dialog --clear --title "User Interrupt Requested" \
@ -63,50 +85,56 @@ handle_rval()
esac
}
# stick a progress message out on the other vty
progress()
{
echo "Progress <$*>" > /dev/ttyv1
}
# A simple user-confirmation dialog.
confirm()
{
dialog $clear --title "User Confirmation" --msgbox "$*" -1 -1
dialog --title "User Confirmation" --msgbox "$*" -1 -1
}
# A simple message box dialog.
message()
{
echo "Progress <$*>" > /dev/ttyv1
dialog $clear --title "Progress" --infobox "$*" -1 -1
progress $*
dialog --title "Progress" --infobox "$*" -1 -1
}
# A simple error dialog.
error()
{
echo "ERROR <$*>" > /dev/ttyv1
dialog $clear --title "Error!" --msgbox "$*" -1 -1
dialog --title "Error!" --msgbox "$*" -1 -1
}
# Something isn't supported yet! :-(
not_supported()
{
echo "<Feature not supported>" > /dev/ttyv1
dialog $clear --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." -1 -1
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 a later release. Please press RETURN to go on." -1 -1
}
# Get a string from the user
input()
{
title=${title-"User Input Required"}
dialog $clear --title "$title" \
--inputbox "$*" -1 -1 "$default_value" 2> ${TMP}/inputbox.tmp.$$
TITLE=${TITLE-"User Input Required"}
dialog --title "${TITLE}" \
--inputbox "$*" -1 -1 "${DEFAULT_VALUE}" 2> ${TMP}/inputbox.tmp.$$
if ! handle_rval $?; then rm -f ${TMP}/inputbox.tmp.$$; return 1; fi
answer=`cat ${TMP}/inputbox.tmp.$$`
ANSWER=`cat ${TMP}/inputbox.tmp.$$`
rm -f ${TMP}/inputbox.tmp.$$
}
# Ask a networking question
network_dialog()
{
title="Network Configuration"
TITLE="Network Configuration"
if ! input "$*"; then return 1; fi
}

View File

@ -42,7 +42,7 @@ DO_THE_FUNKY_CHICKEN
for i in $TARGETS; do
abbrevname=`echo $i | sed -e 's/XFree86-3.1-//' -e 's/.tar.gz//'`
echo "if dialog --title \"Install Request\" --yesno \"Do you wish to install the ${abbrevname} distribution?\" -1 -1; then dialog --title \"Progress\" --infobox \"Installing $i\" -1 -1; tar --unlink -xzf $i -C /usr; fi" >> extract.sh
echo "if [ "${INSTALL_TYPE}" != "Express" ]; then if dialog --title \"Install Request\" --yesno \"Do you wish to install the ${abbrevname} distribution?\" -1 -1; then dialog --title \"Progress\" --infobox \"Installing $i\" -1 -1; tar --unlink -xzf $i -C /usr; fi; fi" >> extract.sh
done
cat >> extract.sh << OH_YEAH_BABY_GET_DOWN
@ -57,4 +57,5 @@ a symlink to /usr/X386." -1 -1
OH_YEAH_BABY_GET_DOWN
chmod 755 extract.sh
touch -f .is_interactive
echo " Done."

View File

@ -1,6 +1,6 @@
#!/stand/sh
#
# netinst - configure the user's network.
# netinst.sh - configure the user's network.
#
# Written: November 11th, 1994
# Copyright (C) 1994 by Jordan K. Hubbard
@ -10,186 +10,209 @@
# putting your name on top after doing something trivial like reindenting
# it, just to make it look like you wrote it!).
#
# $Id: netinst.sh,v 1.10 1994/11/21 08:33:56 jkh Exp $
# $Id: netinst.sh,v 1.11 1994/11/22 06:50:13 jkh Exp $
if [ "$_NETINST_SH_LOADED_" = "yes" ]; then
if [ "${_NETINST_SH_LOADED_}" = "yes" ]; then
return 0
else
_NETINST_SH_LOADED_=yes
fi
# Set some useful variables.
IFCONFIG=ifconfig
ROUTE=route
ROUTE_FLAGS="add default"
# Grab the miscellaneous functions.
. /stand/miscfuncs.sh
network_set_defaults()
{
hostname=""
domain=""
ipaddr="127.0.0.1"
serial_interface="/dev/tty00"
HOSTNAME=""
DOMAIN=""
NETMASK="0xffffff00"
IPADDR="127.0.0.1"
IFCONFIG_FLAGS=""
REMOTE_HOSTIP=""
REMOTE_IPADDR=""
INTERFACE=lo0
SERIAL_INTERFACE="/dev/tty00"
SERIAL_SPEED="38400"
}
network_basic_setup()
{
hostname=""
while [ "$hostname" = "" ]; do
default_value=""
HOSTNAME=""
while [ "${HOSTNAME}" = "" ]; do
DEFAULT_VALUE=""
if ! network_dialog "What is the fully qualified name of this host?"; then return 1; fi
if [ "$answer" = "" ]; then
if [ "${ANSWER}" = "" ]; then
error "You must select a host name!"
continue
else
hostname=$answer
HOSTNAME=$answer
fi
done
echo $hostname > /etc/myname
hostname $hostname
echo ${HOSTNAME} > ${ETC}/myname
${HOSTNAME_CMD} ${HOSTNAME}
default_value=`echo $hostname | sed -e 's/[^.]*\.//'`
DEFAULT_VALUE=`echo ${HOSTNAME} | sed -e 's/[^.]*\.//' | grep \.`
if network_dialog "What is the domain name of this host (Internet, not YP/NIS)?"; then
domain=$answer
DOMAIN=${ANSWER}
fi
default_value="$ipaddr"
if ! network_dialog "What is the IP address of this host?"; then return 1; fi
ipaddr=$answer
echo "$ipaddr $hostname `echo $hostname | sed -e 's/\.$domain//'`" >> /etc/hosts
DEFAULT_VALUE=${IPADDR}
if ! network_dialog "What is the IP address of this host?"; then return 1; fi
IPADDR=${ANSWER}
echo "${IPADDR} ${HOSTNAME} `echo ${HOSTNAME} | sed -e 's/\.${DOMAIN}//'`" >> ${ETC}/hosts
}
network_setup_ether()
{
dialog $clear --title "Ethernet Interface Name" \
--menu "Please select the type of ethernet interface you have:\n" \
-1 -1 7 \
dialog --title "Ethernet Interface Name" --menu \
"Please select the type of ethernet interface you have:\n" -1 -1 8 \
"ed0" "WD80x3, SMC, Novell NE[21]000 or 3C503 generic NIC at 0x280" \
"ed1" "Same as above, but at address 0x300 and IRQ 5" \
"ep0" "3COM 3C509 at address 0x300 and IRQ 10" \
"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" \
"le0" "DEC Etherworks ethernet adapter"
"ze0" "PCMCIA IBM or National card at 0x300 and IRQ 5" \
2> ${TMP}/menu.tmp.$$
retval=$?
interface=`cat ${TMP}/menu.tmp.$$`
RETVAL=$?
INTERFACE=`cat ${TMP}/menu.tmp.$$`
rm -f ${TMP}/menu.tmp.$$
if ! handle_rval $retval; then return 1; fi
if ! handle_rval ${RETVAL}; then return 1; fi
}
network_setup_slip()
network_setup_remote()
{
csave=$clear
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="${REMOTE_IPADDR}"
if ! network_dialog "What is the IP number for the remote host?"; then
return 1
fi
REMOTE_IPADDR=${ANSWER}
}
default_value=$serial_interface
if ! network_dialog "What is the name of the serial interface?"; then return 1; fi
serial_interface=$answer
network_setup_serial()
{
network_setup_remote
INTERFACE=$1
default_value=$serial_speed
if ! network_dialog "What speed is the serial interface?"; then return 1; fi
serial_speed=$answer
clear="$csave"
DEFAULT_VALUE=${SERIAL_INTERFACE}
if ! network_dialog "What serial port do you wish to use?"; then
return 1
fi
SERIAL_INTERFACE=${ANSWER}
if dialog $clear --title "Dial" --yesno "Do you need to dial the phone or otherwise talk to the modem?" -1 -1; then
DEFAULT_VALUE=${SERIAL_SPEED}
if ! network_dialog "What speed is the serial connection?"; then
return 1
fi
SERIAL_SPEED=${ANSWER}
if dialog --title "Dial" --yesno \
"Do you need to dial the phone or otherwise talk to the modem?" \
-1 -1; 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."
confirm \
"You may now dialog with your modem and set up the connection.
Be sure to disable DTR sensitivity (usually with AT&D0) or the
modem may hang up when you exit 'cu'. Use ~. to exit cu and
continue."
dialog --clear
# Grottyness to deal with a weird crunch bug.
if [ ! -f /stand/cu ]; then ln /stand/tip /stand/cu; fi
/stand/cu -l $serial_interface -s $serial_speed
/stand/cu -l ${SERIAL_INTERFACE} -s ${SERIAL_SPEED}
dialog --clear
fi
}
network_setup_plip()
{
default_value=""
if ! network_dialog "What is the IP number for the remote host?"; then return 1; fi
remote_hostip=$answer
interface=lp0
network_setup_remote
INTERFACE=lp0
}
network_setup()
{
done=0
while [ "$interface" = "" ]; do
dialog $clear --title "Set up network interface" \
--menu "Please select the type of network connection you have:\n" \
-1 -1 3 \
"ether" "A supported ethernet card" \
DONE=0
while [ "${INTERFACE}" = "" ]; do
dialog --title "Set up network interface" --menu \
"Please select the type of network connection you have:\n" \
-1 -1 4 \
"Ether" "A supported ethernet card" \
"SLIP" "A point-to-point SLIP (Serial Line IP) connection" \
"PPP" "A Point-To-Point-Protocol connection" \
"PLIP" "A Parallel-Line IP setup (with standard laplink cable)" \
2> ${TMP}/menu.tmp.$$
retval=$?
choice=`cat ${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 ! network_setup_ether; then continue; fi
;;
if ! handle_rval ${RETVAL}; then return 1; fi
case ${CHOICE} in
Ether) if ! network_setup_ether; then continue; fi ;;
SLIP) if ! network_setup_serial sl0; then continue; fi ;;
SLIP)
if ! network_setup_slip; then continue; fi
;;
PPP) if ! network_setup_serial ppp0; then continue; fi ;;
PLIP)
if ! network_setup_plip; then continue; fi
;;
esac
if [ "$interface" = "" ]; then continue; fi
PLIP) if ! network_setup_plip; then continue; fi ;;
esac
if [ "${INTERFACE}" = "" ]; then continue; fi
network_basic_setup
default_value="$netmask"
DEFAULT_VALUE="${NETMASK}"
if network_dialog "Please specify the netmask"; then
if [ "$answer" != "" ]; then
netmask=$answer
if [ "${ANSWER}" != "" ]; then
NETMASK=${ANSWER}
fi
fi
default_value=""
if network_dialog "Any extra flags to ifconfig?" ; then
ifconfig_flags=$answer
DEFAULT_VALUE=""
if network_dialog "Set 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=""
echo "Progress <${IFCONFIG_CMD} ${INTERFACE} ${IPADDR} ${REMOTE_IPADDR} netmask ${NETMASK} ${IFCONFIG_FLAGS}>" >/dev/ttyv1
if ! ${IFCONFIG_CMD} ${INTERFACE} ${IPADDR} ${REMOTE_IPADDR} 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
if [ "${INTERFACE}" = "sl0" ]; then
DEFAULT_VALUE=${SLATTACH_FLAGS}
if network_dialog "Set extra flags to ${SLATTACH_CMD}?"; then
SLATTACH_FLAGS=${ANSWER}
fi
${SLATTACH_CMD} ${SLATTACH_FLAGS} ${SERIAL_SPEED} ${SERIAL_INTERFACE}
progress ${SLATTACH_CMD} ${SLATTACH_FLAGS} ${SERIAL_SPEED} ${SERIAL_INTERFACE}
fi
echo "$ipaddr $remote_hostip netmask $netmask $ifconfig_flags" > /etc/hostname.$interface
default_value=""
if [ "${INTERFACE}" = "ppp0" ]; then
DEFAULT_VALUE=${PPPD_FLAGS}
if network_dialog "Set extra flags to ${PPPD}?"; then
PPPD_FLAGS=${ANSWER}
fi
${PPPD_CMD} ${PPPD_FLAGS} ${SERIAL_INTERFACE} ${SERIAL_SPEED} ${IPADDR}:${REMOTE_IPADDR}
progress ${PPPD_CMD} ${PPPD_FLAGS} ${SERIAL_INTERFACE} ${SERIAL_SPEED} ${IPADDR}:${REMOTE_IPADDR}
fi
echo "${IPADDR} ${REMOTE_IPADDR} 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
echo $gateway > /etc/defaultrouter
if [ "${ANSWER}" != "" ]; then
GATEWAY=${ANSWER}
${ROUTE_CMD} ${ROUTE_FLAGS} ${GATEWAY} > /dev/ttyv1 2>&1
progress ${ROUTE_CMD} ${ROUTE_FLAGS} ${GATEWAY}
echo ${GATEWAY} > ${ETC}/defaultrouter
fi
fi
default_value=""
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
if [ "${ANSWER}" != "" ]; then
NAMESERVER=${ANSWER}
echo "domain ${DOMAIN}" > ${ETC}/resolv.conf
echo "nameserver ${NAMESERVER}" >> ${ETC}/resolv.conf
fi
fi
done