Sorry. I imported these in the wrong place!

This commit is contained in:
phil 1995-09-10 06:09:15 +00:00
parent 17c2255148
commit de25541834
24 changed files with 0 additions and 1767 deletions

View File

@ -1,5 +0,0 @@
# $Id
SUBDIR= inst upgr
.include <bsd.subdir.mk>

View File

@ -1,4 +0,0 @@
# $Id: Makefile.inc,v 1.1.1.1 1995/08/27 06:36:34 phil Exp $
# Revision is 1.0A
REV= 10A

View File

@ -1,63 +0,0 @@
# $Id: Makefile.inc,v 1.1.1.1 1995/08/27 06:36:35 phil Exp $
# TOP is assumed to be defined by Makefile including this one.
CBIN= instbin
COMMONDIR= ${TOP}/inst-common
MOUNT_POINT?= /mnt
VND?= vnd0
VND_DEV= /dev/${VND}c
VND_RDEV= /dev/r${VND}c
IMAGE?= xxx-${REV}.fs
MDEC= ${DESTDIR}/usr/mdec
LISTS= ${COMMONDIR}/list ${.CURDIR}/list
CRUNCHCONF= ${COMMONDIR}/${CBIN}.conf
MTREE= ${COMMONDIR}/mtree.conf
ADIR= ${.CURDIR}/../../../../sys/arch/pc532
all: ${CBIN} netbsd
dd if=/dev/zero of=${IMAGE} bs=18k count=80
disklabel -r -w ${.OBJDIR}/${IMAGE} boot3
-yes|bim -c init -c "add ${MDEC}/boot boot" -c "default 0" -c "exit" ${.OBJDIR}/${IMAGE}
vnconfig -v -c ${VND_DEV} ${IMAGE}
newfs -O -m 0 -o space -i 7168 -c 80 ${VND_RDEV} boot3
mount ${VND_DEV} ${MOUNT_POINT}
mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u
TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
TARGDIR=${MOUNT_POINT} sh ${TOP}/runlist.sh ${LISTS}
@echo ""
@df -i ${MOUNT_POINT}
@echo ""
umount ${MOUNT_POINT}
vnconfig -u ${VND_DEV}
cat /*bin/* > /dev/null
unconfig:
-umount -f ${MOUNT_POINT}
-vnconfig -u ${VND_DEV}
-/bin/rm -f ${IMAGE}
${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
crunchgen -D ${TOP}/../../.. -L ${DESTDIR}/usr/lib ${CRUNCHCONF}
${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
make -f ${CBIN}.mk all
cloak: ${COMMONDIR}/cloak.c
netbsd.o: cloak
cp ${ADIR}/compile/INSTALL/netbsd /tmp/$$$$; \
strip /tmp/$$$$; \
gzip -9 </tmp/$$$$ | ./cloak >netbsd.o; \
rm /tmp/$$$$
netbsd: netbsd.o
ld -s -z -T 380000 -e begin ${MDEC}/zboot.o netbsd.o -o netbsd
clean cleandir:
/bin/rm -f core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache *.o *.lo *.c
.include <bsd.obj.mk>
.include <bsd.subdir.mk>

View File

@ -1,93 +0,0 @@
/*
* Copyright (c) 1994 Matthias Pfaller.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Matthias Pfaller.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: cloak.c,v 1.1.1.1 1995/08/27 06:36:35 phil Exp $
*/
#include <stdio.h>
#include <unistd.h>
#include <a.out.h>
#include <sys/param.h>
#define SYM_DATA "_input_data"
#define SYM_LEN "_input_len"
void
writex(int fd, void *buf, int cnt, char *prog)
{
if (write(fd, buf, cnt) != cnt) {
perror(prog);
exit(1);
}
}
main(int argc, char **argv)
{
int n, data_len = 0;
static struct exec exec;
static struct nlist nlist[2];
static char buf[10240];
if (argc != 1) {
fprintf(stderr, "usage: %s <file1 >file2", argv[0]);
exit(1);
}
writex(1, &exec, sizeof(exec), argv[0]);
while ((n = read(0, buf, sizeof(buf))) > 0) {
data_len += n;
writex(1, buf, n, argv[0]);
}
memset(buf, 0, sizeof(buf));
if (ALIGN(data_len) - data_len)
writex(1, buf, ALIGN(data_len) - data_len, argv[0]);
writex(1, (void *)&data_len, sizeof(data_len), argv[0]);
n = sizeof(SYM_DATA) + sizeof(SYM_LEN) + sizeof(n);
nlist[0].n_un.n_strx = sizeof(n);
nlist[0].n_type = N_DATA | N_EXT;
nlist[0].n_value = 0;
nlist[1].n_un.n_strx = nlist[0].n_un.n_strx + sizeof(SYM_DATA);
nlist[1].n_type = N_DATA | N_EXT;
nlist[1].n_value = ALIGN(data_len);
writex(1, nlist, sizeof(nlist), argv[0]);
writex(1, &n, sizeof(n), argv[0]);
writex(1, SYM_DATA, sizeof(SYM_DATA), argv[0]);
writex(1, SYM_LEN, sizeof(SYM_LEN), argv[0]);
N_SETMAGIC(exec, OMAGIC, MID_MACHINE, 0);
exec.a_text = 0;
exec.a_data = ALIGN(data_len) + sizeof(data_len);
exec.a_bss = 0;
exec.a_syms = sizeof(nlist);
exec.a_trsize = 0;
exec.a_drsize = 0;
lseek(1, (off_t)0, SEEK_SET);
writex(1, &exec, sizeof(exec), argv[0]);
exit(0);
}

View File

