Major hackery to get the 1.1 Beta floppies building. Have a special

pair of crunched binaries that are not built by this, but other than
that it is back to an automated procedure.  So many changes it is
hard to describe.
This commit is contained in:
Rodney W. Grimes 1994-02-21 21:52:00 +00:00
parent c8d1c78f59
commit 64eb68b1e5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=1194
8 changed files with 1005 additions and 58 deletions

View File

@ -39,38 +39,63 @@ MDEC= usr/mdec/bootfd usr/mdec/fdboot
MDEC+= usr/mdec/bootsd usr/mdec/sdboot
MDEC+= usr/mdec/bootwd usr/mdec/wdboot
#
KC_DIRS= dev mnt
KC_DIRS= dev mnt bin sbin
KC_FILES= ${COPYRIGHT}
KC_FILES+= bin/[ bin/cp bin/echo bin/sh bin/test
KC_FILES+= sbin/fsck sbin/halt sbin/init sbin/mount sbin/umount
KC_FILES+= bin/sh # XXX Crunch is broken!
KC_LINKS= bin/[ bin/cp bin/echo bin/test
KC_LINKS+= sbin/fsck sbin/halt sbin/init sbin/mount sbin/umount
#
FILESYSTEM_DIRS= bin dev etc mnt sbin usr usr/bin usr/mdec usr/sbin
FILESYSTEM_DIRS= bin dev etc mnt proc sbin usr usr/bin usr/mdec usr/sbin
FILESYSTEM_TREES= dev
FILESYSTEM_FILES= ${COPYRIGHT}
FILESYSTEM_FILES+= bin/[ bin/expr bin/ls bin/mkdir bin/rm
FILESYSTEM_FILES+= bin/sh bin/sync bin/test
FILESYSTEM_FILES+= bin/sh # XXX Crunch is broken!
FILESYSTEM_FILES+= dev/MAKEDEV
FILESYSTEM_FILES+= etc/group
FILESYSTEM_FILES+= etc/master.passwd etc/passwd etc/pwd.db
FILESYSTEM_FILES+= sbin/disklabel sbin/halt sbin/init
FILESYSTEM_FILES+= sbin/mount sbin/mount_pcfs
FILESYSTEM_FILES+= sbin/newfs
FILESYSTEM_FILES+= sbin/umount
FILESYSTEM_FILES+= sbin/fdisk
FILESYSTEM_FILES+= usr/bin/cpio
FILESYSTEM_FILES+= ${MDEC}
FILESYSTEM_FILES+= usr/sbin/bad144
FILESYSTEM_LINKS= bin/[ bin/expr bin/ls bin/mkdir bin/rm
FILESYSTEM_LINKS+= bin/sync bin/test
FILESYSTEM_LINKS+= sbin/disklabel sbin/fdisk sbin/halt sbin/init
FILESYSTEM_LINKS+= sbin/mount sbin/mount_pcfs
FILESYSTEM_LINKS+= sbin/newfs
FILESYSTEM_LINKS+= sbin/umount
FILESYSTEM_LINKS+= usr/bin/cpio
FILESYSTEM_LINKS+= usr/bin/gunzip usr/bin/gzcat usr/bin/gzip usr/bin/zcat
FILESYSTEM_LINKS+= usr/sbin/bad144
FILESYSTEM_CPIO= .profile
FILESYSTEM_CPIO+= root/.profile
FILESYSTEM_CPIO+= bin/[
FILESYSTEM_CPIO+= bin/chmod bin/cat bin/cp bin/df bin/expr bin/ls
FILESYSTEM_CPIO+= bin/ln bin/mkdir bin/mv bin/rm bin/sync
FILESYSTEM_CPIO+= bin/test
FILESYSTEM_CPIO+= etc/spwd.db
FILESYSTEM_CPIO+= sbin/disklabel sbin/fdisk sbin/halt sbin/init
FILESYSTEM_CPIO+= sbin/mount sbin/mount_pcfs
FILESYSTEM_CPIO+= sbin/newfs
FILESYSTEM_CPIO+= sbin/umount
CPIO_FILES= ${COPYRIGHT}
CPIO_FILES+= usr/bin/gunzip usr/bin/gzcat usr/bin/gzip usr/bin/zcat
CPIO_CPIO= bin/chmod bin/cat bin/cp bin/dd bin/df bin/mv bin/pwd bin/stty
CPIO_CPIO+= etc/protocols etc/remote etc/services etc/spwd.db
CPIO_CPIO= bin/dd bin/ps bin/pwd bin/stty
CPIO_CPIO+= etc/protocols etc/remote etc/services
CPIO_CPIO+= etc/termcap
CPIO_CPIO+= sbin/dmesg
CPIO_CPIO+= sbin/ifconfig sbin/fsck sbin/mknod sbin/mount_isofs
CPIO_CPIO+= sbin/mount_procfs
CPIO_CPIO+= sbin/reboot sbin/route sbin/slattach
CPIO_CPIO+= usr/bin/awk usr/bin/chgrp usr/bin/ftp
CPIO_CPIO+= usr/bin/awk usr/bin/chgrp usr/bin/cpio usr/bin/ex usr/bin/ftp
CPIO_CPIO+= usr/bin/gunzip usr/bin/gzcat usr/bin/gzip
CPIO_CPIO+= usr/bin/more usr/bin/tar usr/bin/tip
CPIO_CPIO+= usr/bin/elvis usr/bin/ex usr/bin/vi usr/bin/view
CPIO_CPIO+= usr/sbin/update usr/sbin/chown
CPIO_CPIO+= usr/bin/vi usr/bin/view usr/bin/zcat
CPIO_CPIO+= usr/libexec/ld.so
CPIO_CPIO+= usr/lib/libc.so.1.0
CPIO_CPIO+= usr/lib/libcurses.so.1.0
CPIO_CPIO+= usr/lib/libgcc.so.1.0
CPIO_CPIO+= usr/lib/libm.so.1.0
CPIO_CPIO+= usr/lib/libtermlib.so.1.0
CPIO_CPIO+= usr/lib/libtermcap.so.1.0
CPIO_CPIO+= usr/lib/libutil.so.1.0
CPIO_CPIO+= usr/sbin/bad144 usr/sbin/chown
CPIO_CPIO+= usr/share/misc/termcap
CPIO_CPIO_DIRS= tmp var var/tmp var/run var/spool var/spool/lock
CRYPT_LIB= lib/libcrypt
@ -207,6 +232,12 @@ kcopy-floppy:
ls ${KC_FILES} | cpio -pdamuv ${MOUNT})
install -c -o root -g wheel -m 755 etc.i386/kc.profile \
${MOUNT}/.profile
install -c -o root -g wheel -m 755 ${RELEASEDIR}/distbin/kcopy \
${MOUNT}/bin/kcopy
(cd ${MOUNT}/; \
for i in ${KC_LINKS}; do \
ln bin/kcopy $$i; \
done)
kcopy-ah-floppy:
${MAKE} kcopy-floppy
@ -248,13 +279,23 @@ filesystem-floppy:
sh ${DESTDIR}/dev/MAKEDEV fd0 fd1 wd0 sd0 sd1; \
rm -f fd0?* fd1?* rfd0?* rfd1?*)
(cd ${DESTDIR}/; \
ls ${FILESYSTEM_FILES} | cpio -pdamuv ${MOUNT})
ls ${FILESYSTEM_FILES} | cpio -pdamuv ${MOUNT}; \
ls ${FILESYSTEM_CPIO} | \
cpio -H newc --block-size=16 -oav | \
gzip -9 >${MOUNT}/inst1.cpio.gz)
install -c -o root -g wheel -m 755 etc.i386/inst1.profile \
${MOUNT}/.profile
install -c -o root -g wheel -m 755 etc.i386/inst1.install \
${MOUNT}/install
install -c -o root -g wheel -m 755 ${RELEASEDIR}/distbin/filesystem \
${MOUNT}/bin/filesystem
(cd ${MOUNT}/; \
for i in ${FILESYSTEM_LINKS}; do \
ln bin/filesystem $$i; \
done)
(cd ${MOUNT}/; \
ls ${FILESYSTEM_FILES} >/tmp/filelist; \
ls ${FILESYSTEM_LINKS} >>/tmp/filelist; \
ls -d ${FILESYSTEM_DIRS} >>/tmp/filelist; \
find ${FILESYSTEM_TREES} >>/tmp/filelist; \
sort -u /tmp/filelist >filelist; \
@ -279,11 +320,14 @@ cpio-floppy:
ls ${CPIO_FILES} | cpio -pdamuv ${MOUNT})
(cd ${DESTDIR}/; \
(find ${CPIO_CPIO}; ls -d ${CPIO_CPIO_DIRS}) | \
cpio -oav | gzip -9 >${MOUNT}/inst2.cpio.gz)
install -c -o root -g wheel -m 755 etc.i386/inst2.profile \
${MOUNT}/.profile
install -c -o root -g wheel -m 755 etc.i386/inst2.install \
cpio -H newc --block-size=16 -oav | \
gzip -9 >${MOUNT}/inst2.cpio.gz)
install -c -o root -g wheel -m 755 etc.i386/cpio.rc \
${MOUNT}/rc
install -c -o root -g wheel -m 755 etc.i386/cpio.install \
${MOUNT}/install
install -c -o root -g wheel -m 755 etc.i386/cpio.magic \
${MOUNT}/magic
df -ik ${MOUNT}
umount /dev/${FLOPPY}
fsck /dev/r${FLOPPY}

20
etc/etc.i386/cpio.install Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh
#
# $Id$
#
echo
echo -n "Copying to disk... "
cd /
gunzip < mnt/inst2.cpio.gz | cpio -idmu
cd /mnt
echo -n "Copying more to disk... "
ls install magic | cpio -pdmu /
echo -n "Copying even more to disk... "
ls rc | cpio -pdmu /etc
echo -n "Building /dev files... "
cd /dev
sh MAKEDEV all
cd /
echo "done."
sync

347
etc/etc.i386/cpio.magic Normal file
View File

@ -0,0 +1,347 @@
#!bin/sh
# $Id$
#
set_tmp_dir()
{
def_tmp_dir=`pwd`
[ "$def_tmp_dir" = "/" ] && def_tmp_dir=/usr/distrib
echo -n "Copy files to which directory? [${def_tmp_dir}] "
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
set_tmp_dir
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,"
echo -n "or enter option (? for help): "
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
}
load_qic_tape()
{
tmp_dir
echo -n "Insert tape into QIC tape drive and hit return to continue: "
read foo
tar xvf /dev/rwt0
}
load_scsi_tape()
{
tmp_dir
echo -n "Insert tape into SCSI tape drive and hit return to continue: "
read foo
tar xvf /dev/nrst0
}
extract()
{
tmp_dir
echo -n "Would you like to be verbose about this? [n] "
read verbose
case $verbose in
y*|Y*)
tarverbose=--verbose
;;
*)
tarverbose=
;;
esac
#XXX ugly hack to eliminate busy files, copy them to /tmp and use them
#from there...
cp -p /bin/cat /usr/bin/gunzip /usr/bin/tar /tmp
for i in $*; do
/tmp/cat "$i"* |
/tmp/gunzip |
(cd / ; /tmp/tar --extract --file - --preserve-permissions ${tarverbose} )
done
rm -f /tmp/cat /tmp/gunzip /tmp/tar
sync
}
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
echo -n "What is the primary interface name (i.e. we0, etc.)? "
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] "
read ifnetmask
if [ "$ifnetmask" = "" ]; then
ifnetmask=0xffffff00
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
echo "inet $ifname netmask $ifnetmask $ifflags" > /etc/hostname.$intf
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
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."
}

