1994-02-21 21:52:00 +00:00
|
|
|
|
#!bin/sh
|
1994-06-29 20:29:12 +00:00
|
|
|
|
# $Id: cpio.magic,v 1.12 1994/06/28 07:20:30 jkh Exp $
|
1994-02-21 21:52:00 +00:00
|
|
|
|
#
|
|
|
|
|
set_tmp_dir()
|
|
|
|
|
{
|
|
|
|
|
def_tmp_dir=`pwd`
|
|
|
|
|
[ "$def_tmp_dir" = "/" ] && def_tmp_dir=/usr/distrib
|
1994-02-25 23:34:14 +00:00
|
|
|
|
echo -n "Where do we ${1:-put} the distrbution files? [${def_tmp_dir}] "
|
1994-02-21 21:52:00 +00:00
|
|
|
|
read tmp_dir
|
|
|
|
|
[ ! "$tmp_dir" ] && tmp_dir=$def_tmp_dir
|
|
|
|
|
if [ ! -d "$tmp_dir" ]; then
|
|
|
|
|
/bin/rm -rf $tmp_dir
|
|
|
|
|
mkdir -p $tmp_dir
|
|
|
|
|
fi
|
|
|
|
|
echo
|
|
|
|
|
}
|
|
|
|
|
tmp_dir()
|
|
|
|
|
{
|
|
|
|
|
if [ "$tmp_dir" = "" ]; then
|
1994-02-25 23:34:14 +00:00
|
|
|
|
set_tmp_dir $1
|
1994-02-21 21:52:00 +00:00
|
|
|
|
fi
|
|
|
|
|
cd $tmp_dir
|
|
|
|
|
}
|
|
|
|
|
load_fd()
|
|
|
|
|
{
|
|
|
|
|
tmp_dir
|
|
|
|
|
drive=
|
|
|
|
|
altdrive=
|
|
|
|
|
subdir=
|
|
|
|
|
while [ -z "$drive" ]; do
|
|
|
|
|
echo -n "Read from which drive (or ? for help)? [c] "
|
|
|
|
|
read answer junk
|
|
|
|
|
case "${answer:-c}" in
|
|
|
|
|
a*b|A*B)
|
|
|
|
|
drive=A; altdrive=B
|
|
|
|
|
;;
|
|
|
|
|
b*a|B*A)
|
|
|
|
|
drive=B; altdrive=A
|
|
|
|
|
;;
|
|
|
|
|
a*|A*)
|
|
|
|
|
drive=A; altdrive=A
|
|
|
|
|
;;
|
|
|
|
|
b*|B*)
|
|
|
|
|
drive=B; altdrive=B
|
|
|
|
|
;;
|
|
|
|
|
c*|C*)
|
|
|
|
|
while read data; do
|
|
|
|
|
msdos_device=`expr X"$data" : 'X[ ]*\([^ ]*\)[^M]*pcfs'`
|
|
|
|
|
msdos_dir=`expr X"$data" : 'X[ ]*[^ ]*[ ]*\([^ ]*\)'`
|
|
|
|
|
[ "${msdos_device}" ] && break
|
|
|
|
|
done </etc/fstab
|
|
|
|
|
if [ ! "$msdos_device" ]; then
|
|
|
|
|
echo
|
|
|
|
|
echo "Cannot find MS-DOS in filesystem table"
|
|
|
|
|
continue
|
|
|
|
|
fi
|
|
|
|
|
drive=C; altdrive=C
|
|
|
|
|
while :; do
|
|
|
|
|
echo
|
|
|
|
|
echo -n "Read from which MS-DOS drive C: directory? [/] "
|
|
|
|
|
read resp junk
|
|
|
|
|
newdir=$(echo "${resp:-/}" | \
|
|
|
|
|
awk '{ sub(/^[Cc]*:*/, ""); gsub(/\\/, "/"); gsub(/^\/*/, ""); gsub(/\/*$/, ""); print $0 }')
|
|
|
|
|
if [ -d ${msdos_dir}/${newdir} ]; then
|
|
|
|
|
subdir=$newdir
|
|
|
|
|
break
|
|
|
|
|
else
|
|
|
|
|
echo "C:/${newdir}: No such directory"
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
;;
|
|
|
|
|
q*|Q*)
|
|
|
|
|
drive=q
|
|
|
|
|
;;
|
|
|
|
|
\?*)
|
|
|
|
|
echo
|
|
|
|
|
echo "Enter: To:"
|
|
|
|
|
echo "------ ---"
|
|
|
|
|
echo " a Read from floppy drive A:"
|
|
|
|
|
echo " b Read from floppy drive B:"
|
|
|
|
|
echo " c Read from MS-DOS hard drive C:"
|
|
|
|
|
echo " ab Alternate between A: and B:, starting with A:"
|
|
|
|
|
echo " ba Alternate between A: and B:, starting with B:"
|
|
|
|
|
echo " q Quit"
|
|
|
|
|
echo
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
verbose=-v
|
|
|
|
|
interactive=-i
|
|
|
|
|
if [ "$drive" = "C" ]; then
|
|
|
|
|
dir=${msdos_dir}
|
|
|
|
|
elif [ "$drive" != "q" ]; then
|
|
|
|
|
dir=/tmp/floppy
|
|
|
|
|
[ -d $dir ] && umount $dir >/dev/null 2>&1
|
|
|
|
|
[ -f $dir ] && rm -f $dir
|
|
|
|
|
mkdir -p $dir
|
|
|
|
|
fi
|
|
|
|
|
while [ "$drive" != "q" ]
|
|
|
|
|
do
|
|
|
|
|
device=/dev/fd0
|
|
|
|
|
[ "$drive" = "B" ] && device=/dev/fd1
|
|
|
|
|
[ "$drive" = "C" ] && device=${msdos_device}
|
|
|
|
|
echo;
|
|
|
|
|
if [ "$drive" != "C" ]; then
|
|
|
|
|
echo "Insert floppy in drive $drive:, then press RETURN to copy files,"
|
1994-06-15 21:04:04 +00:00
|
|
|
|
echo -n "or enter option (? for help): "
|
1994-02-21 21:52:00 +00:00
|
|
|
|
else
|
|
|
|
|
echo -n "Press RETURN to copy files, or enter option (? for help): "
|
|
|
|
|
fi
|
|
|
|
|
read answer junk
|
|
|
|
|
case "${answer:-g}" in
|
|
|
|
|
c*|C*)
|
|
|
|
|
if [ "$drive" != "C" ]; then
|
|
|
|
|
echo "Cannot change directory: not reading from MS-DOS drive C:"
|
|
|
|
|
else
|
|
|
|
|
echo
|
|
|
|
|
echo -n "Read from which MS-DOS drive C: directory? [/${subdir}] "
|
|
|
|
|
read resp junk
|
|
|
|
|
[ ! "$resp" ] && resp="/$subdir"
|
|
|
|
|
absolute=`expr X"$resp" : 'X[Cc]*:*\([/\]\)'`
|
|
|
|
|
subsub=$(echo "${resp}" | \
|
|
|
|
|
awk '{ sub(/^[Cc]*:*/, ""); gsub(/\\/, "/"); gsub(/^\/*/, ""); gsub(/\/*$/, ""); print $0 }')
|
|
|
|
|
if [ "$absolute" -o ! "$subdir" ]; then
|
|
|
|
|
newsub=$subsub
|
|
|
|
|
else
|
|
|
|
|
newsub=$subdir/$subsub
|
|
|
|
|
fi
|
|
|
|
|
if [ -d ${dir}/${newsub} ]; then
|
|
|
|
|
subdir=$newsub
|
|
|
|
|
else
|
|
|
|
|
echo "C:/${newsub}: No such directory"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
g*|G*)
|
|
|
|
|
sync
|
|
|
|
|
if [ "$drive" = "C" ]; then
|
|
|
|
|
[ "$verbose" ] &&
|
|
|
|
|
{ echo; echo "Copying files from MS-DOS C:/${subdir}"; }
|
|
|
|
|
cp ${msdos_dir}/${subdir}/* .
|
|
|
|
|
sync
|
|
|
|
|
elif mount -t pcfs $verbose $device $dir; then
|
|
|
|
|
[ "$verbose" ] &&
|
|
|
|
|
{ echo; echo "Copying files to disk..."; }
|
|
|
|
|
cp $interactive $dir/* .
|
|
|
|
|
sync
|
|
|
|
|
umount $dir
|
|
|
|
|
tmp=$drive; drive=$altdrive; altdrive=$tmp
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
i*|I*)
|
|
|
|
|
tmp=$interactive; interactive=; [ -z "$tmp" ] && interactive=-i
|
|
|
|
|
tmp=on; [ -z "$interactive" ] && tmp=off
|
|
|
|
|
echo "interactive mode is $tmp"
|
|
|
|
|
;;
|
|
|
|
|
l*|L*)
|
|
|
|
|
sync
|
|
|
|
|
[ "$verbose" ] && echo "Directory of ${drive}:/${subdir}"
|
|
|
|
|
if [ "$drive" = "C" ]; then
|
|
|
|
|
ls -l $dir/${subdir}
|
|
|
|
|
else
|
|
|
|
|
umount $dir >/dev/null 2>&1
|
|
|
|
|
if mount -t pcfs $device $dir; then
|
|
|
|
|
ls -l $dir/${subdir}
|
|
|
|
|
umount $dir
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
o*|O*)
|
|
|
|
|
tmp=$drive; drive=$altdrive; altdrive=$tmp
|
|
|
|
|
;;
|
|
|
|
|
q*|Q*)
|
|
|
|
|
drive=q
|
|
|
|
|
;;
|
|
|
|
|
s*|S*)
|
|
|
|
|
echo; echo -n "tmp_dir is set to $tmp_dir"
|
|
|
|
|
[ "$tmp_dir" != "`pwd`" ] && echo -n " (physically `pwd`)"
|
|
|
|
|
echo; echo "Free space in tmp_dir:"
|
|
|
|
|
df -k .
|
|
|
|
|
echo -n "Reading from drive $drive:"
|
|
|
|
|
[ "$drive" != "$altdrive" ] && echo -n " and drive $altdrive:"
|
|
|
|
|
echo
|
|
|
|
|
tmp=on; [ -z "$verbose" ] && tmp=off
|
|
|
|
|
echo "Verbose mode is $tmp"
|
|
|
|
|
tmp=on; [ -z "$interactive" ] && tmp=off
|
|
|
|
|
echo "Interactive mode is $tmp"
|
|
|
|
|
;;
|
|
|
|
|
v*|V*)
|
|
|
|
|
tmp=$verbose; verbose=; [ -z "$tmp" ] && verbose=-v
|
|
|
|
|
tmp=on; [ -z "$verbose" ] && tmp=off
|
|
|
|
|
echo "verbose mode is $tmp"
|
|
|
|
|
;;
|
|
|
|
|
\?)
|
|
|
|
|
echo
|
|
|
|
|
echo "Enter: To:"
|
|
|
|
|
echo "----- ---"
|
|
|
|
|
echo "(just RETURN) Copy files from ${drive}:/${subdir} to $tmp_dir"
|
|
|
|
|
echo " c Change directory of MS-DOS drive C:"
|
|
|
|
|
echo " i Toggle interactive mode (cp -i)"
|
|
|
|
|
echo " l List directory of current drive"
|
|
|
|
|
echo " o Read from alternate floppy drive"
|
|
|
|
|
echo " q Quit"
|
|
|
|
|
echo " s Show status"
|
|
|
|
|
echo " v Toggle verbose mode"
|
|
|
|
|
echo
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
echo "Working directory: `pwd`"
|
|
|
|
|
unset verbose answer drive altdrive device dir subdir tmp interactive
|
|
|
|
|
}
|
1994-02-25 23:34:14 +00:00
|
|
|
|
load_dos()
|
|
|
|
|
{
|
|
|
|
|
load_fd
|
|
|
|
|
}
|
1994-02-21 21:52:00 +00:00
|
|
|
|
load_qic_tape()
|
|
|
|
|
{
|
|
|
|
|
tmp_dir
|
|
|
|
|
echo -n "Insert tape into QIC tape drive and hit return to continue: "
|
|
|
|
|
read foo
|
1994-06-28 07:20:30 +00:00
|
|
|
|
tar --unlink -xvf /dev/rwt0
|
1994-02-21 21:52:00 +00:00
|
|
|
|
}
|
|
|
|
|
load_scsi_tape()
|
|
|
|
|
{
|
|
|
|
|
tmp_dir
|
|
|
|
|
echo -n "Insert tape into SCSI tape drive and hit return to continue: "
|
|
|
|
|
read foo
|
1994-06-28 07:20:30 +00:00
|
|
|
|
tar --unlink -xvf /dev/nrst0
|
1994-02-21 21:52:00 +00:00
|
|
|
|
}
|
|
|
|
|
extract()
|
|
|
|
|
{
|
1994-02-25 23:34:14 +00:00
|
|
|
|
[ X"$1" = X"" ] && { echo "usage: extract dist-prefix"; return; }
|
|
|
|
|
tmp_dir find
|
1994-02-21 21:52:00 +00:00
|
|
|
|
echo -n "Would you like to be verbose about this? [n] "
|
|
|
|
|
read verbose
|
|
|
|
|
case $verbose in
|
|
|
|
|
y*|Y*)
|
|
|
|
|
tarverbose=--verbose
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
tarverbose=
|
|
|
|
|
;;
|
|
|
|
|
esac
|
1994-06-29 20:29:12 +00:00
|
|
|
|
#XXX ugly hacks to get around busy text files/symlink problems.
|
|
|
|
|
if [ X"$1" = X"bin" ]; then
|
|
|
|
|
rm -f /bin/sh.$$ /sbin/init.$$ /etc/termcap.$$
|
|
|
|
|
mv /bin/sh /bin/sh.$$
|
|
|
|
|
mv /sbin/init /sbin/init.$$
|
|
|
|
|
mv /etc/termcap /etc/termcap.$$
|
|
|
|
|
fi
|
|
|
|
|
if [ X"$1" = X"des" ]; then
|
|
|
|
|
rm -f /sbin/init.$$
|
|
|
|
|
mv /sbin/init /sbin/init.$$
|
|
|
|
|
fi
|
1994-02-21 21:52:00 +00:00
|
|
|
|
for i in $*; do
|
1994-06-28 07:20:30 +00:00
|
|
|
|
cat "$i"* |
|
|
|
|
|
gunzip |
|
|
|
|
|
(cd / ; tar --unlink --extract --file - --preserve-permissions ${tarverbose} )
|
1994-02-21 21:52:00 +00:00
|
|
|
|
done
|
|
|
|
|
sync
|
1994-02-25 23:34:14 +00:00
|
|
|
|
[ X"$1" = X"bin" ] && echo "Run \`configure' to complete installation."
|
|
|
|
|
echo "(wd is now: `pwd`)"
|
1994-02-21 21:52:00 +00:00
|
|
|
|
}
|
|
|
|
|
configure()
|
|
|
|
|
{
|
|
|
|
|
echo "You will now be prompted for information about this"
|
|
|
|
|
echo "machine. If you hit return, the default answer (in"
|
|
|
|
|
echo "brackets) will be used."
|
|
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
echo -n "What is this machine's hostname? [unknown.host.domain] "
|
|
|
|
|
read hname
|
|
|
|
|
|
|
|
|
|
if [ "$hname" = "" ]; then
|
|
|
|
|
hname=unknown.host.domain
|
|
|
|
|
fi
|
|
|
|
|
echo $hname > /etc/myname
|
|
|
|
|
proto_domain=`echo $hname | sed -e 's/[^.]*\.//'`
|
|
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
echo "What domain is this machine in (this is NOT its YP"
|
|
|
|
|
echo -n "domain name)? [$proto_domain] "
|
|
|
|
|
read dname
|
|
|
|
|
|
|
|
|
|
if [ "$dname" = "" ]; then
|
|
|
|
|
dname=$proto_domain
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
echo -n "Does this machine have an ethernet interface? [y] "
|
|
|
|
|
read resp
|
|
|
|
|
case "$resp" in
|
|
|
|
|
n*)
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
intf=
|
|
|
|
|
while [ "$intf" = "" ]; do
|
1994-03-18 03:09:51 +00:00
|
|
|
|
echo -n "What is the primary interface name (i.e. ed0, etc.)? "
|
1994-02-21 21:52:00 +00:00
|
|
|
|
read intf
|
|
|
|
|
done
|
|
|
|
|
echo -n "What is the hostname for this interface? [$hname] "
|
|
|
|
|
read ifname
|
|
|
|
|
if [ "$ifname" = "" ]; then
|
|
|
|
|
ifname=$hname
|
|
|
|
|
fi
|
|
|
|
|
ifaddr=
|
|
|
|
|
while [ "$ifaddr" = "" ]; do
|
|
|
|
|
echo -n "What is the IP address associated with this interface? "
|
|
|
|
|
read ifaddr
|
|
|
|
|
done
|
|
|
|
|
echo "$ifaddr $ifname `echo $ifname | sed -e s/\.$dname//`" \
|
|
|
|
|
>> /etc/hosts
|
|
|
|
|
|
|
|
|
|
echo -n "Does this interface have a special netmask? [n] "
|
|
|
|
|
read resp
|
|
|
|
|
case "$resp" in
|
|
|
|
|
y*)
|
|
|
|
|
echo -n "What is the netmask? [0xffffff00] "
|
1994-04-26 23:26:18 +00:00
|
|
|
|
read resp
|
|
|
|
|
if [ "$resp" = "" ]; then
|
|
|
|
|
ifnetmask="netmask 0xffffff00"
|
|
|
|
|
else
|
|
|
|
|
ifnetmask="netmask $resp"
|
1994-02-21 21:52:00 +00:00
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
ifnetmask=
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
echo -n "Does this interface need additional flags? [n] "
|
|
|
|
|
read resp
|
|
|
|
|
case "$resp" in
|
|
|
|
|
y*)
|
|
|
|
|
echo -n "What flags? [llc0] "
|
|
|
|
|
read ifflags
|
|
|
|
|
if [ "$ifflags" = "" ]; then
|
|
|
|
|
ifflags=llc0
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
ifflags=
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
1994-04-26 23:26:18 +00:00
|
|
|
|
echo "inet $ifname $ifnetmask $ifflags" > /etc/hostname.$intf
|
1994-02-21 21:52:00 +00:00
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "WARNING: if you have any more ethernet interfaces, you"
|
|
|
|
|
echo "will have to configure them by hand. Read the comments"
|
|
|
|
|
echo "in /etc/netstart to learn how to do this"
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
1994-06-11 12:42:35 +00:00
|
|
|
|
echo
|
1994-06-12 11:05:04 +00:00
|
|
|
|
echo "Setting up access to a nameserver:"
|
|
|
|
|
echo -n "Do you want to configure /etc/resolv.conf? [n]: "
|
1994-06-11 12:42:35 +00:00
|
|
|
|
read resp
|
|
|
|
|
case "$resp" in
|
|
|
|
|
y*)
|
|
|
|
|
echo "OK: Configuring your /etc/resolv.conf"
|
1994-06-12 11:05:04 +00:00
|
|
|
|
echo "If you need more information about resolv.conf"
|
|
|
|
|
echo "type \"man 5 resolver\" once you have COMPLETED"
|
|
|
|
|
echo "installation of the binary distribution."
|
1994-06-11 12:42:35 +00:00
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
|
|
nameserver=
|
|
|
|
|
while [ "$nameserver" = "" ]; do
|
|
|
|
|
echo -n "Enter the IP number of your nameserver: "
|
|
|
|
|
read nameserver
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
echo "nameserver $nameserver" > /etc/resolv.conf
|
|
|
|
|
|
|
|
|
|
echo " "
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
1994-02-21 21:52:00 +00:00
|
|
|
|
sync
|
|
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
echo "OK. You should be completely set up now."
|
|
|
|
|
echo "You should now reboot your machine by issuing the 'reboot' command"
|
|
|
|
|
echo "after removing anything that happens to be in your floppy drive."
|
|
|
|
|
}
|