@ -1,132 +0,0 @@
#
# Copyright (c) 1994 Christopher G. Demetriou
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by Christopher G. Demetriou.
# 4. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# $Id: dot.commonutils,v 1.1.1.1 1995/08/27 06:36:35 phil Exp $
# Installation utilites (functions), to get NetBSD installed on
# the hard disk. These are meant to be invoked from the shell prompt,
# by people installing NetBSD.
# we know that /etc/fstab is only generated on the hard drive
dest_dir=/
if [ ! -f /etc/fstab ]; then
dest_dir=/mnt/
fi
# counter for possible shared library confusion
TAR=/usr/bin/tar
GUNZIP=/usr/bin/gunzip
Set_tmp_dir()
{
def_tmp_dir=`pwd`
if [ "$def_tmp_dir" = "/" -o "$def_tmp_dir" = "/mnt" ]; then
def_tmp_dir="$dest_dir"usr/distrib
fi
echo -n "What directory should be used to find and/or store "
echo "installtion"
echo -n "files? [$def_tmp_dir] "
read tmp_dir
if [ "$tmp_dir" = "" ]; then
tmp_dir=$def_tmp_dir
fi
if [ ! -d "$tmp_dir" ]; then
/bin/rm -rf $tmp_dir
mkdir -p $tmp_dir
fi
}
Tmp_dir()
{
if [ "$tmp_dir" = "" ]; then
Set_tmp_dir
fi
cd $tmp_dir
}
Load_fd()
{
Tmp_dir
which=
echo "Don't forget that you can't load from the drive you booted from."
echo ""
while [ "$which" != "0" -a "$which" != "1" ]; do
echo -n "Read from which floppy drive ('0' or '1')? [1] "
read which
if [ "X$which" = "X" ]; then
which=1
fi
done
echo ""
echo "WARNING: during the floppy loading process, you should only"
echo "use Control-C at the prompt."
echo ""
while echo -n \
"Insert floppy (hit Control-C to terminate, enter to load): "
do
read foo
mount -t msdos /dev/fd${which}a /mnt2
cp -rp /mnt2/* .
umount /mnt2
done
}
Load_tape()
{
Tmp_dir
echo -n "Which tape drive will you be using? [rst0] "
read which
if [ "X$which" = "X" ]; then
which=rst0
fi
echo -n "Insert the tape into the tape drive and hit return to "
echo -n "continue..."
read foo
echo "Extracting files from the tape..."
$TAR xvpf --unlink /dev/$which
echo "Done."
}
Extract()
{
Tmp_dir
echo -n "Would you like to list the files as they're extracted? [n] "
read verbose
case $verbose in
y*|Y*)
tarverbose=v
;;
*)
tarverbose=
;;
esac
cat "$1"* | $GUNZIP | (cd $dest_dir ; $TAR --unlink -xp"$tarverbose"f - )
}

View File

@ -1,23 +0,0 @@
#
# kcbin.conf - unified binary for the kc floppy
# $Id: instbin.conf,v 1.1.1.1 1995/08/27 06:36:35 phil Exp $
#
srcdirs bin sbin usr.bin usr.sbin gnu/usr.bin
progs bim cat chmod chown chroot cp dd df disklabel ed expr fsck ftp gawk
progs gzip ifconfig init ln ls mkdir mknod more mount mount_cd9660
progs mount_msdos mount_nfs mv newfs ping pwd reboot rm route sed sh
progs shutdown slattach strings stty sync tar test tip umount update
ln chown chgrp
ln gawk awk
ln gzip gzcat gunzip
ln sh -sh # init invokes the shell this way
ln test [
ln mount_cd9660 cd9660
ln mount_msdos msdos
ln mount_nfs nfs
ln reboot halt
libs -ledit -lutil -ltermcap -lcrypt -ll -lm

View File

@ -1,77 +0,0 @@
# $Id: list,v 1.1.1.1 1995/08/27 06:36:35 phil Exp $
# copy the crunched binary, link to it, and kill it
COPY ${OBJDIR}/instbin instbin
COPY ${OBJDIR}/netbsd netbsd
LINK instbin bin/cat
LINK instbin bin/chmod
LINK instbin bin/cp
LINK instbin bin/dd
LINK instbin bin/df
LINK instbin bin/ed
LINK instbin bin/expr
LINK instbin bin/ln
LINK instbin bin/ls
LINK instbin bin/mkdir
LINK instbin bin/mv
LINK instbin bin/pwd
LINK instbin bin/rm
LINK instbin bin/sh
LINK instbin bin/stty
LINK instbin bin/sync
LINK instbin bin/test
LINK instbin bin/[
LINK instbin sbin/bim
LINK instbin sbin/disklabel
LINK instbin sbin/fsck
LINK instbin sbin/halt
LINK instbin sbin/ifconfig
LINK instbin sbin/init
LINK instbin sbin/mknod
LINK instbin sbin/mount
LINK instbin sbin/mount_cd9660
LINK instbin sbin/mount_msdos
LINK instbin sbin/mount_nfs
LINK instbin sbin/newfs
LINK instbin sbin/ping
LINK instbin sbin/reboot
LINK instbin sbin/route
LINK instbin sbin/shutdown
LINK instbin sbin/slattach
LINK instbin sbin/umount
SYMLINK /bin/cat usr/bin/awk
SYMLINK /bin/cat usr/bin/chgrp
SYMLINK /bin/cat usr/bin/ftp
SYMLINK /bin/cat usr/bin/gunzip
SYMLINK /bin/cat usr/bin/gzcat
SYMLINK /bin/cat usr/bin/gzip
SYMLINK /bin/cat usr/bin/more
SYMLINK /bin/cat usr/bin/sed
SYMLINK /bin/cat usr/bin/strings
SYMLINK /bin/cat usr/bin/tar
SYMLINK /bin/cat usr/bin/tip
SYMLINK /bin/cat usr/sbin/chown
SYMLINK /bin/cat usr/sbin/chroot
SYMLINK /bin/cat usr/sbin/update
SPECIAL /bin/rm instbin
# copy the MAKEDEV script and make some devices
COPY ${DESTDIR}/dev/MAKEDEV dev/MAKEDEV
SPECIAL cd dev; sh MAKEDEV floppy
SPECIAL /bin/rm dev/MAKEDEV
# we need the contents of /usr/mdec (XXX)
COPY ${DESTDIR}/usr/mdec/* usr/mdec
# various files that we need in /etc for the install
COPY ${DESTDIR}/etc/group etc
COPY ${DESTDIR}/etc/master.passwd etc
COPY ${DESTDIR}/etc/passwd etc
COPY ${DESTDIR}/etc/protocols etc
COPY ${DESTDIR}/etc/pwd.db etc
COPY ${DESTDIR}/etc/services etc
COPY ${DESTDIR}/etc/spwd.db etc
# and the common installation tools
COPY ${TOPDIR}/inst-common/dot.commonutils .commonutils
COPY ${TOPDIR}/inst-common/termcap.vt100 usr/share/misc/termcap

View File

@ -1,72 +0,0 @@
# $Id: mtree.conf,v 1.1.1.1 1995/08/27 06:36:35 phil Exp $
/set type=dir uname=root gname=wheel mode=0755
# .
.
# ./bin
bin
# ./bin
..
# ./dev
dev
# ./dev
..
# ./etc
etc
# ./etc
..
# ./mnt
mnt
# ./mnt
..
# ./mnt2
mnt2
# ./mnt2
..
# ./sbin
sbin
# ./sbin
..
# ./tmp
tmp
# ./tmp
..
# ./usr
usr
# ./usr/bin
bin
# ./usr/bin
..
# ./usr/mdec
mdec
# ./usr/mdec
..
# ./usr/sbin
sbin
# ./usr/sbin
..
# ./usr/share
share
# ./usr/share/misc
misc
# ./usr/share/misc
..
# ./usr/share
..
# ./usr
..

View File

@ -1,16 +0,0 @@
vt_keys:\
:Pu=\E[A!\EOA:Pd=\E[B!\EOB:Pr=\E[C!\EOC:Pl=\E[D!\EOD:\
:P0=\EOp!\E[3~:P1=\EOq!\E[12~:P2=\EOr!\E[20~:P3=\EOs!\E[13~:\
:P4=\EOt!\E[11~:P5=\EOu!\E[21~:P6=\EOv!\E[14~:P7=\EOw!\E[15~:\
:P8=\EOx!\E[5~:P9=\EOy!\E[24~:PE=\EOM:PD=\EOn!\E[2~:\
:PL=\EOP!\E[4~!\E[H:PR=\EOQ!\E[6~:PS=\EOR!\E[23~:\
:PX=\EOS!\E[18~!\E[1~:PM=\EOm!\E[19~:PP=\EOl!\E[17~:
vt100|xterm:\
:AL=\E[%dL:DL=\E[%dM:al=\E[L:bs:cd=\E[J:ce=\E[K:cl=\E[H\E[J:\
:cm=\E[%i%d;%dH:co#80:cs=\E[%i%r%d;%dr:dc=\E[P:dl=\E[M:do=^J:\
:ei=:ic=\E[@:im=:k0=\EOY:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\
:k5=\EOT:k6=\EOU:k7=\EOV:k8=\EOW:k9=\EOX:kb=^H:kd=\EOB:\
:ke=\E[?1l\E>:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:li#24:\
:nd=\E[C:pt:rs=\E[?5l:se=\E[m:so=\E[7m:sr=\EM:te=\E>:ti=\E=:\
:up=\E[A:xn:tc=vt_keys:

View File

@ -1,8 +0,0 @@
# $Id: Makefile,v 1.1.1.1 1995/08/27 06:36:35 phil Exp $
TOP= ${.CURDIR}/..
.include "${TOP}/Makefile.inc"
IMAGE= inst-${REV}.fs
.include "${TOP}/inst-common/Makefile.inc"

View File

@ -1,29 +0,0 @@
# Disk geometry and partition layout tables.
# Key:
# dt controller type
# ty type of disk (fixed, removeable, simulated)
# d[0-4] drive-type-dependent parameters
# ns #sectors/track
# nt #tracks/cylinder
# nc #cylinders/disk
# sc #sectors/cylinder, nc*nt default
# su #sectors/unit, sc*nc default
# se sector size, DEV_BSIZE default
# rm rpm, 3600 default
# sf supports bad144-style bad sector forwarding
# sk sector skew per track, default 0
# cs sector skew per cylinder, default 0
# hs headswitch time, default 0
# ts one-cylinder seek time, default 0
# il sector interleave (n:1), 1 default
# bs boot block size, default BBSIZE
# sb superblock size, default SBSIZE
# o[a-h] partition offsets in sectors
# p[a-h] partition sizes in sectors
# b[a-h] partition block sizes in bytes
# f[a-h] partition fragment sizes in bytes
# t[a-h] partition types (filesystem, swap, etc)
#
# All partition sizes reserve space for bad sector tables.
# (5 cylinders needed for maintenance + replacement sectors)
#

View File

@ -1,62 +0,0 @@
#
# Copyright (c) 1994 Christopher G. Demetriou
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by Christopher G. Demetriou.
# 4. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# $Id: dot.hdprofile,v 1.1.1.1 1995/08/27 06:36:35 phil Exp $
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
export PATH
TERM=vt100
export TERM
umask 022
if [ "X${DONEPROFILE}" = "X" ]; then
DONEPROFILE=YES
echo "Checking filesystems..."
fsck -y
echo "Mounting filesystems..."
mount -a
# set up some sane defaults
echo 'erase ^?, werase ^W, kill ^U, intr ^C'
stty newcrt werase ^W intr ^C kill ^U erase ^? 9600
echo ''
# run update, so that installed software is written as it goes.
update
# pull in the functions that people will use from the shell prompt.
. /.commonutils
. /.instutils
echo "Follow the installation directions to install the NetBSD"
echo "distribution sets."
fi

View File

@ -1,157 +0,0 @@
#
# Copyright (c) 1994 Christopher G. Demetriou
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by Christopher G. Demetriou.
# 4. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# $Id: dot.instutils,v 1.1.1.1 1995/08/27 06:36:36 phil Exp $
# Installation configuration utilites (functions), to get NetBSD configured
# reasonably once it is installed on the hard disk. These are meant to be
# invoked from the shell prompt, by people installing NetBSD.
Configure()
{
DEV=/dev
ETC=/etc
if [ ! -f /etc/fstab ]; then
DEV=/mnt/dev
ETC=/mnt/etc
fi
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 ""
if [ -e $ETC/sendmail.cf ]; then
echo "WARNING: A default sendmail.cf exists, and probably"
echo "needs to be tuned and/or replaced, to work properly at"
echo "your site!"
else
echo "WARNING: No default sendmail.cf installed. Did you"
echo "forget to install the 'etc' distribution?"
fi
echo "127.0.0.1 localhost localhost.$dname" > ${ETC}/hosts
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 "
echo -n "(e.g. ed0, ep0, 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 "
echo -n "interface ${intf}? "
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? [link0] "
read ifflags
if [ "$ifflags" = "" ]; then
ifflags=link0
fi
;;
*)
ifflags=
;;
esac
echo "inet $ifname $ifnetmask $ifflags" > ${ETC}/hostname.$intf
echo ""
echo -n "WARNING: if you have any more ethernet interfaces, "
echo "you will have to configure"
echo -n "them by hand. Read the comments in /etc/netstart to "
echo "learn how to do this."
;;
esac
echo ""
echo -n "Making device nodes (may take a while)..."
cd ${DEV}
sh MAKEDEV all
echo " done."
sync
echo ""
echo "If you haven't already installed a kernel on the hard drive"
echo "using your kernel-copy floppy, do so now. Kernel"
echo "installation instructions can be found in the"
echo "installation notes."
}

View File

@ -1,56 +0,0 @@
#
# Copyright (c) 1994 Christopher G. Demetriou
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by Christopher G. Demetriou.
# 4. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# $Id: dot.profile,v 1.1.1.1 1995/08/27 06:36:36 phil Exp $
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
export PATH
TERM=vt100
export TERM
umask 022
if [ "X${DONEPROFILE}" = "X" ]; then
DONEPROFILE=YES
# set up some sane defaults
echo 'erase ^?, werase ^W, kill ^U, intr ^C'
stty werase ^W intr ^C kill ^U erase ^?
echo ''
# run update, so that installed software is written as it goes.
update
# pull in the functions that people will use from the shell prompt.
. /.commonutils
. /.instutils
# run the installation script.
install
fi

View File

@ -1,457 +0,0 @@
#!/bin/sh
#
# Copyright (c) 1994 Christopher G. Demetriou
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by Christopher G. Demetriou.
# 4. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# $Id: install.sh,v 1.1.1.1 1995/08/27 06:36:36 phil Exp $
# NetBSD installation script.
# In a perfect world, this would be a nice C program, with a reasonable
# user interface.
DT=/etc/disktab # /etc/disktab
FSTABDIR=/mnt/etc # /mnt/etc
#DONTDOIT=echo
VERSION=1.0
FSTAB=${FSTABDIR}/fstab
getresp() {
read resp
if [ "X$resp" = "X" ]; then
resp=$1
fi
}
echo "Welcome to the NetBSD ${VERSION} installation program."
echo ""
echo "This program is designed to help you put NetBSD on your hard disk,"
echo "in a simple and rational way. You'll be asked several questions,"
echo "and it would probably be useful to have your disk's hardware"
echo "manual, the installation notes, and a calculator handy."
echo ""
echo "In particular, you will need to know some reasonably detailed"
echo "information about your disk's geometry, because there is currently"
echo "no way this this program can figure that information out."
echo ""
echo "As with anything which modifies your hard drive's contents, this"
echo "program can cause SIGNIFICANT data loss, and you are advised"
echo "to make sure your hard drive is backed up before beginning the"
echo "installation process."
echo ""
echo "Default answers are displyed in brackets after the questions."
echo "You can hit Control-C at any time to quit, but if you do so at a"
echo "prompt, you may have to hit return. Also, quitting in the middle of"
echo "installation may leave your system in an inconsistent state."
echo ""
echo -n "Proceed with installation? [n] "
getresp "n"
case "$resp" in
y*|Y*)
echo "Cool! Let's get to it..."
;;
*)
echo ""
echo "OK, then. Enter 'halt' at the prompt to halt the"
echo "machine. Once the machine has halted, remove the"
echo "floppy and press any key to reboot."
exit
;;
esac
echo ""
echo "To do the installation, you'll need to provide some information about"
echo "your disk."
echo ""
drivetype=sd
sect_fwd=""
type=SCSI
# find out what units are possible for that disk, and query the user.
driveunits=`ls /dev/${drivetype}?a | sed -e 's,/dev/\(...\)a,\1,g'`
if [ "X${driveunits}" = "X" ]; then
echo "FATAL ERROR:"
echo "No devices for disks of type '${drivetype}'."
echo "This is probably a bug in the install disks."
echo "Exiting install program."
exit
fi
prefdrive=${drivetype}0
echo ""
echo "The following ${drivetype}-type disks are supported by this"
echo "installation procedure:"
echo " "${driveunits}
echo "Note that they may not exist in _your_ machine; the list of"
echo "disks in your machine was printed when the system was booting."
echo ""
while [ "X${drivename}" = "X" ]; do
echo -n "Which disk would like to install on? [${prefdrive}] "
getresp ${prefdrive}
otherdrives=`echo "${driveunits}" | sed -e s,${resp},,`
if [ "X${driveunits}" = "X${otherdrives}" ]; then
echo ""
echo "\"${resp}\" is an invalid drive name. Valid choices"
echo "are: "${driveunits}
echo ""
else
drivename=${resp}
fi
done
echo ""
echo "Using disk ${drivename}."
echo ""
echo -n "What kind of disk is it? (one word please) [my${drivetype}] "
getresp "my${drivetype}"
labelname=$resp
echo ""
echo "You will now need to provide some information about your disk's"
echo "geometry. This should either be in the User's Manual for your disk,"
echo "or you should have written down what NetBSD printed when booting."
echo "(Note that he geometry that's printed at boot time is preferred.)"
echo ""
echo -n "Number of bytes per disk sector? [512] "
getresp 512
bytes_per_sect="$resp"
echo -n "Number of disk cylinders? "
getresp
cyls_per_disk="$resp"
echo -n "Number of disk tracks (heads) per disk cylinder? "
getresp
tracks_per_cyl="$resp"
echo -n "Number of disk sectors per disk track? "
getresp
sects_per_track="$resp"
cylindersize=`expr $sects_per_track \* $tracks_per_cyl`
cylbytes=`expr $cylindersize \* $bytes_per_sect`
disksize=`expr $cylindersize \* $cyls_per_disk`
echo ""
echo "Your disk has a total of $disksize $bytes_per_sect byte sectors,"
echo "arranged as $cyls_per_disk cylinders which contain $cylindersize "
echo "sectors ($cylbytes bytes) each."
echo ""
echo "You can specify partition sizes in cylinders ('c') or sectors ('s')."
while [ "X${sizemult}" = "X" ]; do
echo -n "What units would you like to use? [cylinders] "
getresp cylinders
case "$resp" in
c*|C*)
sizemult=$cylindersize
sizeunit="cylinders"
;;
s*|S*)
sizemult=1
sizeunit="sectors"
;;
*)
echo ""
echo "Enter cylinders ('c') or sectors ('s')."
;;
esac
done
if [ $sizeunit = "sectors" ]; then
echo ""
echo "For best disk performance, partitions should begin and end on"
echo "cylinder boundaries. Wherever possible, pick sizes that are"
echo "multiples of the cylinder size ($cylindersize sectors)."
fi
echo -n ""
echo -n "Size of NetBSD portion of disk (in $sizeunit)? "
getresp
partition=$resp
partition_sects=`expr $resp \* $sizemult`
part_offset=0
if [ $partition_sects -lt $disksize ]; then
echo -n "Offset of NetBSD portion of disk (in $sizeunit)? "
getresp
part_offset=$resp
fi
badspacesec=0
if [ "$sect_fwd" = "sf:" ]; then
badspacecyl=`expr $sects_per_track + 126`
badspacecyl=`expr $badspacecyl + $cylindersize - 1`
badspacecyl=`expr $badspacecyl / $cylindersize`
badspacesec=`expr $badspacecyl \* $cylindersize`
echo ""
echo -n "Using $badspacesec sectors ($badspacecyl cylinders) for the "
echo "bad144 bad block table"
fi
sects_left=`expr $partition_sects - $badspacesec`
units_left=`expr $sects_left / $sizemult`
echo ""
echo "There are $units_left $sizeunit left to allocate."
echo ""
root=0
while [ $root -eq 0 ]; do
echo -n "Root partition size (in $sizeunit)? "
getresp
case $resp in
[1-9]*)
total=$resp
if [ $total -gt $units_left ]; then
echo -n "Root size is greater than remaining "
echo "free space on disk."
else
root=$resp
fi
;;
esac
done
root_offset=$part_offset
part_used=`expr $root + $badspacesec / $sizemult`
units_left=`expr $partition - $part_used`
echo ""
swap=0
while [ $swap -eq 0 ]; do
echo "$units_left $sizeunit remaining in NetBSD portion of disk."
echo -n "Swap partition size (in $sizeunit)? "
getresp
case $resp in
[1-9]*)
if [ $swap -gt $units_left ]; then
echo -n "Swap size is greater than remaining "
echo "free space on disk."
else
swap=$resp
fi
;;
esac
done
swap_offset=`expr $root_offset + $root`
part_used=`expr $part_used + $swap`
echo ""
fragsize=1024
blocksize=8192
$DONTDOIT mount -u /dev/fd0a /
cat /etc/disktab.preinstall > $DT
echo "" >> $DT
echo "$labelname|NetBSD installation generated:\\" >> $DT
echo " :dt=${type}:ty=winchester:\\" >> $DT
echo -n " :nc#${cyls_per_disk}:ns#${sects_per_track}" >> $DT
echo ":nt#${tracks_per_cyl}:\\" >> $DT
echo " :se#${bytes_per_sect}:${sect_fwd}\\" >> $DT
_size=`expr $root \* $sizemult`
_offset=`expr $root_offset \* $sizemult`
echo -n " :pa#${_size}:oa#${_offset}" >> $DT
echo ":ta=4.2BSD:ba#${blocksize}:fa#${fragsize}:\\" >> $DT
_size=`expr $swap \* $sizemult`
_offset=`expr $swap_offset \* $sizemult`
echo " :pb#${_size}:ob#${_offset}:tb=swap:\\" >> $DT
_size=`expr $partition \* $sizemult`
_offset=`expr $part_offset \* $sizemult`
echo " :pc#${_size}:oc#${_offset}:\\" >> $DT
echo "You will now have to enter information about any other partitions"
echo "to be created in the NetBSD portion of the disk. This process will"
echo "be complete when you've filled up all remaining space in the NetBSD"
echo "portion of the disk."
while [ $part_used -lt $partition ]; do
part_size=0
units_left=`expr $partition - $part_used`
while [ $part_size -eq 0 ]; do
echo ""
echo -n "$units_left $sizeunit remaining in NetBSD portion of "
echo "the disk"
echo -n "Next partition size (in $sizeunit)? "
getresp
case $resp in
[1-9]*)
total=`expr $part_used + $resp`
if [ $total -gt $partition ]; then
echo -n "That would make the parition"
echo "too large to fit!"
else
part_size=$resp
part_used=$total
part_name=""
while [ "$part_name" = "" ]; do
echo -n "Mount point? "
getresp
part_name=$resp
done
fi
;;
esac
done
if [ "$ename" = "" ]; then
ename=$part_name
offset=`expr $part_offset + $root + $swap`
_size=`expr $part_size \* $sizemult`
_offset=`expr $offset \* $sizemult`
echo -n " :pe#${_size}:oe#${_offset}" >> $DT
echo ":te=4.2BSD:be#${blocksize}:fe#${fragsize}:\\" >> $DT
offset=`expr $offset + $part_size`
elif [ "$fname" = "" ]; then
fname=$part_name
_size=`expr $part_size \* $sizemult`
_offset=`expr $offset \* $sizemult`
echo -n " :pf#${_size}:of#${_offset}" >> $DT
echo ":tf=4.2BSD:bf#${blocksize}:ff#${fragsize}:\\" >> $DT
offset=`expr $offset + $part_size`
elif [ "$gname" = "" ]; then
gname=$part_name
_size=`expr $part_size \* $sizemult`
_offset=`expr $offset \* $sizemult`
echo -n " :pg#${_size}:og#${_offset}" >> $DT
echo ":tg=4.2BSD:bg#${blocksize}:fg#${fragsize}:\\" >> $DT
offset=`expr $offset + $part_size`
elif [ "$hname" = "" ]; then
hname=$part_name
_size=`expr $part_size \* $sizemult`
_offset=`expr $offset \* $sizemult`
echo -n " :ph#${_size}:oh#${_offset}" >> $DT
echo ":th=4.2BSD:bh#${blocksize}:fh#${fragsize}:\\" >> $DT
part_used=$partition
fi
done
echo " :pd#${disksize}:od#0:" >> $DT
sync
echo ""
echo "THIS IS YOUR LAST CHANCE!!!"
echo ""
echo -n "Are you SURE you want NetBSD installed on your hard drive? (yes/no) "
answer=""
while [ "$answer" = "" ]; do
getresp
case $resp in
yes|YES)
echo ""
echo "Here we go..."
answer=yes
;;
no|NO)
echo ""
echo -n "OK, then. enter 'halt' to halt the machine. "
echo "Once the machine has halted,"
echo -n "remove the floppy, and press any key to "
echo "reboot."
exit
;;
*)
echo -n "I want a yes or no answer... well? "
;;
esac
done
echo ""
echo -n "Labeling disk $drivename..."
$DONTDOIT disklabel -w $drivename $labelname
$DONTDOIT echo "y"|bim -c init -c "add /usr/mdec/boot boot" -c "default 0" -c "exit" /dev/${drivename}c
echo " done."
if [ "$sect_fwd" = "sf:" ]; then
echo -n "Initializing bad144 badblock table..."
$DONTDOIT bad144 $drivename 0
echo " done."
fi
echo "Initializing root filesystem, and mounting..."
$DONTDOIT newfs /dev/r${drivename}a $name
$DONTDOIT mount -v /dev/${drivename}a /mnt
if [ "$ename" != "" ]; then
echo ""
echo "Initializing $ename filesystem, and mounting..."
$DONTDOIT newfs /dev/r${drivename}e $name
$DONTDOIT mkdir -p /mnt/$ename
$DONTDOIT mount -v /dev/${drivename}e /mnt/$ename
fi
if [ "$fname" != "" ]; then
echo ""
echo "Initializing $fname filesystem, and mounting..."
$DONTDOIT newfs /dev/r${drivename}f $name
$DONTDOIT mkdir -p /mnt/$fname
$DONTDOIT mount -v /dev/${drivename}f /mnt/$fname
fi
if [ "$gname" != "" ]; then
echo ""
echo "Initializing $gname filesystem, and mounting..."
$DONTDOIT newfs /dev/r${drivename}g $name
$DONTDOIT mkdir -p /mnt/$gname
$DONTDOIT mount -v /dev/${drivename}g /mnt/$gname
fi
if [ "$hname" != "" ]; then
echo ""
echo "Initializing $hname filesystem, and mounting..."
$DONTDOIT newfs /dev/r${drivename}h $name
$DONTDOIT mkdir -p /mnt/$hname
$DONTDOIT mount -v /dev/${drivename}h /mnt/$hname
fi
echo ""
echo "Populating filesystems with bootstrapping binaries and config files"
$DONTDOIT tar --one-file-system -cf - . | (cd /mnt ; tar --unlink -xpf - )
$DONTDOIT cp /tmp/.hdprofile /mnt/.profile
echo ""
echo -n "Creating an fstab..."
echo /dev/${drivename}a / ufs rw 1 1 | sed -e s,//,/, > $FSTAB
if [ "$ename" != "" ]; then
echo /dev/${drivename}e /$ename ufs rw 1 2 | sed -e s,//,/, >> $FSTAB
fi
if [ "$fname" != "" ]; then
echo /dev/${drivename}f /$fname ufs rw 1 3 | sed -e s,//,/, >> $FSTAB
fi
if [ "$gname" != "" ]; then
echo /dev/${drivename}g /$gname ufs rw 1 4 | sed -e s,//,/, >> $FSTAB
fi
if [ "$hname" != "" ]; then
echo /dev/${drivename}h /$hname ufs rw 1 5 | sed -e s,//,/, >> $FSTAB
fi
sync
echo " done."
echo ""
echo ""
echo "OK! The preliminary work of setting up your disk is now complete."
echo "You can now boot off the hard drive."
echo ""
echo "The remaining tasks are:"
echo ""
echo "To load and install the NetBSD distribution sets."
echo "Currently the hard drive's root filesystem is mounted on /mnt"
echo ""
echo "Consult the installation notes which will describe how to"
echo "install the distribution sets and kernel. Post-installation"
echo "configuration is also discussed therein."
echo ""
echo "GOOD LUCK!"
echo ""

View File

@ -1,11 +0,0 @@
# $Id: list,v 1.1.1.1 1995/08/27 06:36:36 phil Exp $
# the disktab explanation file
COPY disktab.preinstall etc
# and the installation tools
COPY dot.profile .profile
COPY dot.instutils .instutils
COPY install.sh install
COPY dot.hdprofile tmp/.hdprofile
SPECIAL chmod 755 install

View File

@ -1,44 +0,0 @@
# $Id: list2sh.awk,v 1.1.1.1 1995/08/27 06:36:34 phil Exp $
BEGIN {
printf("cd ${CURDIR}\n");
printf("\n");
}
/^$/ || /^#/ {
print $0;
next;
}
$1 == "COPY" {
printf("echo '%s'\n", $0);
printf("cp %s ${TARGDIR}/%s\n", $2, $3);
next;
}
$1 == "LINK" {
printf("echo '%s'\n", $0);
printf("(cd ${TARGDIR}; ln %s %s)\n", $2, $3);
next;
}
$1 == "SYMLINK" {
printf("echo '%s'\n", $0);
printf("(cd ${TARGDIR}; ln -s %s %s)\n", $2, $3);
next;
}
$1 == "SPECIAL" {
printf("echo '%s'\n", $0);
printf("(cd ${TARGDIR};");
for (i = 2; i <= NF; i++)
printf(" %s", $i);
printf(")\n");
next;
}
{
printf("echo '%s'\n", $0);
printf("echo 'Unknown keyword \"%s\" at line %d of input.'\n", $1, NR);
printf("exit 1\n");
exit 1;
}
END {
printf("\n");
printf("exit 0\n");
exit 0;
}

View File

@ -1,13 +0,0 @@
# $Id: runlist.sh,v 1.1.1.1 1995/08/27 06:36:34 phil Exp $
if [ "X$1" = "X-d" ]; then
SHELLCMD=cat
shift
else
SHELLCMD="sh -e"
fi
( while [ "X$1" != "X" ]; do
cat $1
shift
done ) | awk -f ${TOPDIR}/list2sh.awk | ${SHELLCMD}

View File

@ -1,8 +0,0 @@
# $Id: Makefile,v 1.1.1.1 1995/08/27 06:36:36 phil Exp $
TOP= ${.CURDIR}/..
.include "${TOP}/Makefile.inc"
IMAGE= upgr-${REV}.fs
.include "${TOP}/inst-common/Makefile.inc"

View File

@ -1,62 +0,0 @@
#
# Copyright (c) 1994 Christopher G. Demetriou
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by Christopher G. Demetriou.
# 4. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# $Id: dot.hdprofile,v 1.1.1.1 1995/08/27 06:36:36 phil Exp $
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
export PATH
TERM=pc3
export TERM
umask 022
if [ "X${DONEPROFILE}" = "X" ]; then
DONEPROFILE=YES
echo "Checking filesystems..."
fsck -y
echo "Mounting filesystems..."
mount -a
# set up some sane defaults
echo 'erase ^?, werase ^W, kill ^U, intr ^C'
stty newcrt werase ^W intr ^C kill ^U erase ^? 9600
echo ''
# run update, so that installed software is written as it goes.
update
# pull in the functions that people will use from the shell prompt.
. /.commonutils
. /.upgrutils
echo "Follow the installation directions to install the NetBSD"
echo "distribution sets."
fi

View File

@ -1,56 +0,0 @@
#
# Copyright (c) 1994 Christopher G. Demetriou
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by Christopher G. Demetriou.
# 4. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# $Id: dot.profile,v 1.1.1.1 1995/08/27 06:36:36 phil Exp $
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
export PATH
TERM=pc3
export TERM
umask 022
if [ "X${DONEPROFILE}" = "X" ]; then
DONEPROFILE=YES
# set up some sane defaults
echo 'erase ^?, werase ^W, kill ^U, intr ^C'
stty newcrt werase ^W intr ^C kill ^U erase ^? 9600
echo ''
# run update, so that installed software is written as it goes.
update
# pull in the functions that people will use from the shell prompt.
. /.commonutils
. /.upgrutils
# run the upgrade script.
upgrade
fi

View File

@ -1,58 +0,0 @@
#
# Copyright (c) 1994 Christopher G. Demetriou
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by Christopher G. Demetriou.
# 4. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# $Id: dot.upgrutils,v 1.1.1.1 1995/08/27 06:36:36 phil Exp $
# Upgrade cleanup utilites (functions), to make sure a recently-upgraded
# system is safely runnable. These are meant to be invoked from the shell
# prompt, by people installing NetBSD.
Cleanup()
{
upgrade_dir=/
if [ ! -f /etc/fstab ]; then
upgrade_dir=/mnt
fi
echo "Cleaning up miscellaneous files in /etc..."
mv $upgrade_dir/etc/rc.bak $upgrade_dir/etc/rc
chroot $upgrade_dir /usr/sbin/pwd_mkdb -p /etc/master.passwd
chroot $upgrade_dir /bin/rm /etc/sendmail.fc > /dev/null 2>&1
sync
echo "Done."
echo ""
echo "All that's left to do now is to install a new NetBSD kernel"
echo "on your hard disk. You should now halt your machine using"
echo "the 'halt' command. Once the machine is halted, replace the"
echo "installation floppy with the kernel-copy floppy and hit any"
echo "key to reboot. Use the kernel-copy floppy to copy a kernel"
echo "to your hard disk."
}

View File

@ -1,8 +0,0 @@
# $Id: list,v 1.1.1.1 1995/08/27 06:36:36 phil Exp $
# and the upgrade tools
COPY dot.profile .profile
COPY dot.upgrutils .upgrutils
COPY upgrade.sh upgrade
COPY dot.hdprofile tmp/.hdprofile
SPECIAL chmod 755 upgrade

View File

@ -1,253 +0,0 @@
#!/bin/sh
#
# Copyright (c) 1994 Christopher G. Demetriou
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by Christopher G. Demetriou.
# 4. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# $Id: upgrade.sh,v 1.1.1.1 1995/08/27 06:36:36 phil Exp $
# NetBSD upgrade script.
# In a perfect world, this would be a nice C program, with a reasonable
# user interface.
DT=/etc/disktab # /etc/disktab
FSTABDIR=/mnt/etc # /mnt/etc
#DONTDOIT=echo
VERSION=1.0
FSTAB=${FSTABDIR}/fstab
getresp() {
read resp
if [ "X$resp" = "X" ]; then
resp=$1
fi
}
echo "Welcome to the NetBSD ${VERSION} upgrade program."
echo ""
echo "This program is designed to help you put the new version of NetBSD"
echo "on your hard disk, in a simple and rational way. To upgrade, you"
echo "must have plenty of free space on all partitions which will be"
echo "upgraded. If you have at least 1MB free on your root partition,"
echo "and several free on your /usr patition, you should be fine."
echo ""
echo "As with anything which modifies your hard drive's contents, this"
echo "program can cause SIGNIFICANT data loss, and you are advised"
echo "to make sure your hard drive is backed up before beginning the"
echo "upgrade process."
echo ""
echo "Default answers are displyed in brackets after the questions."
echo "You can hit Control-C at any time to quit, but if you do so at a"
echo "prompt, you may have to hit return. Also, quitting in the middle of"
echo "the upgrade may leave your system in an inconsistent (and unusable)"
echo "state."
echo ""
echo -n "Proceed with upgrade? [n] "
getresp "n"
case "$resp" in
y*|Y*)
echo "Cool! Let's get to it..."
;;
*)
echo ""
echo "OK, then. Enter 'halt' at the prompt to halt the"
echo "machine. Once the machine has halted, remove the"
echo "floppy and press any key to reboot."
exit
;;
esac
# find out what units are possible, and query the user.
driveunits=`ls /dev/[sw]d?a | sed -e 's,/dev/\(...\)a,\1,g'`
if [ "X${driveunits}" = "X" ]; then
echo "FATAL ERROR:"
echo "No disk devices."
echo "This is probably a bug in the install disks."
echo "Exiting install program."
exit
fi
echo ""
echo "The following disks are supported by this upgrade procedure:"
echo " "${driveunits}
echo "If your system was previously completely contained within the"
echo "disks listed above (i.e. if your system didn't occupy any space"
echo "on disks NOT listed above), this upgrade disk can upgrade your"
echo "system. If it cannot, hit Control-C at the prompt."
echo ""
while [ "X${drivename}" = "X" ]; do
echo -n "Which disk contains your root partion? "
getresp
otherdrives=`echo "${driveunits}" | sed -e s,${resp},,`
if [ "X${driveunits}" = "X${otherdrives}" ]; then
echo ""
echo "\"${resp}\" is an invalid drive name. Valid choices"
echo "are: "${driveunits}
echo ""
else
drivename=${resp}
fi
done
echo ""
echo "Root partition is on ${drivename}a."
echo ""
echo "Would you like to upgrade your file systems to the new file system"
echo -n "format? [y] "
getresp "y"
case "$resp" in
n*|N*)
echo ""
echo "You should upgrade your file systems with 'fsck -c 2'"
echo "as soon as is feasible, because the new file system"
echo "code is better-tested and more performant."
upgradefs=NO
;;
*)
upgradefs=YES
;;
esac
if [ $upgradefs = YES ]; then
echo ""
echo "Upgrading the file system on ${drivename}a..."
fsck -p -c 2 /dev/r${drivename}a
if [ $? != 0 ]; then
echo "FATAL ERROR: FILE SYSTEM UPGRADE FAILED."
echo "You should probably reboot the machine, fsck your"
echo "disk(s), and try the upgrade procedure again."
exit 1
fi
echo "Done."
fi
echo ""
echo "Mounting root partition on /mnt..."
mount /dev/${drivename}a /mnt
if [ $? != 0 ]; then
echo "FATAL ERROR: MOUNT FAILED."
echo "You should verify that your system is set up as you"
echo "described, and re-attempt the upgrade procedure."
exit 1
fi
echo "Done."
if [ $upgradefs = YES ]; then
echo ""
echo -n "Copying new fsck binary to your hard disk..."
if [ ! -d /mnt/sbin ]; then
mkdir /mnt/sbin
fi
cp /sbin/fsck /mnt/sbin/fsck
if [ $? != 0 ]; then
echo "FATAL ERROR: COPY FAILED."
echo "It in unclear why this error would occur. It looks"
echo "like you may end up having to upgrade by hand."
exit 1
fi
echo " Done."
echo ""
echo "Re-mounting root partition read-only..."
mount -u -o ro /dev/${drivename}a /mnt
if [ $? != 0 ]; then
echo "FATAL ERROR: RE-MOUNT FAILED."
echo "It in unclear why this error would occur. It looks"
echo "like you may end up having to upgrade by hand."
exit 1
fi
echo "Done."
echo ""
echo "Upgrading the rest of your file systems..."
chroot /mnt fsck -p -c 2
if [ $? != 0 ]; then
echo "FATAL ERROR: FILE SYSTEM UPGRADE(S) FAILED."
echo "You should probably reboot the machine, fsck your"
echo "file system(s), and try the upgrade procedure"
echo "again."
exit 1
fi
echo "Done."
echo ""
echo "Re-mounting root partition read-write..."
mount -u -o rw /dev/${drivename}a /mnt
if [ $? != 0 ]; then
echo "FATAL ERROR: RE-MOUNT FAILED."
echo "It in unclear why this error would occur. It looks"
echo "like you may end up having to upgrade by hand."
exit 1
fi
echo "Done."
fi
echo ""
echo "Updating boot blocks on ${drivename}..."
disklabel -r $drivename > /mnt/tmp/${drivename}.label
if [ $? != 0 ]; then
echo "FATAL ERROR: READ OF DISK LABEL FAILED."
echo "It in unclear why this error would occur. It looks"
echo "like you may end up having to upgrade by hand."
exit 1
fi
disklabel -R -B $drivename /mnt/tmp/${drivename}.label
if [ $? != 0 ]; then
echo "FATAL ERROR: UPDATE OF DISK LABEL FAILED."
echo "It in unclear why this error would occur. It looks"
echo "like you may end up having to upgrade by hand."
exit 1
fi
echo "Done."
echo ""
echo "Copying bootstrapping binaries and config files to the hard drive..."
$DONTDOIT cp /mnt/.profile /mnt/.profile.bak
$DONTDOIT tar --exclude etc --one-file-system -cf - . | (cd /mnt ; tar --unlink -xpf - )
$DONTDOIT mv /mnt/etc/rc /mnt/etc/rc.bak
$DONTDOIT cp /tmp/.hdprofile /mnt/.profile
echo ""
echo "Mounting remaining partitions..."
chroot /mnt mount -at ufs > /dev/null 2>&1
echo "Done."
echo ""
echo ""
echo "OK! The preliminary work of setting up your disk is now complete,"
echo "and you can now upgrade the actual NetBSD software."
echo ""
echo "Right now, your hard disk is mounted on /mnt. You should consult"
echo "the installation notes to determine how to load and install the new"
echo "NetBSD distribution sets, and how to clean up after the upgrade"
echo "software, when you are done."
echo ""
echo "GOOD LUCK!"
echo ""