92
etc/etc.i386/cpio.rc Normal file
View File

@ -0,0 +1,92 @@
# $Id$
#
stty status '^T'
trap : 2
trap : 3
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/distbin; export PATH
if [ -e /fastboot ]
then
echo Fast boot ... skipping disk checks
else
echo Automatic reboot in progress...
fsck -p
case $? in
0)
;;
2)
exit 1
;;
4)
echo; echo README README README README README README README
echo
echo "NOTE: The above errors are expected if this is the"
echo "first time you have booted from the hard disk after"
echo "completing the floppy install"; echo
echo "Automatic file system check changed the root file system"
echo "The system must halt for these corrections to take effect"
echo
reboot
echo "reboot failed... help!"
exit 1
;;
8)
echo "Automatic file system check failed... help!"
exit 1
;;
12)
echo "Reboot interrupted"
exit 1
;;
130)
exit 1
;;
*)
echo "Unknown error in reboot"
exit 1
;;
esac
fi
trap 2
trap "echo 'Reboot interrupted'; exit 1" 3
umount -a >/dev/null 2>&1
mount -a -t nonfs
rm -f /fastboot
(cd /var/run && { rm -rf -- *; cp /dev/null utmp; chmod 644 utmp; })
OPSYSTEM=FreeBSD
RELEASE="1.1"
echo "${OPSYSTEM} Base System Release ${RELEASE}"
echo ""
echo "Congratulations, you've got ${OPSYSTEM} on the hard disk!"
echo
echo "Press the return key for more installation instructions"
read junkit
echo
echo "To finish installation:"
echo "Pick a temporary directory by running set_tmp_dir. Make sure it's"
echo "in a place with lots of space, probably under /usr."
echo "Then, load the remaining distribution files into that temporary"
echo "directory by issuing one of the following commands:"
echo
echo " load_fd load_qic_tape load_scsi_tape"
echo
echo "or by fetching the files with ftp (see the installation notes for"
echo "information on how to do that)."
echo
echo "Once this is complete, extract the distribution files by issuing the"
echo "command 'extract <distribution>' where <distribution> is the base name"
echo "of the distribution files, e.g. 'base10'."
echo
echo "Once all of the filesets you wish to install have been extracted,"
echo "enter the command 'configure' to finish setting up the system"
echo " "
echo "If you should wish to uninstall ${OPSYSTEM}, delete the partition by using the"
echo "DOS 5 FDISK program. If installed on the entire drive, use the FDISK/MBR"
echo "to remove the ${OPSYSTEM} bootstrap from the drive."
echo 'erase ^?, werase ^H, kill ^U, intr ^C'
stty newcrt werase  intr  kill  erase  9600
umask 0
echo ". /magic" >>/.profile
exit 1

