1994-11-16 07:51:45 +00:00
|
|
|
#!/stand/sh
|
|
|
|
#
|
|
|
|
# instdist - Install a distribution from some sort of media.
|
|
|
|
#
|
|
|
|
# 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!).
|
|
|
|
#
|
1994-12-23 05:11:18 +00:00
|
|
|
# $Id: instdist.sh,v 1.46 1994/12/23 03:30:02 jkh Exp $
|
1994-11-16 07:51:45 +00:00
|
|
|
|
1994-11-28 22:13:07 +00:00
|
|
|
if [ "${_INSTINST_SH_LOADED_}" = "yes" ]; then
|
1994-11-16 07:51:45 +00:00
|
|
|
return 0
|
|
|
|
else
|
|
|
|
_INSTINST_SH_LOADED_=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Grab the miscellaneous functions.
|
1994-11-18 10:05:47 +00:00
|
|
|
. /stand/miscfuncs.sh
|
1994-11-16 07:51:45 +00:00
|
|
|
|
|
|
|
# Set the initial state for media installation.
|
1994-11-18 12:54:45 +00:00
|
|
|
media_set_defaults()
|
|
|
|
{
|
1994-11-28 22:13:07 +00:00
|
|
|
MEDIA_TYPE=""
|
|
|
|
MEDIA_DEVICE=""
|
1994-12-17 06:57:45 +00:00
|
|
|
MEDIA_DISTRIBUTIONS=""
|
1994-11-28 22:13:07 +00:00
|
|
|
DISTRIB_SUBDIR=""
|
|
|
|
TMPDIR="/usr/tmp"
|
|
|
|
FTP_PATH=""
|
|
|
|
NFS_PATH=""
|
1994-11-16 07:51:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Set the installation media to undefined.
|
|
|
|
media_reset()
|
|
|
|
{
|
1994-11-28 22:13:07 +00:00
|
|
|
MEDIA_DEVICE=""
|
|
|
|
MEDIA_TYPE=""
|
1994-12-17 06:57:45 +00:00
|
|
|
MEDIA_DISTRIBUTIONS=""
|
1994-11-28 22:13:07 +00:00
|
|
|
FTP_PATH=""
|
|
|
|
NFS_PATH=""
|
|
|
|
NFS_OPTIONS=""
|
1994-11-16 07:51:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Set the location of our temporary unpacking directory.
|
|
|
|
media_set_tmpdir()
|
|
|
|
{
|
1994-11-30 11:58:29 +00:00
|
|
|
TITLE="Choose temporary directory"
|
1994-11-28 22:13:07 +00:00
|
|
|
DEFAULT_VALUE="${TMPDIR}"
|
1994-11-16 07:51:45 +00:00
|
|
|
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 30MB 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
|
1994-11-21 04:35:26 +00:00
|
|
|
storage."; then return 1; fi
|
1994-11-28 22:13:07 +00:00
|
|
|
TMPDIR=${ANSWER}
|
|
|
|
mkdir -p ${TMPDIR}
|
1994-11-16 07:51:45 +00:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
media_cd_tmpdir()
|
|
|
|
{
|
1994-11-28 22:13:07 +00:00
|
|
|
if ! cd ${TMPDIR} > /dev/ttyv1 2>&1; then
|
|
|
|
error "No such file or directory for ${TMPDIR}, sorry! Please fix this and try again."
|
1994-11-16 07:51:45 +00:00
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
media_rm_tmpdir()
|
|
|
|
{
|
|
|
|
cd /
|
1994-12-04 03:41:18 +00:00
|
|
|
if [ -d ${TMPDIR}/${MEDIA_DISTRIBUTION} ]; then
|
|
|
|
if dialog --title "Delete contents?" --yesno \
|
|
|
|
"Do you wish to delete ${TMPDIR}/${MEDIA_DISTRIBUTION}?" -1 -1; then
|
|
|
|
rm -rf ${TMPDIR}/${MEDIA_DISTRIBUTION}
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if dialog --title "Delete contents?" --yesno \
|
|
|
|
"Do you wish to delete the contents of ${TMPDIR}?" -1 -1; then
|
|
|
|
rm -rf ${TMPDIR}/*
|
|
|
|
fi
|
1994-11-16 07:51:45 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
1994-11-17 11:53:14 +00:00
|
|
|
media_select_ftp_site()
|
|
|
|
{
|
1994-11-28 22:13:07 +00:00
|
|
|
dialog --title "Please specify an ftp site" --menu \
|
1994-11-20 15:18:56 +00:00
|
|
|
"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\
|
|
|
|
every possible distribution! Distributions other than the basic\n\
|
1994-12-17 06:57:45 +00:00
|
|
|
binary set are only guaranteed to be available from the Primary site.\n\
|
|
|
|
Please use arrow keys to scroll through all items." \
|
|
|
|
-1 -1 6 \
|
1994-12-21 04:57:07 +00:00
|
|
|
"Primary" "ftp.freebsd.org" \
|
1994-12-23 02:55:07 +00:00
|
|
|
"Australia" "ftp.physics.usyd.edu.au" \
|
1994-12-21 04:57:07 +00:00
|
|
|
"Finland" "nic.funet.fi" \
|
|
|
|
"France" "ftp.ibp.fr" \
|
|
|
|
"Germany" "ftp.uni-duisburg.de" \
|
|
|
|
"Israel" "orgchem.weizmann.ac.il" \
|
|
|
|
"Japan" "ftp.sra.co.jp" \
|
|
|
|
"Japan-2" "ftp.mei.co.jp" \
|
|
|
|
"Japan-3" "ftp.waseda.ac.jp" \
|
|
|
|
"Japan-4" "ftp.pu-toyama.ac.jp" \
|
|
|
|
"Japan-5" "ftpsv1.u-aizu.ac.jp" \
|
|
|
|
"Japan-6" "tutserver.tutcc.tut.ac.jp" \
|
|
|
|
"Japan-7" "ftp.ee.uec.ac.jp" \
|
|
|
|
"Netherlands" "ftp.nl.net" \
|
|
|
|
"Russia" "ftp.kiae.su" \
|
|
|
|
"Taiwan" "netbsd.csie.nctu.edu.tw" \
|
|
|
|
"UK" "ftp.demon.co.uk" \
|
|
|
|
"UK-2" "src.doc.ic.ac.uk" \
|
|
|
|
"UK-3" "unix.hensa.ac.uk" \
|
|
|
|
"USA" "ref.tfs.com" \
|
|
|
|
"USA-2" "ftp.dataplex.net" \
|
|
|
|
"USA-3" "kryten.atinc.com" \
|
|
|
|
"USA-4" "ftp.neosoft.com" \
|
1994-12-17 06:57:45 +00:00
|
|
|
"other" "None of the above. I want to specify my own." \
|
1994-11-17 11:53:14 +00:00
|
|
|
2> ${TMP}/menu.tmp.$$
|
1994-11-28 22:13:07 +00:00
|
|
|
RETVAL=$?
|
|
|
|
ANSWER=`cat ${TMP}/menu.tmp.$$`
|
1994-11-17 11:53:14 +00:00
|
|
|
rm -f ${TMP}/menu.tmp.$$
|
1994-11-28 22:13:07 +00:00
|
|
|
if ! handle_rval ${RETVAL}; then return 1; fi
|
1994-11-30 11:58:29 +00:00
|
|
|
case ${ANSWER} in
|
|
|
|
Primary) FTP_PATH="ftp://ftp.freebsd.org/pub/FreeBSD/${DISTNAME}" ;;
|
|
|
|
Australia) FTP_PATH="ftp://ftp.physics.usyd.edu.au/FreeBSD/${DISTNAME}" ;;
|
1994-12-05 00:40:25 +00:00
|
|
|
Finland) FTP_PATH="ftp://nic.funet.fi/pub/unix/FreeBSD/${DISTNAME}" ;;
|
1994-12-17 06:57:45 +00:00
|
|
|
France) FTP_PATH="ftp://ftp.ibp.fr/pub/FreeBSD/${DISTNAME}" ;;
|
|
|
|
Germany) FTP_PATH="ftp://ftp.uni-duisburg.de/pub/unix/FreeBSD/${DISTNAME}" ;;
|
|
|
|
Israel) FTP_PATH="ftp://orgchem.weizmann.ac.il/pub/FreeBSD-${DISTNAME}" ;;
|
1994-11-30 11:58:29 +00:00
|
|
|
Japan) FTP_PATH="ftp://ftp.sra.co.jp/pub/os/FreeBSD/distribution/${DISTNAME}" ;;
|
|
|
|
Japan-2) FTP_PATH="ftp://ftp.mei.co.jp/free/PC-UNIX/FreeBSD/${DISTNAME}" ;;
|
|
|
|
Japan-3) FTP_PATH="ftp://ftp.waseda.ac.jp/pub/FreeBSD/${DISTNAME}" ;;
|
|
|
|
Japan-4) FTP_PATH="ftp://ftp.pu-toyama.ac.jp/pub/FreeBSD/${DISTNAME}" ;;
|
|
|
|
Japan-5) FTP_PATH="ftp://ftpsv1.u-aizu.ac.jp/pub/os/FreeBSD/${DISTNAME}" ;;
|
1994-12-17 06:57:45 +00:00
|
|
|
Japan-6) FTP_PATH="ftp://tutserver.tutcc.tut.ac.jp/FreeBSD/FreeBSD-${DISTNAME}" ;;
|
|
|
|
Japan-7) FTP_PATH="ftp://ftp.ee.uec.ac.jp/pub/os/FreeBSD.other/FreeBSD-${DISTNAME}" ;;
|
|
|
|
Netherlands) FTP_PATH="ftp://ftp.nl.net/pub/os/FreeBSD/${DISTNAME}" ;;
|
1994-11-30 11:58:29 +00:00
|
|
|
Russia) FTP_PATH="ftp://ftp.kiae.su/FreeBSD/${DISTNAME}" ;;
|
1994-12-17 06:57:45 +00:00
|
|
|
Taiwan) FTP_PATH="ftp://netbsd.csie.nctu.edu.tw/pub/FreeBSD/${DISTNAME}" ;;
|
|
|
|
UK) FTP_PATH="ftp://ftp.demon.co.uk/pub/BSD/FreeBSD/${DISTNAME}" ;;
|
|
|
|
UK-2) FTP_PATH="ftp://src.doc.ic.ac.uk/packages/unix/FreeBSD/${DISTNAME}" ;;
|
|
|
|
UK-3) FTP_PATH="ftp://unix.hensa.ac.uk/pub/walnut.creek/FreeBSD/${DISTNAME}" ;;
|
|
|
|
USA) FTP_PATH="ftp://ref.tfs.com/pub/FreeBSD/${DISTNAME}" ;;
|
|
|
|
USA-2) FTP_PATH="ftp://ftp.dataplex.net/pub/FreeBSD/${DISTNAME}" ;;
|
|
|
|
USA-3) FTP_PATH="ftp://kryten.atinc.com/pub/FreeBSD/${DISTNAME}" ;;
|
|
|
|
USA-4) FTP_PATH="ftp://ftp.neosoft.com/systems/FreeBSD/${DISTNAME}" ;;
|
1994-11-30 11:58:29 +00:00
|
|
|
other)
|
|
|
|
TITLE="FTP Installation Information"
|
|
|
|
DEFAULT_VALUE="${FTP_PATH}"
|
|
|
|
if ! input \
|
1994-11-17 11:53:14 +00:00
|
|
|
"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\"
|
1994-11-21 04:35:26 +00:00
|
|
|
the files yourself."; then return 1; fi
|
1994-11-30 11:58:29 +00:00
|
|
|
FTP_PATH=${ANSWER}
|
|
|
|
;;
|
|
|
|
esac
|
1994-11-17 11:53:14 +00:00
|
|
|
}
|
|
|
|
|
1994-11-16 07:51:45 +00:00
|
|
|
media_extract_dist()
|
|
|
|
{
|
1994-12-23 05:11:18 +00:00
|
|
|
if [ ! -f do_cksum.sh ]; then
|
|
|
|
if [ -f ${MEDIA_DISTRIBUTION}/do_cksum.sh ]; then
|
|
|
|
cd ${MEDIA_DISTRIBUTION}
|
|
|
|
fi
|
|
|
|
fi
|
1994-11-17 15:20:04 +00:00
|
|
|
if [ -f do_cksum.sh ]; then
|
|
|
|
message "Verifying checksums for distribution. Please wait!"
|
|
|
|
if sh ./do_cksum.sh; then
|
|
|
|
if [ -f extract.sh ]; then
|
1994-11-28 22:13:07 +00:00
|
|
|
message "Extracting ${MEDIA_DISTRIBUTION} distribution. Please wait!"
|
1994-12-01 13:46:13 +00:00
|
|
|
if [ -f ./is_interactive ]; then
|
1994-11-28 22:13:07 +00:00
|
|
|
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
|
1994-11-17 15:20:04 +00:00
|
|
|
else
|
|
|
|
error "No installation script found!"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
error "Checksum error(s) found. Please check media!"
|
|
|
|
fi
|
1994-11-16 07:51:45 +00:00
|
|
|
else
|
1994-11-17 15:20:04 +00:00
|
|
|
error "Improper distribution. No checksum script found!"
|
1994-11-30 11:58:29 +00:00
|
|
|
media_reset
|
1994-11-16 07:51:45 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
media_install_set()
|
|
|
|
{
|
1994-12-21 04:57:07 +00:00
|
|
|
# check to see if we already have it
|
|
|
|
if [ -f ${TMPDIR}/${MEDIA_DISTRIBUTION}/extract.sh ]; then
|
|
|
|
cd ${TMPDIR}/${MEDIA_DISTRIBUTION}
|
|
|
|
media_extract_dist
|
|
|
|
cd /
|
|
|
|
return
|
|
|
|
fi
|
1994-11-28 22:13:07 +00:00
|
|
|
case ${MEDIA_TYPE} in
|
1994-11-16 07:51:45 +00:00
|
|
|
cdrom|nfs|ufs|doshd)
|
1994-11-28 22:13:07 +00:00
|
|
|
if ! cd ${MEDIA_DEVICE}/${MEDIA_DISTRIBUTION} > /dev/ttyv1 2>&1; then
|
|
|
|
error "Unable to cd to ${MEDIA_DEVICE}/${MEDIA_DISTRIBUTION} directory."
|
1994-11-21 07:25:27 +00:00
|
|
|
media_reset
|
1994-11-21 05:36:01 +00:00
|
|
|
else
|
|
|
|
media_extract_dist
|
|
|
|
cd /
|
|
|
|
fi
|
1994-11-16 07:51:45 +00:00
|
|
|
return
|
|
|
|
;;
|
|
|
|
|
|
|
|
tape)
|
|
|
|
if ! media_set_tmpdir; then return; fi
|
|
|
|
if ! media_cd_tmpdir; then return; fi
|
1994-12-04 03:41:18 +00:00
|
|
|
if dialog --title "Please mount tape for ${MEDIA_DEVICE}." \
|
|
|
|
--yesno "Please enter the next tape and select\n<Yes> to continue or <No> if finished" -1 -1; then
|
|
|
|
message "Loading distribution from ${MEDIA_DEVICE}.\nUse ALT-F2 to see output, ALT-F1 to return."
|
|
|
|
if [ "${MEDIA_DEVICE}" = "ftape" ]; then
|
|
|
|
progress "${FT_CMD} | ${TAR_CMD} ${TAR_FLAGS} -"
|
|
|
|
${FT_CMD} | ${TAR_CMD} ${TAR_FLAGS} - > /dev/ttyv1 2>&1
|
|
|
|
else
|
|
|
|
progress "${TAR_CMD} ${TAR_FLAGS} ${MEDIA_DEVICE}"
|
|
|
|
${TAR_CMD} ${TAR_FLAGS} ${MEDIA_DEVICE} > /dev/ttyv1 2>&1
|
|
|
|
fi
|
1994-11-16 07:51:45 +00:00
|
|
|
fi
|
1994-12-01 20:11:52 +00:00
|
|
|
if [ -d ${MEDIA_DISTRIBUTION} ]; then cd ${MEDIA_DISTRIBUTION}; fi
|
1994-11-16 07:51:45 +00:00
|
|
|
media_extract_dist
|
|
|
|
media_rm_tmpdir
|
|
|
|
;;
|
|
|
|
|
|
|
|
dosfd)
|
|
|
|
if ! media_set_tmpdir; then return; fi
|
|
|
|
if ! media_cd_tmpdir; then return; fi
|
1994-11-28 22:13:07 +00:00
|
|
|
COPYING="yes"
|
|
|
|
progress "Preparing to extract from DOS floppies"
|
|
|
|
while [ "${COPYING}" = "yes" ]; do
|
|
|
|
progress "Asking for DOS diskette"
|
1994-11-16 07:51:45 +00:00
|
|
|
if dialog --title "Insert distribution diskette" \
|
1994-12-02 15:36:45 +00:00
|
|
|
--yesno "Please enter the next diskette and select\n<Yes> to continue or <No> if finished" -1 -1; then
|
1994-11-21 05:36:01 +00:00
|
|
|
umount ${MNT} > /dev/null 2>&1
|
1994-12-04 03:41:18 +00:00
|
|
|
if ! mount_msdos -o ro ${MEDIA_DEVICE} ${MNT}; then
|
1994-11-16 07:51:45 +00:00
|
|
|
error "Unable to mount floppy! Please correct."
|
|
|
|
else
|
1994-12-04 03:41:18 +00:00
|
|
|
message "Loading distribution from ${MEDIA_DEVICE}.\nUse ALT-F2 to see output, ALT-F1 to return."
|
1994-11-28 22:13:07 +00:00
|
|
|
( ${TAR_CMD} -cf - -C ${MNT} . | ${TAR_CMD} -xvf - ) >/dev/ttyv1 2>&1
|
1994-11-16 07:51:45 +00:00
|
|
|
umount ${MNT}
|
|
|
|
fi
|
|
|
|
else
|
1994-11-28 22:13:07 +00:00
|
|
|
COPYING="no"
|
1994-11-16 07:51:45 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
media_extract_dist
|
|
|
|
media_rm_tmpdir
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
|
|
|
|
ftp)
|
|
|
|
if ! media_set_tmpdir; then return; fi
|
|
|
|
if ! media_cd_tmpdir; then return; fi
|
1994-11-28 22:13:07 +00:00
|
|
|
if ! echo ${MEDIA_DEVICE} | grep -q -v 'ftp://'; then
|
1994-11-18 19:09:33 +00:00
|
|
|
message "Fetching distribution using ncftp.\nUse ALT-F2 to see output, ALT-F1 to return."
|
1994-11-28 22:13:07 +00:00
|
|
|
if ! ncftp ${MEDIA_DEVICE}/${MEDIA_DISTRIBUTION}/* < /dev/null > /dev/ttyv1 2>&1; then
|
|
|
|
error "Couldn't fetch ${MEDIA_DISTRIBUTION} distribution from\n${MEDIA_DEVICE}!"
|
1994-11-16 07:51:45 +00:00
|
|
|
else
|
|
|
|
media_extract_dist
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
dialog --clear
|
1994-11-28 22:13:07 +00:00
|
|
|
ftp ${MEDIA_DEVICE}
|
1994-11-16 07:51:45 +00:00
|
|
|
dialog --clear
|
|
|
|
media_extract_dist
|
|
|
|
fi
|
|
|
|
media_rm_tmpdir
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
media_select_distribution()
|
|
|
|
{
|
1994-12-17 06:57:45 +00:00
|
|
|
MEDIA_DISTRIBUTIONS=""
|
|
|
|
while [ "${MEDIA_DISTRIBUTIONS}" = "" ]; do
|
1994-11-16 07:51:45 +00:00
|
|
|
|
1994-11-28 22:13:07 +00:00
|
|
|
dialog --title "Please specify a distribution to load" \
|
1994-12-17 06:57:45 +00:00
|
|
|
--checklist \
|
1994-11-21 04:47:28 +00:00
|
|
|
"FreeBSD is separated into a number of distributions for ease of\n\
|
|
|
|
installation. With repeated passes through this screen, you'll be\n\
|
|
|
|
given the chance to load one or all of them. Mandatory distributions\n\
|
|
|
|
MUST be loaded! Please also note that the secrdist is NOT FOR EXPORT\n\
|
|
|
|
from the U.S. Please don't endanger U.S. ftp sites by getting it\n\
|
|
|
|
illegally, thanks! When finished, select <Cancel>." \
|
1994-11-21 07:25:27 +00:00
|
|
|
-1 -1 10 \
|
1994-12-17 06:57:45 +00:00
|
|
|
"?diskfree" "How much disk space do I have free?" OFF \
|
|
|
|
"bindist" "Binary base files (mandatory - ${BINSIZE})" ON \
|
|
|
|
"games" "Games and other frivolities (optional - ${GAMESIZE})" OFF \
|
|
|
|
"manpages" "Manual pages (optional - ${MANSIZE})" OFF \
|
|
|
|
"proflibs" "Profiled libraries (optional - ${PROFSIZE})" OFF \
|
|
|
|
"dict" "Spelling checker dictionary files (optional - ${DICTSIZE})" OFF \
|
|
|
|
"srcdist" "Sources for everything but DES (optional - ${SRCSIZE})" OFF \
|
|
|
|
"secrdist" "DES encryption code (and sources) (optional - ${SECRSIZE})" OFF \
|
|
|
|
"compat1xdist" "FreeBSD 1.x binary compatability (optional - ${COMPATSIZE})" OFF \
|
|
|
|
"XFree86-3.1" "The XFree86 3.1 distribution (optional - ${X11SIZE})" OFF \
|
1994-11-16 07:51:45 +00:00
|
|
|
2> ${TMP}/menu.tmp.$$
|
1994-11-28 22:13:07 +00:00
|
|
|
RETVAL=$?
|
1994-12-17 06:57:45 +00:00
|
|
|
MEDIA_DISTRIBUTIONS=`cat ${TMP}/menu.tmp.$$`
|
1994-11-16 07:51:45 +00:00
|
|
|
rm -f ${TMP}/menu.tmp.$$
|
1994-11-28 22:13:07 +00:00
|
|
|
if ! handle_rval ${RETVAL}; then return 1; fi
|
1994-12-21 04:57:07 +00:00
|
|
|
if [ "${MEDIA_DISTRIBUTIONS}" = "?diskfree" ]; then
|
|
|
|
if df -k > ${TMP}/df.out; then
|
|
|
|
dialog --title "How much free space do I have?" \
|
|
|
|
--textbox ${TMP}/df.out 15 76
|
1994-11-16 07:51:45 +00:00
|
|
|
else
|
|
|
|
error "Couldn't get disk usage information! :-("
|
|
|
|
fi
|
1994-12-21 04:57:07 +00:00
|
|
|
MEDIA_DISTRIBUTIONS=""
|
|
|
|
fi
|
1994-12-17 06:57:45 +00:00
|
|
|
done
|
1994-11-16 07:51:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
media_get_possible_subdir()
|
|
|
|
{
|
1994-11-28 22:13:07 +00:00
|
|
|
if [ -f ${MNT}/${MEDIA_DISTRIBUTION}/extract.sh ]; then return; fi
|
|
|
|
DEFAULT_VALUE="${DISTRIB_SUBDIR}"
|
|
|
|
TITLE="Distribution Subdirectory"
|
1994-11-16 07:51:45 +00:00
|
|
|
if input \
|
|
|
|
"If the distributions are in a subdirectory of the mount point,
|
|
|
|
please enter it here (no leading slash - it should be relative
|
1994-11-21 04:35:26 +00:00
|
|
|
to the mount point). The directory you enter should be the
|
|
|
|
*parent* directory of any distribution subdirectories."; then
|
1994-11-28 22:13:07 +00:00
|
|
|
if [ "${ANSWER}" != "" ]; then
|
|
|
|
MEDIA_DEVICE=${MEDIA_DEVICE}/${ANSWER}
|
|
|
|
DISTRIB_SUBDIR=${ANSWER}
|
1994-11-16 07:51:45 +00:00
|
|
|
fi
|
1994-11-30 11:58:29 +00:00
|
|
|
else
|
|
|
|
return 1
|
1994-11-16 07:51:45 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
1994-11-28 22:13:07 +00:00
|
|
|
# Get values into $MEDIA_TYPE and $MEDIA_DEVICE. Call network initialization
|
1994-11-16 07:51:45 +00:00
|
|
|
# if necessary.
|
1994-11-18 12:54:45 +00:00
|
|
|
media_chose()
|
|
|
|
{
|
1994-11-28 22:13:07 +00:00
|
|
|
while [ "${MEDIA_DEVICE}" = "" ]; do
|
1994-11-16 07:51:45 +00:00
|
|
|
|
1994-11-28 22:13:07 +00:00
|
|
|
dialog --title "Installation From" \
|
1994-11-18 16:27:54 +00:00
|
|
|
--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\
|
|
|
|
If none of the listed options works for you, then your best bet may be to\n\
|
1994-12-21 04:57:07 +00:00
|
|
|
simply press ESC twice to get a subshell and proceed manually on your own.\n\
|
1994-11-18 16:27:54 +00:00
|
|
|
If you are already finished with the installation process, select cancel\n\
|
1994-11-21 04:35:26 +00:00
|
|
|
to proceed." -1 -1 7 \
|
1994-11-16 07:51:45 +00:00
|
|
|
"?Kern" "Please show me the kernel boot messages again!" \
|
1994-12-04 03:41:18 +00:00
|
|
|
"Tape" "Load distribution from SCSI, QIC-02 or floppy tape" \
|
1994-11-16 07:51:45 +00:00
|
|
|
"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.$$
|
1994-11-28 22:13:07 +00:00
|
|
|
RETVAL=$?
|
|
|
|
CHOICE=`cat ${TMP}/menu.tmp.$$`
|
1994-11-16 07:51:45 +00:00
|
|
|
rm -f ${TMP}/menu.tmp.$$
|
1994-11-28 22:13:07 +00:00
|
|
|
if ! handle_rval ${RETVAL}; then return 1; fi
|
1994-11-16 07:51:45 +00:00
|
|
|
|
1994-11-28 22:13:07 +00:00
|
|
|
case ${CHOICE} in
|
1994-11-16 07:51:45 +00:00
|
|
|
?Kern)
|
|
|
|
if dmesg > ${TMP}/dmesg.out; then
|
1994-11-28 22:13:07 +00:00
|
|
|
dialog --title "Kernel boot message output" \
|
|
|
|
--textbox ${TMP}/dmesg.out 22 76
|
1994-11-16 07:51:45 +00:00
|
|
|
else
|
|
|
|
error "Couldn't get dmesg information! :-("
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
Tape)
|
1994-11-30 11:58:29 +00:00
|
|
|
dialog --title "Choose Tape Type" --menu \
|
1994-11-28 22:13:07 +00:00
|
|
|
"Which type of tape drive do you have attached to your \n\
|
1994-11-21 04:35:26 +00:00
|
|
|
system? FreeBSD supports the following types:\n" -1 -1 3 \
|
1994-11-16 07:51:45 +00:00
|
|
|
"SCSI" "SCSI tape drive attached to supported SCSI controller" \
|
1994-12-04 03:41:18 +00:00
|
|
|
"QIC-02" "QIC-02 tape drive (Colorado Jumbo, etc)" \
|
|
|
|
"floppy" "Floppy tape drive (QIC-40/QIC-80)" 2> ${TMP}/menu.tmp.$$
|
1994-11-28 22:13:07 +00:00
|
|
|
RETVAL=$?
|
|
|
|
CHOICE=`cat ${TMP}/menu.tmp.$$`
|
1994-11-16 07:51:45 +00:00
|
|
|
rm -f ${TMP}/menu.tmp.$$
|
1994-11-28 22:13:07 +00:00
|
|
|
if ! handle_rval ${RETVAL}; then continue; fi
|
|
|
|
MEDIA_TYPE=tape;
|
|
|
|
case ${CHOICE} in
|
1994-11-16 07:51:45 +00:00
|
|
|
SCSI)
|
1994-12-21 04:57:07 +00:00
|
|
|
DEFAULT_VALUE="/dev/rst0"
|
|
|
|
TITLE="SCSI Tape Device"
|
|
|
|
if input \
|
|
|
|
"If you only have one tape drive, simply press return - the
|
|
|
|
default value should be correct. Otherwise, enter the
|
|
|
|
correct value and press return."; then
|
1994-12-23 03:30:02 +00:00
|
|
|
MEDIA_DEVICE=${ANSWER}
|
|
|
|
fi
|
1994-11-16 07:51:45 +00:00
|
|
|
;;
|
1994-11-28 22:13:07 +00:00
|
|
|
|
1994-12-04 03:41:18 +00:00
|
|
|
QIC-02)
|
1994-12-21 04:57:07 +00:00
|
|
|
DEFAULT_VALUE="/dev/rwt0"
|
|
|
|
TITLE="QIC-02 Tape Device"
|
|
|
|
if input \
|
|
|
|
"If you only have one tape drive, simply press return - the
|
|
|
|
default value should be correct. Otherwise, enter the
|
|
|
|
correct value and press return."; then
|
1994-12-23 03:30:02 +00:00
|
|
|
MEDIA_DEVICE=${ANSWER}
|
|
|
|
fi
|
1994-11-16 07:51:45 +00:00
|
|
|
;;
|
1994-11-28 22:13:07 +00:00
|
|
|
|
1994-11-16 07:51:45 +00:00
|
|
|
floppy)
|
1994-11-28 22:13:07 +00:00
|
|
|
MEDIA_DEVICE=ftape
|
1994-11-16 07:51:45 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
|
|
|
CDROM)
|
1994-11-30 11:58:29 +00:00
|
|
|
dialog --title "Choose CDROM Type" --menu \
|
1994-11-28 22:13:07 +00:00
|
|
|
"Which type of CDROM drive do you have attached to your \n\
|
1994-11-21 04:35:26 +00:00
|
|
|
system? FreeBSD supports the following types:\n" -1 -1 2 \
|
1994-11-16 07:51:45 +00:00
|
|
|
"SCSI" "SCSI CDROM drive attached to supported SCSI controller" \
|
|
|
|
"Mitsumi" "Mitsumi CDROM drive" \
|
|
|
|
2> ${TMP}/menu.tmp.$$
|
1994-11-28 22:13:07 +00:00
|
|
|
RETVAL=$?
|
|
|
|
CHOICE=`cat ${TMP}/menu.tmp.$$`
|
1994-11-16 07:51:45 +00:00
|
|
|
rm -f ${TMP}/menu.tmp.$$
|
1994-11-28 22:13:07 +00:00
|
|
|
if ! handle_rval ${RETVAL}; then continue; fi
|
|
|
|
MEDIA_TYPE=cdrom;
|
|
|
|
case ${CHOICE} in
|
1994-11-16 07:51:45 +00:00
|
|
|
SCSI)
|
1994-11-28 22:13:07 +00:00
|
|
|
MEDIA_DEVICE=/dev/cd0a
|
1994-11-16 07:51:45 +00:00
|
|
|
;;
|
1994-12-21 04:57:07 +00:00
|
|
|
|
1994-11-16 07:51:45 +00:00
|
|
|
Mitsumi)
|
1994-11-28 22:13:07 +00:00
|
|
|
MEDIA_DEVICE=/dev/mcd0a
|
1994-11-16 07:51:45 +00:00
|
|
|
;;
|
|
|
|
esac
|
1994-11-21 05:36:01 +00:00
|
|
|
umount ${MNT} > /dev/null 2>&1
|
1994-11-28 22:13:07 +00:00
|
|
|
if ! mount_cd9660 ${MEDIA_DEVICE} ${MNT} > /dev/ttyv1 2>&1; then
|
|
|
|
error "Unable to mount ${MEDIA_DEVICE} on ${MNT}"
|
|
|
|
MEDIA_DEVICE=""
|
1994-11-16 07:51:45 +00:00
|
|
|
else
|
1994-11-28 22:13:07 +00:00
|
|
|
MEDIA_DEVICE=${MNT}
|
1994-11-16 07:51:45 +00:00
|
|
|
media_get_possible_subdir
|
1994-12-01 13:46:13 +00:00
|
|
|
return 0
|
1994-11-16 07:51:45 +00:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
DOS)
|
1994-11-28 22:13:07 +00:00
|
|
|
DEFAULT_VALUE="/dev/fd0"
|
1994-11-16 07:51:45 +00:00
|
|
|
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
|
1994-11-21 04:35:26 +00:00
|
|
|
drive it's /dev/fd1\n"; then
|
1994-11-28 22:13:07 +00:00
|
|
|
MEDIA_DEVICE=${ANSWER}
|
|
|
|
if echo ${MEDIA_DEVICE} | grep -q -v fd; then
|
1994-11-21 05:36:01 +00:00
|
|
|
umount ${MNT} > /dev/null 2>&1
|
1994-11-28 22:13:07 +00:00
|
|
|
if ! mount_msdos ${MEDIA_DEVICE} ${MNT} > /dev/ttyv1 2>&1; then
|
|
|
|
error "Unable to mount ${MEDIA_DEVICE}"
|
|
|
|
MEDIA_DEVICE=""
|
1994-11-16 07:51:45 +00:00
|
|
|
else
|
1994-11-28 22:13:07 +00:00
|
|
|
MEDIA_TYPE=doshd
|
|
|
|
MEDIA_DEVICE=${MNT}
|
1994-11-16 07:51:45 +00:00
|
|
|
media_get_possible_subdir
|
1994-12-01 13:46:13 +00:00
|
|
|
return 0
|
1994-11-16 07:51:45 +00:00
|
|
|
fi
|
|
|
|
else
|
1994-11-28 22:13:07 +00:00
|
|
|
MEDIA_TYPE=dosfd
|
1994-12-01 13:46:13 +00:00
|
|
|
return 0
|
1994-11-16 07:51:45 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
FTP)
|
1994-11-17 11:53:14 +00:00
|
|
|
if ! network_setup; then continue; fi
|
|
|
|
if media_select_ftp_site; then
|
1994-11-28 22:13:07 +00:00
|
|
|
MEDIA_TYPE=ftp
|
|
|
|
MEDIA_DEVICE=${FTP_PATH}
|
1994-12-01 13:46:13 +00:00
|
|
|
return 0
|
1994-11-17 11:53:14 +00:00
|
|
|
fi
|
1994-11-16 07:51:45 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
NFS)
|
1994-11-17 11:53:14 +00:00
|
|
|
if ! network_setup; then continue; fi
|
1994-11-28 22:13:07 +00:00
|
|
|
TITLE="NFS Installation Information"
|
|
|
|
DEFAULT_VALUE="${NFS_PATH}"
|
1994-11-16 07:51:45 +00:00
|
|
|
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)
|
1994-11-21 04:35:26 +00:00
|
|
|
for this to work!\n"; then continue; fi
|
1994-11-28 22:13:07 +00:00
|
|
|
NFS_PATH=${ANSWER}
|
1994-11-23 10:52:30 +00:00
|
|
|
|
1994-11-28 22:13:07 +00:00
|
|
|
DEFAULT_VALUE="${NFS_OPTIONS}"
|
1994-11-17 14:18:02 +00:00
|
|
|
if input \
|
|
|
|
"Do you wish to specify any options to NFS? If you're installing
|
1994-11-30 11:58:29 +00:00
|
|
|
from a Sun 4.1.x system, you may wish to specify \`-o resvport' to send
|
1994-11-23 11:04:00 +00:00
|
|
|
NFS requests over a privileged port (use this if you get nasty
|
|
|
|
\`\`credential too weak'' errors from the server). When using a slow
|
1994-11-30 11:58:29 +00:00
|
|
|
ethernet card or network link, \`-o -r=1024,-w=1024' may also prove helpful.
|
1994-11-17 14:18:02 +00:00
|
|
|
Options, if any, should be separated by commas."; then
|
1994-11-28 22:13:07 +00:00
|
|
|
if [ "${ANSWER}" != "" ]; then
|
|
|
|
NFS_OPTIONS="${ANSWER}"
|
1994-11-18 16:48:57 +00:00
|
|
|
fi
|
1994-11-17 14:18:02 +00:00
|
|
|
fi
|
1994-11-28 22:13:07 +00:00
|
|
|
MEDIA_TYPE=nfs
|
1994-11-21 05:36:01 +00:00
|
|
|
umount ${MNT} > /dev/null 2>&1
|
1994-11-28 22:13:07 +00:00
|
|
|
if ! mount_nfs ${NFS_OPTIONS} ${NFS_PATH} ${MNT} > /dev/ttyv1 2>&1; then
|
|
|
|
error "Unable to mount ${NFS_PATH}"
|
1994-11-16 07:51:45 +00:00
|
|
|
else
|
1994-11-28 22:13:07 +00:00
|
|
|
message "${NFS_PATH} mounted successfully"
|
|
|
|
MEDIA_DEVICE=${MNT}
|
1994-11-16 07:51:45 +00:00
|
|
|
media_get_possible_subdir
|
1994-12-01 13:46:13 +00:00
|
|
|
return 0
|
1994-11-16 07:51:45 +00:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
UFS)
|
1994-11-28 22:13:07 +00:00
|
|
|
dialog --title "User Intervention Requested" --msgbox "
|
1994-11-16 07:51:45 +00:00
|
|
|
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
|
1994-11-28 22:13:07 +00:00
|
|
|
of the distribution's parent directory when we come back." -1 -1
|
1994-11-16 07:51:45 +00:00
|
|
|
dialog --clear
|
|
|
|
/stand/sh
|
1994-11-28 22:13:07 +00:00
|
|
|
TITLE="Please enter directory"
|
|
|
|
DEFAULT_VALUE="${MNT}"
|
1994-11-24 20:52:16 +00:00
|
|
|
if input "Ok, now give me the full pathname of the parent directorys for the distribution(s)."; then
|
1994-11-28 22:13:07 +00:00
|
|
|
MEDIA_TYPE=ufs
|
|
|
|
MEDIA_DEVICE=${ANSWER}
|
1994-12-01 13:46:13 +00:00
|
|
|
return 0
|
1994-11-16 07:51:45 +00:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|