|
|
DataMuseum.dkPresents historical artifacts from the history of: Regnecentalen RC-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Regnecentalen RC-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: I T U
Length: 9900 (0x26ac)
Types: TextFile
Notes: UNIX file
Names: »INSTALL«
└─⟦08d12fb7c⟧ Bits:30004153 SW95705I.2 386/ix Multi-User Rel 2.2 boot
└─⟦08d12fb7c⟧ UNIX Filesystem
└─⟦this⟧ »INSTALL«
# @(#)INSTALL 2.35 - 89/04/28
echo "
Copyright (C) 1984, 1986, 1987, 1988 AT&T
(c) Copyright INTERACTIVE Systems Corporation, 1987, 1988, 1989
All Rights Reserved.
"
trap 'trap "" 1 2 3 9 15;
echo "\nYou have aborted the 386/ix Operating System installation.
If you wish to re-run it, type INSTALL at the prompt.
Please consult your \"Operations/System Administration Guide\"
for further information.";
umount /dev/dsk/0s3 > /dev/null 2>&1; sync; sync;
umount /dev/dsk/0s1 > /dev/null 2>&1; sync; sync;
exit 2' 1 2 3 15
stty erase '^h'
# Make SURE the user wants to do this.
confirm() {
echo "Press ENTER to $1 the 386/ix System on your hard disk.\n(DEL to abort)\c"
read a
while [ "$a" != "" ]
do
echo "Please press either ENTER to $1 the 386/ix System\n or DEL to abort. \c"
read a
echo ""
done
}
# get an answer from 2 choices, usage getyn "question" [ ans1 [ans2]]
getyn() {
ANS=
yes=${2:-y}
no=${3:-n}
echo $1
while [ "$ANS" != $yes -a "$ANS" != $no ]
do
echo "Please answer \"$yes\" or \"$no\". \c"
read ANS
done
}
# mklost, make a lost+found directory in $1
mklost() {
(
cd ${1:-/mnt}
[ -d lost+found ] || mkdir lost+found
cd lost+found
for ii in 1 2 3 4 5 6 7 8 9
do
for xx in 1 2 3 4 5 6 7 8 9
do
> tmp.$ii.$xx
done
done
sync
rm -f tmp.?.?
)
}
# START HERE
newinstall=1
intlv=nono
ques="What interleave factor was the disk originally formatted with?\nIf you do not know, answer \"0\"."
/etc/whatkb first
confirm "upgrade or install"
echo "\nChecking for an existing 386/ix system on hard disk.\n"
/bin/dd if=/dev/rdsk/0s1 count=1 > /dev/null 2>&1
if [ $? -eq 0 ]
then # upgrade possible
fsck -y /dev/dsk/0s1 >/dev/null 2>&1
echo "Mounting root filesystem .. \c"
mount /dev/dsk/0s1 /mnt >/dev/null 2>&1
if [ $? -eq 0 ]
then # upgrade possible
echo "OK"
# ask the user what they want
getyn "Please enter \"n\" for a new installation, or \"u\" for an upgrade installation." n u
case "$ANS" in
u) newinstall=0;;
n) umount /dev/dsk/0s1 ;;
esac
fi
fi
# if upgrade fsck and mount, if that fails, complain and ask again
if [ $newinstall -eq 0 ]
then # see if /usr should be mounted.
if [ -f /mnt/etc/fstab ]
then
while read fsdev mountpoint junk
do
if [ "$mountpoint" = "/usr" -o "$mountpoint" = "/tmp" ]
then
fsck -y $fsdev >/dev/null 2>&1
mount $fsdev /mnt/$mountpoint >/dev/null 2>&1
if [ $? -ne 0 ]
then
echo "Cannot mount $mountpoint. You may install a new system, or"
echo "you may continue the upgrade without using the $mountpoint filesystem."
confirm "continue the upgrade of"
fi
break
fi
done </mnt/etc/fstab
else # no fstab? what's going on?
echo "No additional filesystems found."
confirm "continue the upgrade of"
fi
echo "\nThe 386/ix System will now be upgraded on your hard disk."
cp /mnt/etc/partitions /mnt/etc/UGpartitions
ed /mnt/etc/inittab > /dev/null 2>&1 <<!
1,$ s/\/etc\/keyboard/\/usr\/lib\/keyboard/
w
q
!
cp /mnt/etc/inittab /mnt/etc/UGinittab
cp /etc/inittab2 /mnt/etc/inittab
cp /mnt/etc/passwd /mnt/etc/UGpasswd
cp /mnt/etc/shadow /mnt/etc/UGshadow
cp /mnt/etc/group /mnt/etc/UGgroup
cp /mnt/etc/fstab /mnt/etc/UGfstab
cp /mnt/etc/TIMEZONE /mnt/etc/UGTIMEZONE
if [ -d /mnt/etc/conf/cf.d ]
then
ed /mnt/etc/conf/cf.d/init.base > /dev/null 2>&1 <<!
1,$ s/\/etc\/keyboard/\/usr\/lib\/keyboard/
w
q
!
cp /mnt/etc/conf/cf.d/init.base /mnt/etc/conf/cf.d/UGinit.base
fi
if [ ! -d /mnt/etc/conf/kconfig.d ] # no kconfig? give 'em a new kernel.
then
echo Installing new kernel.
mv /mnt/unix /mnt/OLD.unix
cp /unix /mnt
fi
# get just the binaries and necessary device nodes off this disk
find bin dev/tape dev/rdsk/f0 dev/rdsk/f0t etc/mkfs etc/fsck \
/etc/rc.d etc/init etc/whatkb etc/check_tape shlib \
/usr/lib/keyboard -print |\
cpio -pdmau /mnt > /dev/null 2>&1
mv /mnt/bin/-sh /mnt/tmp/-sh
find dev/console -print | cpio -pdmau /mnt/tmp >/dev/null 2>&1
[ -f /mnt/.profile ] && cp /mnt/.profile /mnt/UG.profile
cp .profile /mnt
cp INSTALL2 /mnt/tmp/INSTALL
cp readfloppy LABEL /mnt/tmp > /dev/null 2>&1
# unmount stuff
while read fsdev mountpoint junk
do
if [ "$mountpoint" = "/usr" -o "$mountpoint" = "/tmp" ]
# if [ "$mountpoint" = "/tmp" ]
then
umount $fsdev
fi
done </mnt/etc/fstab
# now jump to the last few lines in the script.
else # New installation. do everything.
# check disk configuration
diskconfig 00
# ask if the want to format the disk. ask if they know the interleave
getyn "Do you want to format the primary drive?" y n
doformat=$ANS
low="0"
if [ "$ANS" = "y" ]
then
ques="What interleave factor (1 - 9) do you want to use?"
low="1"
fi
while [ "$intlv" = "nono" ]
do
echo "$ques \c"
read ans
case "$ans" in
0) if [ "$doformat" = "y" ]
then
echo "invalid response, please enter a single digit from 1 to 9."
else intlv=$ans
fi ;;
[1-9]) intlv=$ans ;;
*) echo "invalid response, please enter a single digit from $low to 9." ;;
esac
done
# Run mkpart -i [-F if formatting]
rm -f /tmp/part
echo "disk0:\n\tdevice=\"/dev/rdsk/0p0\", vtocsec=29, altsec=30, boot=\"/etc/boot\"" >/tmp/part
if [ "$doformat" = y ]
then
mkpart -F $intlv -f /tmp/part disk0
if [ $? != 0 ]
then
echo "\nFormat Failed. To try again, type INSTALL at the # prompt."
exit 2
fi
echo "You must now repartition your disk."
ANS=y
else
getyn "Do you want to repartition your hard disk?" y n
fi
if [ "$ANS" = "y" ]
then
/etc/fdisk /dev/rdsk/0p0
if [ $? -ne 0 ]
then
echo "Cannot partition hard disk. You may have an unformmated disk."
echo "If your disk has never been used, you must format it.\n"
exit 6
fi
echo "\nHard disk partitioning complete."
fi
# install correct interleave
mkpart -I $intlv -f /tmp/part disk0 >/dev/null
if [ $? != 0 ]
then
echo 'Cannot initialize the disk. To try again, type INSTALL at the # prompt.'
exit 3
fi
# run disksetup
echo
getyn "\tDo you wish to do a surface analysis?" y n
if [ "$ANS" = "y" ]
then
getyn "\tDo you wish to do a complete surface analysis?\nAnswer 'y' to
write and read every sector, 'n' to just read every sector.\n
NOTE: writing the whole disk takes a while." y n
if [ "$ANS" = "y" ]
then verf="V"
else verf="v"
fi
diskverify -e$verf -I $intlv 00
if [ $? != 0 ]
then
echo "Cannot verify the disk. To try again, type INSTALL at the # prompt.\nBe sure you create a UNIX partition on the disk."
exit 4
fi
else # if this file hangs aroung from some old installation, it's bad.
rm -f /tmp/badsectors
fi
# get filesystem partitioning info
disksetup 00
if [ $? != 0 ]
then
echo "Cannot setup the disk. To try again, type INSTALL at the # prompt.\nBe sure you create a UNIX partition on the disk."
exit 4
fi
echo "\nCreating 386/ix partitions.\n"
while read pnam
do
/etc/mkpart -P $pnam disk0 >/dev/null 2>&1
done <addparts
# mkfs with mkfs.data
> /tmp/newfstab
while read devnm devsiz gap cylsiz fsnam
do
echo "\nCreating file system for" $fsnam
/etc/mkfs $devnm $devsiz 1 $cylsiz >/dev/null 2>&1
echo "Labeling" $fsnam
/etc/labelit $devnm $fsnam disk0 >/dev/null 2>&1
sync
# special case, if $devnm = /dev/dsk/0s1, it's the root
if [ "$devnm" = /dev/dsk/0s1 ]
then
fsnam=/
else
echo $devnm /$fsnam >>/tmp/newfstab
fi
[ -d /mnt/$fsnam ] || mkdir /mnt/$fsnam
/etc/mount $devnm /mnt/$fsnam
if [ $? -ne 0 ]
then
echo Mount of $fsnam failed.
exit 3
fi
echo "Creating lost+found directory in" $fsnam
mklost /mnt/$fsnam
chmod 777 /mnt/$fsnam/lost+found
done <mkfs.data
# root & usr (and any other mountable partitions) are now all mounted
echo "\nThe 386/ix System will now be installed on your hard disk."
echo "Please be patient...\c"
cd /
cp unix /mnt
# install kernel
echo ".\c"
chmod 775 /mnt
chmod 744 /mnt/unix
chown root /mnt /mnt/unix
chgrp sys /mnt
chgrp other /mnt/unix
echo ".\c"
[ -d /mnt/etc ] || mkdir /mnt/etc
[ -d /mnt/tmp ] || mkdir /mnt/tmp > /dev/null 2>&1
[ -d /mnt/mnt ] || mkdir /mnt/mnt > /dev/null 2>&1
[ -d /mnt/usr ] || mkdir /mnt/usr > /dev/null 2>&1
chmod 777 /mnt/tmp /mnt/mnt /mnt/usr
echo ".\c"
# cpio stuff into it.
find dev bin etc shlib usr -print | cpio -pdmau /mnt > /dev/null 2>&1
rm -f /mnt/dev/root
mknod /mnt/dev/root b 0 1
echo ".\c"
# and install new configuration files.
cp /mkfs.data /mnt
/etc/mkpart -b -B /etc/boot -f /mnt/etc/partitions disk0
echo ".\c"
mv /mnt/etc/inittab2 /mnt/etc/inittab
cp /tmp/newfstab /mnt/etc/fstab
sync
echo ".\c"
> /mnt/etc/mnttab
echo ".\c"
# put appropriate version of boot defaults into /etc
# see sys/machenv.h for definition values.
/etc/machine_type > /dev/null 2>&1
m=$?
case $m in
1) SUF=cpq ;;
2) SUF=ps2 ;;
3) SUF=at386 ;;
[4-5]) getyn "This machine appears to be an AT&T WS-6386, is this correct?" y n
if [ "$ANS" = "y" ]
then
if [ "$m" = "4" ]
then
SUF=att
else
SUF=att5
fi
else
SUF=at386
fi ;;
6) SUF=m380 ;;
*) SUF=at386 ;;
esac
cp /mnt/etc/default/default.$SUF /mnt/etc/default/boot
[ -d /mnt/tmp ] || mkdir /mnt/tmp > /dev/null 2>&1
[ -d /mnt/mnt ] || mkdir /mnt/mnt > /dev/null 2>&1
[ -d /mnt/usr ] || mkdir /mnt/usr > /dev/null 2>&1
echo ".\c"
cp .profile /mnt
cp INSTALL2 /mnt/tmp/INSTALL
cp readfloppy LABEL /mnt/tmp > /dev/null 2>&1
sync
echo ".\c"
mv /mnt/bin/-sh /mnt/tmp/-sh
find dev/console -print | cpio -pdmau /mnt/tmp > /dev/null 2>&1
echo ".\c"
sync
# unmount everything,
while read devnm fsnam
do
umount $devnm >/dev/null 2>&1
done < /tmp/newfstab
fi
echo "Unmounting root filesystem\c"
/etc/umount /dev/dsk/0s1
echo ""
sync; sync
echo "\n\tWhen you are prompted to reboot your system,\n\
remove the floppy disk from the diskette drive,\n\
and strike any key. Wait for the prompt.\n"
uadmin 2 0