View File

@ -385,6 +385,8 @@ fi
}
echo
echo
echo "Welcome to ${OPSYSTEM}."
echo
echo "This program is designed to help put ${OPSYSTEM} on a hard disk with"
@ -482,7 +484,7 @@ echo
echo "Disk is of device type $drivetype."
if [ ! "$partition" ]; then
echo
echo "Please wait. Examining device /dev/r${drivename}d..."
echo "Examining device /dev/r${drivename}d..."
get_fdisk_data
if [ $? -gt 1 ]; then
echo "Hm - we can't seem to read that drive."
@ -861,6 +863,7 @@ echo y |
echo " done."
# XXX - Do it again, incase we disklabeled sector 0!
# XXX - this is not working for some reason, need to look at it closer!
put_fdisk_data
if [ "$sect_fwd" = "sf:" ]; then
@ -917,19 +920,15 @@ if [ "$hname" != "" ]; then
fi
echo
echo "Please wait. Copying to disk..."
echo -n "Copying to disk... "
cd /
# cat filelist | cpio -pdamu${cpioverbose} /mnt
OIFS=$IFS
IFS='
'
while read data; do
echo $data
done <filelist | cpio -pdamu${cpioverbose} /mnt
IFS=$OIFS
cpio -pdamu${cpioverbose} /mnt <filelist
echo -n "Copying more to disk... "
cd /mnt
echo "proc /proc procfs rw 0 0" >etc/fstab
gzcat < /inst1.cpio.gz | cpio -idmu
echo -n "Building /etc/fstab... "
echo "proc /proc procfs rw 0 0" >etc/fstab
echo "/dev/${drivename}b none swap sw 0 0" >>etc/fstab
echo "/dev/${drivename}a / ufs rw 1 1" >>etc/fstab
if [ "$ename" != "" ]; then
@ -945,7 +944,7 @@ if [ "$hname" != "" ]; then
if [ ! "$have_dos_part" ]; then
echo "/dev/${drivename}h /$hname ufs rw 1 5" >>etc/fstab
else
echo "/dev/${drivename}h /$hname pcfs rw 0 0" >>etc/fstab
echo "/dev/${drivename}h /$hname pcfs ro 0 0" >>etc/fstab
fi
fi
@ -957,10 +956,11 @@ while read data; do
echo $data
done </etc/disktab >etc/disktab.install
IFS=$OIFS
echo "done."
# cat << EOF >.profile
echo -n "Building /etc/rc... "
(
echo "PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/distbin:.:"
echo "PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/distbin:"
echo "export PATH"
echo "HOME=/root"
echo "export HOME"
@ -968,6 +968,7 @@ echo "TERM=pc3"
echo "export TERM"
echo "mount -at ufs"
echo "echo"
echo "echo"
echo "echo \"Insert cpio installation floppy in drive and\""
echo "echo -n \"enter that drive's number (0 or 1): [0] \""
echo "read resp junk"
@ -1003,7 +1004,9 @@ echo "echo"
echo "echo \"Enter 'halt' now at the prompt to halt the machine.\""
echo "echo \"After the machine has halted, remove the floppy from the disk\""
echo "echo \"drive, and hit any key to reboot from the hard disk.\""
) >.profile
echo "exit 1"
) >etc/rc
echo "done."
sync
@ -1019,6 +1022,9 @@ echo "floppy this time, just hit RETURN without changing floppies."
echo
echo "If all goes well, you can enter the command \`copy' at the prompt to"
echo "copy the kernel to the hard disk. When asked for which partition to"
echo "copy to, enter to \`${drivename}a' (without the quotes)."
echo "copy to, enter \`${drivename}a' (without the quotes)."
echo
echo "Okay, that's all for now. I'm waiting for you to enter \`halt'..."
sync;sync;sync;sync

View File

@ -1,7 +1,9 @@
# $Id$
#
PATH=/sbin:/usr/sbin:/bin:/usr/bin:.:
export PATH
HOME=/root
export HOME
TERM=pc3
export TERM
install
/install

439
etc/etc.i386/inst2.rc Normal file
View File

@ -0,0 +1,439 @@
# $Id$
#
stty status '^T'
trap : 2
trap : 3
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/distbin; export PATH
echo
echo
if [ -e /fastboot ]
then
echo Fast boot ... skipping disk checks
else
echo Automatic reboot in progress...
fsck -p
case $? in
0)
;;
2)
exit 1
;;
4)
echo; echo README README README README README README README
echo
echo "NOTE: The above errors are expected if this is the"
echo "first time you have booted from the hard disk after"
echo "completing the floppy install"; echo
echo "Automatic file system check changed the root file system"
echo "The system must halt for these corrections to take effect"
echo
reboot
echo "reboot failed... help!"
exit 1
;;
8)
echo "Automatic file system check failed... help!"
exit 1
;;
12)
echo "Reboot interrupted"
exit 1
;;
130)
exit 1
;;
*)
echo "Unknown error in reboot"
exit 1
;;
esac
fi
trap 2
trap "echo 'Reboot interrupted'; exit 1" 3
umount -a >/dev/null 2>&1
mount -a -t nonfs
rm -f /fastboot
(cd /var/run && { rm -rf -- *; cp /dev/null utmp; chmod 644 utmp; })
OPSYSTEM=FreeBSD
RELEASE="1.1"
echo "${OPSYSTEM} Base System Release ${RELEASE}"
echo ""
echo "Congratulations, you've got ${OPSYSTEM} on the hard disk!"
echo
echo "Press the return key for more installation instructions"
read junkit
echo
echo "To finish installation:"
echo "Pick a temporary directory by running set_tmp_dir. Make sure it's"
echo "in a place with lots of space, probably under /usr."
echo "Then, load the remaining distribution files into that temporary"
echo "directory by issuing one of the following commands:"
echo
echo " load_fd load_qic_tape load_scsi_tape"
echo
echo "or by fetching the files with ftp (see the installation notes for"
echo "information on how to do that)."
echo
echo "Once this is complete, extract the distribution files by issuing the"
echo "command 'extract <distribution>' where <distribution> is the base name"
echo "of the distribution files, e.g. 'base10'."
echo
echo "Once all of the filesets you wish to install have been extracted,"
echo "enter the command 'configure' to finish setting up the system"
echo " "
echo "If you should wish to uninstall ${OPSYSTEM}, delete the partition by using the"
echo "DOS 5 FDISK program. If installed on the entire drive, use the FDISK/MBR"
echo "to remove the ${OPSYSTEM} bootstrap from the drive."
echo 'erase ^?, werase ^H, kill ^U, intr ^C'
stty newcrt werase  intr  kill  erase  9600
umask 0
exit 1
set_tmp_dir()
{
def_tmp_dir=`pwd`
[ "$def_tmp_dir" = "/" ] && def_tmp_dir=/usr/distrib
echo -n "Copy files to which directory? [${def_tmp_dir}] "
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
set_tmp_dir
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,"
echo -n "or enter option (? for help): "
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
}
load_qic_tape()
{
tmp_dir
echo -n "Insert tape into QIC tape drive and hit return to continue: "
read foo
tar xvf /dev/rwt0
}
load_scsi_tape()
{
tmp_dir
echo -n "Insert tape into SCSI tape drive and hit return to continue: "
read foo
tar xvf /dev/nrst0
}
extract()
{
tmp_dir
echo -n "Would you like to be verbose about this? [n] "
read verbose
case $verbose in
y*|Y*)
tarverbose=--verbose
;;
*)
tarverbose=
;;
esac
#XXX ugly hack to eliminate busy files, copy them to /tmp and use them
#from there...
cp -p /bin/cat /usr/bin/gunzip /usr/bin/tar /tmp
for i in $*; do
/tmp/cat "$i"* |
/tmp/gunzip |
(cd / ; /tmp/tar --extract --file - --preserve-permissions ${tarverbose} )
done
rm -f /tmp/cat /tmp/gunzip /tmp/tar
sync
}
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
echo -n "What is the primary interface name (i.e. we0, etc.)? "
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] "
read ifnetmask
if [ "$ifnetmask" = "" ]; then
ifnetmask=0xffffff00
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
echo "inet $ifname netmask $ifnetmask $ifflags" > /etc/hostname.$intf
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
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."
}

View File

@ -1,4 +1,4 @@
# $Header
# $Id$
#
# rc for kernel distribution floppy
@ -8,10 +8,7 @@ export PATH
reboot_it() {
echo ""
echo "halting the machine..."
halt
sync
sync
echo "Halt failed! Try power-cycling the machine..."
exit 1
}
@ -25,6 +22,8 @@ bail_out() {
reboot_it
}
echo ""
echo ""
echo Enter '"copy"' at the prompt to copy the kernel on this
echo floppy to your hard disk. enter anything else to reboot,
echo but wait for the machine to restart to remove the floppy.
@ -51,32 +50,30 @@ if [ X"$todo" = Xcopy ]; then
fsck -y /dev/r$diskpart
if [ $? -ne 0 ]; then
echo ""
echo "fsck failed... Sorry, can't copy kernel..."
echo "fsck failed... Sorry, can't copy kernel!"
bail_out
fi
echo ""
echo "mounting $diskpart on /mnt..."
echo -n "Mounting $diskpart on /mnt... "
mount /dev/$diskpart /mnt
if [ $? -ne 0 ]; then
echo ""
echo "mount failed... Sorry, can't copy kernel..."
echo "mount failed... Sorry, can't copy kernel!"
bail_out
fi
echo ""
echo "Please wait. Copying kernel..."
echo "done."
echo -n "Copying kernel... "
cp /386bsd /mnt/386bsd
if [ $? -ne 0 ]; then
echo ""
echo "Copy failed... (?!?!?!)"
echo "failed... (?!?!?!)"
bail_out
fi
echo ""
echo "unmounting $diskpart..."
echo "done."
echo -n "Unmounting $diskpart... "
umount /mnt > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo ""
echo "unmount failed... Shouldn't be a problem..."
echo -n "failed... Shouldn't be a problem... "
fi
echo "done."
bail_out
fi