diff options
-rw-r--r-- | distrib/sun3/Makefile | 4 | ||||
-rw-r--r-- | distrib/sun3/list2sh.awk | 71 | ||||
-rw-r--r-- | distrib/sun3/miniroot/Makefile | 72 | ||||
-rw-r--r-- | distrib/sun3/ramdisk/Makefile | 112 | ||||
-rw-r--r-- | distrib/sun3/ramdisk/dot.instutils | 155 | ||||
-rw-r--r-- | distrib/sun3/ramdisk/dot.profile | 86 | ||||
-rw-r--r-- | distrib/sun3/ramdisk/install.md | 480 | ||||
-rw-r--r-- | distrib/sun3/ramdisk/list | 96 | ||||
-rw-r--r-- | distrib/sun3/ramdisk/mtree.conf | 92 | ||||
-rw-r--r-- | distrib/sun3/ramdisk/raminst.conf | 31 | ||||
-rw-r--r-- | distrib/sun3/ramdisk/rd.disktab | 16 | ||||
-rw-r--r-- | distrib/sun3/ramdisk/rd.group | 21 | ||||
-rw-r--r-- | distrib/sun3/ramdisk/rd.master.passwd | 7 | ||||
-rw-r--r-- | distrib/sun3/runlist.sh | 13 |
14 files changed, 1127 insertions, 129 deletions
diff --git a/distrib/sun3/Makefile b/distrib/sun3/Makefile index 332faa92231..57c3caea914 100644 --- a/distrib/sun3/Makefile +++ b/distrib/sun3/Makefile @@ -1,5 +1,5 @@ -# $OpenBSD: Makefile,v 1.2 1997/09/21 11:46:05 deraadt Exp $ +# $OpenBSD: Makefile,v 1.3 1998/08/23 18:08:53 kstailey Exp $ -SUBDIR= miniroot ramdisk +SUBDIR= ramdisk .include <bsd.subdir.mk> diff --git a/distrib/sun3/list2sh.awk b/distrib/sun3/list2sh.awk new file mode 100644 index 00000000000..2718ab2000b --- /dev/null +++ b/distrib/sun3/list2sh.awk @@ -0,0 +1,71 @@ +# $OpenBSD: list2sh.awk,v 1.1 1998/08/23 18:08:55 kstailey Exp $ + +BEGIN { + printf("cd ${CURDIR}\n"); + printf("\n"); +} +/^$/ || /^#/ { + print $0; + next; +} +$1 == "COPY" { + printf("echo '%s'\n", $0); + printf("test -f ${TARGDIR}/%s && rm -fr ${TARGDIR}/%s\n", $3, $3); + printf("cp %s ${TARGDIR}/%s\n", $2, $3); + next; +} +$1 == "LINK" { + printf("echo '%s'\n", $0); + for (i = 3; i <= NF; i++) { + printf("test -f ${TARGDIR}/%s && rm -f ${TARGDIR}/%s\n", $i, $i); + printf("(cd ${TARGDIR}; ln %s %s)\n", $2, $i); + } + next; +} +$1 == "SYMLINK" { + printf("echo '%s'\n", $0); + for (i = 3; i <= NF; i++) { + printf("test -f ${TARGDIR}/%s && rm -f ${TARGDIR}/%s\n", $i, $i); + printf("(cd ${TARGDIR}; ln -s %s %s)\n", $2, $i); + } + next; +} +$1 == "ARGVLINK" { + # crunchgen directive; ignored here + next; +} +$1 == "SRCDIRS" { + # crunchgen directive; ignored here + next; +} +$1 == "CRUNCHSPECIAL" { + # crunchgen directive; ignored here + next; +} +$1 == "COPYDIR" { + printf("echo '%s'\n", $0); + printf("(cd ${TARGDIR}/%s && find . ! -name . | xargs /bin/rm -rf)\n", + $3); + printf("(cd %s && find . ! -name . | cpio -pdamu ${TARGDIR}/%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; +} diff --git a/distrib/sun3/miniroot/Makefile b/distrib/sun3/miniroot/Makefile deleted file mode 100644 index 339166cbe38..00000000000 --- a/distrib/sun3/miniroot/Makefile +++ /dev/null @@ -1,72 +0,0 @@ -# $NetBSD: Makefile,v 1.3.6.1 1996/08/29 03:24:24 gwr Exp $ - -TOP= ${.CURDIR}/.. - -# This include just sets REV=XX -.include "${TOP}/Makefile.inc" - -IMAGE= miniroot -CBIN= mini_usr - -TREE= ${TOP}/common/${IMAGE}.tree - -LISTS= ${TOP}/common/mini_sbin.list \ - ${TOP}/common/mini_bin.list \ - ${TOP}/common/${CBIN}.list \ - ${TOP}/common/mini_xx.list \ - ${TOP}/common/${IMAGE}.list - -KERNEL=${SRCSYSDIR}/arch/sun3/compile/GENERIC/netbsd - -MOUNT_POINT= /mnt -BDEV= /dev/sd2b -CDEV= /dev/rsd2b -#BDEV= /dev/sd0d -#CDEV= /dev/rsd0d - -# These are all the parameters for the miniroot: (8MB) -DISKTYPE= miniroot -NBLKS= 16384 -# old format, minfree, opt, b/i trks, sects, cpg -NEWFSARGS= -O -m 0 -o space -i 8192 -t 8 -u 32 -c 16 - -CLEANFILES= ${IMAGE}.gz install.sub - -${IMAGE}.gz: ${TREE} ${LISTS} ${CBIN} mini_xx install.sub - -newfs ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE} - mount ${BDEV} ${MOUNT_POINT} - mtree -def ${TREE} -p ${MOUNT_POINT}/ -u - TOPDIR=${TOP} CURDIR=${.CURDIR} \ - OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \ - sh ${TOP}/common/RunList.sh ${LISTS} - sync ; sleep 1 ; sync - cd ${MOUNT_POINT} ;\ - usr/mdec/installboot -v ufsboot usr/mdec/bootxx ${CDEV} - cp ${KERNEL} ${MOUNT_POINT}/netbsd - sync - @echo "" - @df -i ${MOUNT_POINT} - @echo "" - -umount ${MOUNT_POINT} - dd if=${CDEV} bs=16b count=`expr ${NBLKS} / 16` |\ - gzip > ${IMAGE}.tmp - -mv -f ${IMAGE}.tmp ${IMAGE}.gz - -# Do not delete this if I change my mind and kill make... -.PRECIOUS: ${IMAGE}.gz - -# Rules for making ${CBIN} ... -.include "${TOP}/common/Make.crunch" - -install.sub : ${TOP}/../miniroot/install.sub - sed -e "/^VERSION=/s/=.*/=${REV}/" < $? > $@ - -clean cleandir: clean_xx - -rm -f a.out core *.core *.o - -rm -f ${CLEANFILES} - -# Standard rules needed by the above... -.include <bsd.obj.mk> - -# Hacks for re-linking some program -static -.include "${TOP}/common/mini_xx.mk" diff --git a/distrib/sun3/ramdisk/Makefile b/distrib/sun3/ramdisk/Makefile index 278e1c30042..c98c1bfd343 100644 --- a/distrib/sun3/ramdisk/Makefile +++ b/distrib/sun3/ramdisk/Makefile @@ -1,70 +1,72 @@ -# $NetBSD: Makefile,v 1.3 1995/11/21 21:19:14 gwr Exp $ +# $OpenBSD: Makefile,v 1.5 1998/08/23 18:09:02 kstailey Exp $ +# $NetBSD: Makefile,v 1.1 1995/07/18 04:13:06 briggs Exp $ TOP= ${.CURDIR}/.. -# This include just sets REV=XX .include "${TOP}/Makefile.inc" +IMAGE= ramdisk-${REV}.fs +CRUNCHCONF?= ${.CURDIR}/${CBIN}.conf +BASE= ramdisk -IMAGE= ramdisk -CBIN= rd_bin +MOUNT_POINT= /mnt -TREE= ${TOP}/common/${IMAGE}.tree +VND?= svnd0 +VND_DEV= /dev/${VND}a +VND_RDEV= /dev/r${VND}a +VND_CRDEV= /dev/r${VND}c +PID!= echo $$$$ +REALIMAGE!= echo /var/tmp/image.${PID} -LISTS= ${TOP}/common/${CBIN}.list \ - ${TOP}/common/${IMAGE}.list +GZIP?= gzip +GZIPFLAGS?= -9f -KERNEL=${SRCSYSDIR}/arch/sun3/compile/RAMDISK/netbsd +all: ${CBIN} ${IMAGE} bsd.rd + @echo "all done" -MOUNT_POINT= /mnt -BDEV= /dev/rd0 -CDEV= /dev/rd0 - -# These are all the parameters for the root fs: (256K) -DISKTYPE= rdroot -NBLKS= 512 -# old format, minfree, opt, b/i trks, sects, cpg -NEWFSARGS= -O -m 0 -o space -i 2048 -t 2 -u 16 -c 16 - -CLEANFILES= netbsd-rd rdsetroot ${IMAGE}.fs - -netbsd-rd : rdsetroot ${IMAGE}.fs - cp ${KERNEL} netbsd-tmp - ./rdsetroot netbsd-tmp < ${IMAGE}.fs - -mv -f netbsd-tmp $@ - -rdsetroot: ${TOP}/common/rdsetroot.c - $(CC) -o $@ -DDEBUG ${TOP}/common/rdsetroot.c - -${IMAGE}.fs: ${TREE} ${LISTS} ${CBIN} - -newfs ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE} - mount ${BDEV} ${MOUNT_POINT} - mtree -def ${TREE} -p ${MOUNT_POINT}/ -u - TOPDIR=${TOP} CURDIR=${.CURDIR} \ - OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \ - sh ${TOP}/common/RunList.sh ${LISTS} - sync - @echo "" - @df -i ${MOUNT_POINT} - @echo "" - -umount ${MOUNT_POINT} - dd if=${CDEV} of=$@ count=${NBLKS} +install: bsd.rd + cp bsd.rd ${DESTDIR}/snapshot/bsd.rd + cp ${.CURDIR}/../HP-IB.geometry ${DESTDIR}/snapshot + +.include "Makefile.inc" -# Do not delete this if I change my mind and kill make... -.PRECIOUS: ${IMAGE}.fs +DISKTYPE= rdroot +NBLKS= 4096 +NEWFSARGS= -m 0 -o space -c 16 -i 3072 -# Rules for making ${CBIN} ... -.include "${TOP}/common/Make.crunch" +bsd.rd: ${IMAGE} bsd rdsetroot + ${.OBJDIR}/rdsetroot bsd < ${IMAGE} + ${GZIP} -c ${GZIPFLAGS} bsd > bsd.rd + rm bsd -# This is listed in rd_bin.conf but is built here. -${CBIN} : libhack.o +bsd: + cd ${.CURDIR}/../../../sys/arch/hp300/conf && config RAMDISK + cd ${.CURDIR}/../../../sys/arch/hp300/compile/RAMDISK && \ + make clean && make depend && make + cp ${.CURDIR}/../../../sys/arch/hp300/compile/RAMDISK/bsd bsd + +${IMAGE}: ${CBIN} rd_setup do_files rd_teardown + +rd_setup: ${CBIN} + dd if=/dev/zero of=${REALIMAGE} bs=512 count=${NBLKS} + vnconfig -v -c ${VND} ${REALIMAGE} + disklabel -w ${VND} ${DISKTYPE} + newfs ${NEWFSARGS} ${VND_RDEV} + fsck ${VND_RDEV} + mount ${VND_DEV} ${MOUNT_POINT} + +rd_teardown: + @df -i ${MOUNT_POINT} + -umount ${MOUNT_POINT} + -vnconfig -u ${VND} + cp ${REALIMAGE} ${IMAGE} + rm ${REALIMAGE} -# Use stubs to eliminate some large stuff from libc -HACKSRC=${TOP}/../utils/libhack -.include "${HACKSRC}/Makefile.inc" +rdsetroot: ${TOP}/../common/rdsetroot.c + ${HOSTCC} -DDEBUG -o rdsetroot ${TOP}/../common/rdsetroot.c -clean cleandir: - -rm -f a.out core *.core *.o - -rm -f ${CLEANFILES} +unconfig: + -umount -f ${MOUNT_POINT} + -vnconfig -u ${VND} + -/bin/rm -f ${IMAGE} -# Standard rules needed by the above... -.include <bsd.obj.mk> +.PRECIOUS: ${IMAGE} diff --git a/distrib/sun3/ramdisk/dot.instutils b/distrib/sun3/ramdisk/dot.instutils new file mode 100644 index 00000000000..49226630816 --- /dev/null +++ b/distrib/sun3/ramdisk/dot.instutils @@ -0,0 +1,155 @@ +# +# $OpenBSD: dot.instutils,v 1.1 1998/08/23 18:09:03 kstailey Exp $ +# $NetBSD: dot.instutils,v 1.1 1995/07/18 04:13:08 briggs Exp $ +# +# 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. +# + +# Installation configuration utilites (functions), to get OpenBSD configured +# reasonably once it is installed on the hard disk. These are meant to be +# invoked from the shell prompt, by people installing OpenBSD. + +Configure() +{ + DEV=/mnt/dev + ETC=/mnt/etc + + 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. le0, ie0, 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..." + cd ${DEV} + sh MAKEDEV all + echo " done." + + sync + + echo "You may now reboot your machine with the shutdown command." + echo " shutdown -r now" + echo "to reboot or" + echo " shutdown -h now" + echo "to halt." +} diff --git a/distrib/sun3/ramdisk/dot.profile b/distrib/sun3/ramdisk/dot.profile new file mode 100644 index 00000000000..68e2fd36629 --- /dev/null +++ b/distrib/sun3/ramdisk/dot.profile @@ -0,0 +1,86 @@ +# +# $OpenBSD: dot.profile,v 1.1 1998/08/23 18:09:04 kstailey Exp $ +# $NetBSD: dot.profile,v 1.1 1995/07/18 04:13:09 briggs Exp $ +# +# 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. +# + +export PATH=/sbin:/bin:/usr/bin:/usr/sbin:/ +export HISTFILE=/.sh_history +export TERM=sun +export HOME=/ + +umask 022 + +set -o emacs # emacs-style command line editing + +TMPWRITEABLE=/tmp/writeable + +if [ "X${DONEPROFILE}" = "X" ]; then + DONEPROFILE=YES + export DONEPROFILE + + # set up some sane defaults + echo 'erase ^H, werase ^W, kill ^U, intr ^C' + stty newcrt werase ^W intr ^C kill ^U erase ^H 9600 + echo '' + + echo 'Remounting /dev/rd0a as root...' + mount /dev/rd0a / + + # tell install.md we've done it + > ${TMPWRITEABLE} + + # pull in the functions that people will use from the shell prompt. + . /.commonutils + . /.instutils + + # Installing or upgrading? + _forceloop="" + while [ "X$_forceloop" = X"" ]; do + echo -n '(I)nstall, (U)pgrade, or (S)hell? ' + read _forceloop + case "$_forceloop" in + i*|I*) + /install + ;; + + u*|U*) + /upgrade + ;; + + s*|S*) + ;; + + *) + _forceloop="" + ;; + esac + done +fi diff --git a/distrib/sun3/ramdisk/install.md b/distrib/sun3/ramdisk/install.md new file mode 100644 index 00000000000..9e2ddecd7f5 --- /dev/null +++ b/distrib/sun3/ramdisk/install.md @@ -0,0 +1,480 @@ +#!/bin/sh +# +# $OpenBSD: install.md,v 1.1 1998/08/23 18:09:05 kstailey Exp $ +# $NetBSD: install.md,v 1.1.2.4 1996/08/26 15:45:14 gwr Exp $ +# +# Copyright (c) 1996 The NetBSD Foundation, Inc. +# All rights reserved. +# +# This code is derived from software contributed to The NetBSD Foundation +# by Jason R. Thorpe. +# +# 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 the NetBSD +# Foundation, Inc. and its contributors. +# 4. Neither the name of The NetBSD Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``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 REGENTS OR CONTRIBUTORS 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. +# + +# +# machine dependent section of installation/upgrade script +# + +# Machine-dependent install sets +MDSETS="kernel" + +TMPWRITEABLE=/tmp/writeable +KERNFSMOUNTED=/tmp/kernfsmounted + +md_set_term() { + echo -n "Specify terminal type [sun]: " + getresp "sun" + TERM="$resp" + export TERM + # set screensize (i.e., for an xterm) + rows=`stty -a | grep rows | awk '{print $4}'` + columns=`stty -a | grep columns | awk '{print $6}'` + if [ "$rows" -eq 0 -o "$columns" -eq 0 ]; then + echo -n "Specify terminal rows [25]: " + getresp "25" + rows="$resp" + + echo -n "Specify terminal columns [80]: " + getresp "80" + columns="$resp" + + stty rows "$rows" columns "$columns" + fi +} + +md_makerootwritable() { + + if [ -e ${TMPWRITEABLE} ] + then + md_mountkernfs + return + fi + if ! mount -t ffs -u /dev/rd0a / ; then + cat << \__rd0_failed_1 + +FATAL ERROR: Can't mount the ram filesystem. + +__rd0_failed_1 + exit + fi + + # Bleh. Give mount_mfs a chance to DTRT. + sleep 2 + > ${TMPWRITEABLE} + + md_mountkernfs +} + +md_mountkernfs() { + if [ -e ${KERNFSMOUNTED} ] + then + return + fi + if ! mount -t kernfs /kern /kern + then + cat << \__kernfs_failed_1 +FATAL ERROR: Can't mount kernfs filesystem +__kernfs_failed_1 + exit + fi + > ${KERNFSMOUNTED} +} + +md_machine_arch() { + cat /kern/machine +} + +md_get_diskdevs() { + # return available disk devices + egrep "^sd[0-9]*:.*cyl," < /kern/msgbuf | cut -d":" -f1 | sort -u +} + +md_get_cddevs() { + # return available CD-ROM devices + egrep "sd[0-9]*:.*CD-ROM" < /kern/msgbuf | cut -d":" -f1 | sort -u +} + +md_get_ifdevs() { + # return available network interfaces + egrep "^[il]e[0-9]*:" < /kern/msgbuf | cut -d":" -f1 | sort -u +} + +md_get_partition_range() { + # return range of valid partition letters + echo "[a-p]" +} + +md_installboot() { + # $1 is the root disk + + echo -n "Installing boot block..." + disklabel -W ${1} + disklabel -B ${1} + echo "done." +} + +md_checkfordisklabel() { + # $1 is the disk to check + local rval + + disklabel -r $1 > /dev/null 2> /tmp/checkfordisklabel + if grep "no disk label" /tmp/checkfordisklabel; then + rval=1 + elif grep "disk label corrupted" /tmp/checkfordisklabel; then + rval=2 + else + rval=0 + fi + + rm -f /tmp/checkfordisklabel + return $rval +} + +sun3_init_label_scsi_disk() { + # $1 is the disk to label + + # Name the disks we install in the temporary fstab. + if [ "X${_disk_instance}" = "X" ]; then + _disk_instance="0" + else + _disk_instance=`expr $_disk_instance + 1` + fi + _cur_disk_name="install-disk-${_disk_instance}" + + # Get geometry information from the user. + less << \__scsi_label_1 + +You will need to provide some information about your disk's geometry. +Geometry info for SCSI disks was printed at boot time. If that information +is not available, use the information provided in your disk's manual. +Please note that the geometry printed at boot time is preferred. + +IMPORTANT NOTE: due to a limitation in the disklabel(8) program, the +number of cylinders on the disk will be increased by 1 so that the initial +label can be placed on disk for editing. When the disklabel editor appears, +make absolutely certain you subtract 1 from the total number of cylinders, +and adjust the size of partition 'c' such that: + + size = (sectors per track) * (tracks per cyl) * (total cylinders) + +Note that the disklabel editor will be run twice; once to set the size of +partition 'c' and correct the geometry, and again so that you may correctly +edit the partition map. This is to work around the afore mentioned +limitation in disklabel(8). Apologies offered in advance. + +__scsi_label_1 + + # Give the opportunity to review the boot messages. + echo -n "Review boot messages now? [y] " + getresp "y" + case "$resp" in + y*|Y*) + less -rsS /kern/msgbuf + ;; + + *) + ;; + esac + + echo "" + echo -n "Number of bytes per disk sector? [512] " + getresp "512" + _secsize="$resp" + + resp="" # force one iteration + while [ "X${resp}" = "X" ]; do + echo -n "Number of cylinders? " + getresp "" + done + _cylinders="$resp" + _fudge_cyl=`expr $_cylinders + 1` + + resp="" # force one iteration + while [ "X${resp}" = "X" ]; do + echo -n "Number of tracks (heads)? " + getresp "" + done + _tracks_per_cyl="$resp" + + resp="" # force one iteration + while [ "X${resp}" = "X" ]; do + echo -n "Number of disk sectors (blocks)? " + getresp "" + done + _nsectors="$resp" + + # Calculate some values we need. + _sec_per_cyl=`expr $_nsectors / $_cylinders` + _sec_per_track=`expr $_sec_per_cyl / $_tracks_per_cyl` + _new_c_size=`expr $_sec_per_track \* $_tracks_per_cyl \* $_cylinders` + + # Emit a disktab entry, suitable for getting started. + # What we have is a `c' partition with the total number of + # blocks, and an `a' partition with 1 sector; just large enough + # to open. Don't ask. + echo "" >> /etc/disktab + echo "# Created by install" >> /etc/disktab + echo "${_cur_disk_name}:\\" >> /etc/disktab + echo -n " :ty=winchester:ns#${_sec_per_track}:" >> /etc/disktab + echo "nt#${_tracks_per_cyl}:nc#${_fudge_cyl}:\\" >> /etc/disktab + echo " :pa#1:\\" >> /etc/disktab + echo " :pc#${_nsectors}:" >> /etc/disktab + + # Ok, here's what we need to do. First of all, we install + # this initial label by opening the `c' partition of the disk + # and using the `-r' flag for disklabel(8). However, because + # of limitations in disklabel(8), we've had to fudge the number + # of cylinders up 1 so that disklabel(8) doesn't complain about + # `c' running past the end of the disk, which can be quite + # common even with OEM HP drives! So, we've given ourselves + # an `a' partition, which is the minimum needed to open the disk + # so that we can perform the DIOCWDLABEL ioctl. So, once the + # initial label is installed, we open the `a' partition so that + # we can fix up the number of cylinders and make the size of + # `c' come out to (ncyl * ntracks_per_cyl * nsec_per_track). + # After that's done, we re-open `c' and let the user actually + # edit the partition table. It's horrible, I know. Bleh. + + disklabel -W ${1} + if ! disklabel -r -w ${1} ${_cur_disk_name}; then + echo "" + echo "ERROR: can't bootstrap disklabel!" + rval="1" + return + fi + + echo "" + echo "The disklabel editor will now start. During this phase, you" + echo "must reset the 'cylinders' value to ${_cylinders}, and adjust" + echo "the size of partition 'c' to ${_new_c_size}. Do not modify" + echo "the partition map at this time. You will have the opportunity" + echo "to do so in a moment." + echo "" + echo -n "Press <return> to continue. " + getresp "" + + disklabel -W ${1} + if ! disklabel -r -e /dev/r${1}a; then + echo "" + echo "ERROR: can't fixup geometry!" + rval="1" + return + fi + + cat << \__explain_motives_2 + +Now that you have corrected the geometry of your disk, you may edit the +partition map. Don't forget to fill in the fsize (frag size), bsize +(filesystem block size), and cpg (cylinders per group) values. If you +are unsure what these should be, use: + + fsize: 1024 + bsize: 4096 + cpg: 16 + +__explain_motives_2 + echo -n "Press <return> to continue. " + getresp "" + + rval="0" + return +} + +md_labeldisk() { + # $1 is the disk to label + + # Check to see if there is a disklabel present on the device. + # If so, we can just edit it. If not, we must first install + # a default label. + md_checkfordisklabel $1 + case $? in + 0) + # Go ahead and just edit the disklabel. + disklabel -W $1 + disklabel -E $1 + ;; + + *) + echo -n "No disklabel present, installing a default for type: " + case "$1" in + sd*) + echo "SCSI" + sun3_init_label_scsi_disk $1 + ;; + + *) + # Shouldn't happen, but... + echo "unknown?! Giving up." + return; + ;; + esac + + # Check to see if installing the default was + # successful. If so, go ahead and pop into the + # disklabel editor. + if [ "X${rval}" != X"0" ]; then + echo "Sorry, can't label this disk." + echo "" + return; + fi + + # We have some defaults installed. Pop into + # the disklabel editor. + disklabel -W $1 + if ! disklabel -E $1; then + echo "" + echo "ERROR: couldn't set partition map for $1" + echo "" + fi + esac +} + +md_prep_disklabel() +{ + local _disk + + _disk=$1 + md_checkfordisklabel $_disk + case $? in + 0) + ;; + 1) + echo "WARNING: Disk $_disk has no label. You will be creating a new one." + echo + ;; + 2) + echo "WARNING: Label on disk $_disk is corrupted. You will be repairing." + echo + ;; + esac + + # display example + cat << \__md_prep_disklabel_1 + +If you are unsure of how to use multiple partitions properly +(ie. seperating /, /usr, /tmp, /var, /usr/local, and other things) +just split the space into a root and swap partition for now. +__md_prep_disklabel_1 + + disklabel -W ${_disk} + disklabel -E ${_disk} +} + +md_copy_kernel() { + if [ ! -s /mnt/bsd ]; then + echo "" + echo "Warning, no kernel installed!" + echo "You did not unpack a file set containing a kernel." + echo "This is needed to boot. Please note that the install" + echo "install kernel is not suitable for general use." + echo -n "Escape to shell add /mnt/bsd by hand? [y] " + getresp "y" + case "$resp" in + y*|Y*) + echo "Type 'exit' to return to install." + sh + ;; + *) + ;; + esac + fi +} + +# Note, while they might not seem machine-dependent, the +# welcome banner and the punt message may contain information +# and/or instructions specific to the type of machine. + +md_welcome_banner() { +( + if [ "$MODE" = "install" ]; then + echo "Welcome to the OpenBSD/sun3 ${VERSION_MAJOR}.${VERSION_MINOR} installation program." + cat << \__welcome_banner_1 + +This program is designed to help you put OpenBSD on your system in a +simple and rational way. +__welcome_banner_1 + + else + echo "Welcome to the OpenBSD/sun3 ${VERSION_MAJOR}.${VERSION_MINOR} upgrade program." + cat << \__welcome_banner_2 + +This program is designed to help you upgrade your OpenBSD system in a +simple and rational way. + +As a reminder, installing the `etc' binary set is NOT recommended. +Once the rest of your system has been upgraded, you should manually +merge any changes to files in the `etc' set into those files which +already exist on your system. + +__welcome_banner_2 + fi + +cat << \__welcome_banner_3 + +As with anything which modifies your disk's contents, this program can +cause SIGNIFICANT data loss, and you are advised to make sure your +data is backed up before beginning the installation process. + +Default answers are displayed in brackets after the questions. You +can hit Control-C at any time to quit, but if you do so at a prompt, +you may have to hit return. Also, quitting in the middle of +installation may leave your system in an inconsistent state. + +__welcome_banner_3 +) | less -E +} + +md_not_going_to_install() { + cat << \__not_going_to_install_1 + +OK, then. Enter 'halt' at the prompt to halt the machine. Once the +machine has halted, power-cycle the system to load new boot code. + +__not_going_to_install_1 +} + +md_congrats() { + cat << \__congratulations_1 + +CONGRATULATIONS! You have successfully installed OpenBSD! To boot the +installed system, enter halt at the command prompt. Once the system has +halted, power-cycle the machine in order to load new boot code. Make sure +you boot from the root disk. + +__congratulations_1 +} + +md_native_fstype() { + # Nothing to do. +} + +md_native_fsopts() { + # Nothing to do. +} diff --git a/distrib/sun3/ramdisk/list b/distrib/sun3/ramdisk/list new file mode 100644 index 00000000000..83e2bf3b045 --- /dev/null +++ b/distrib/sun3/ramdisk/list @@ -0,0 +1,96 @@ +# $OpenBSD: list,v 1.1 1998/08/23 18:09:06 kstailey Exp $ + +COPY ${OBJDIR}/raminst raminst +LINK raminst bin/cat +LINK raminst bin/chmod +LINK raminst bin/cp +LINK raminst bin/df +LINK raminst bin/dd +LINK raminst bin/ed +LINK raminst bin/expr +LINK raminst bin/ln +LINK raminst bin/ls +LINK raminst bin/kill +LINK raminst bin/hostname +LINK raminst bin/mkdir +LINK raminst bin/mv +LINK raminst bin/pwd +LINK raminst bin/rm +LINK raminst bin/sh +LINK bin/sh bin/-sh +LINK raminst bin/sleep +LINK raminst bin/stty +LINK raminst bin/sync +LINK raminst bin/test +LINK raminst bin/[ +LINK raminst sbin/disklabel +LINK raminst sbin/fsck +LINK raminst sbin/halt +LINK raminst sbin/ifconfig +LINK raminst sbin/init +LINK raminst sbin/mknod +LINK raminst usr/bin/more +LINK raminst sbin/mount +LINK raminst sbin/mount_cd9660 +LINK raminst sbin/mount_ffs +LINK raminst sbin/mount_kernfs +LINK raminst sbin/mount_nfs +LINK raminst sbin/mount_mfs +LINK raminst sbin/newfs +LINK raminst sbin/reboot +LINK raminst sbin/route +LINK raminst sbin/slattach +LINK raminst sbin/umount +LINK raminst usr/bin/awk +LINK raminst usr/bin/chgrp +LINK raminst usr/bin/cut +LINK raminst usr/bin/ftp +LINK raminst usr/bin/egrep +LINK raminst usr/bin/grep +LINK raminst usr/bin/gzip +LINK raminst usr/bin/less +LINK raminst usr/bin/sed +LINK raminst usr/bin/sort +LINK raminst bin/pax +LINK raminst usr/bin/tar +LINK raminst usr/bin/tip +LINK raminst usr/sbin/chat +LINK raminst usr/sbin/chown +LINK raminst usr/sbin/pppd +LINK raminst usr/bin/vi +SPECIAL /bin/rm raminst + +# copy the MAKEDEV script and make some devices +COPY ${DESTDIR}/dev/MAKEDEV dev/MAKEDEV +SPECIAL cd dev; sh MAKEDEV raminst + +# we need the contents of /usr/mdec (XXX) +COPY ${DESTDIR}/usr/mdec/uboot.lif usr/mdec/uboot.lif +LINK usr/mdec/uboot.lif usr/mdec/bootct +LINK usr/mdec/uboot.lif usr/mdec/boothd +LINK usr/mdec/uboot.lif usr/mdec/bootsd +LINK usr/mdec/uboot.lif usr/mdec/ctboot +LINK usr/mdec/uboot.lif usr/mdec/hdboot +LINK usr/mdec/uboot.lif usr/mdec/sdboot + +# various files that we need in /etc for the install +COPY rd.group etc/group +COPY rd.master.passwd etc/master.passwd +COPY rd.disktab etc/disktab +SPECIAL cd etc; pwd_mkdb -p -d . ./master.passwd + +# and the common installation tools +COPY ${TOPDIR}/common/dot.commonutils .commonutils +COPY ${TOPDIR}/common/termcap.hp-vt usr/share/misc/termcap + +# and the installation tools +COPY dot.profile .profile +COPY dot.instutils .instutils +COPY install.md install.md +COPY ${CURDIR}/../../miniroot/install.sh install +COPY ${CURDIR}/../../miniroot/upgrade.sh upgrade +SPECIAL sed -e "/^VERSION=/s/=.*/=${REV}/" < ${CURDIR}/../../miniroot/install.sub > install.sub +SPECIAL chmod 755 install upgrade + +# so DNS can work +SYMLINK /tmp/resolv.conf.shadow etc/resolv.conf diff --git a/distrib/sun3/ramdisk/mtree.conf b/distrib/sun3/ramdisk/mtree.conf new file mode 100644 index 00000000000..1c722be9415 --- /dev/null +++ b/distrib/sun3/ramdisk/mtree.conf @@ -0,0 +1,92 @@ +# +# $OpenBSD: mtree.conf,v 1.1 1998/08/23 18:09:06 kstailey Exp $ +# $NetBSD: mtree.conf,v 1.1 1995/07/18 04:13:24 briggs 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 +.. + +# ./kern +kern +# ./kern +.. + +# ./var +var + +# ./var/tmp +tmp + +# ./var +.. + +# ./ +.. + +# ./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 +.. diff --git a/distrib/sun3/ramdisk/raminst.conf b/distrib/sun3/ramdisk/raminst.conf new file mode 100644 index 00000000000..abc12b19358 --- /dev/null +++ b/distrib/sun3/ramdisk/raminst.conf @@ -0,0 +1,31 @@ +# +# $OpenBSD: raminst.conf,v 1.1 1998/08/23 18:09:07 kstailey Exp $ +# +# raminst.conf - unified binary for the RAM disk +# + +srcdirs bin sbin usr.bin/less usr.bin usr.sbin gnu/usr.bin usr.sbin/pppd +srcdirs usr.bin/vi + +progs awk cat chat chmod chown chroot cp cut dd df disklabel ed expr fsck_ffs +progs ftp grep gzip hostname ifconfig init kill less ln ls mkdir mknod mount +progs mount_cd9660 mount_ffs mount_kernfs mount_nfs +progs mv newfs pax ksh ping pppd pwd reboot rm route build +progs sed shutdown slattach sleep sort strings stty sync test tip umount +progs restore + +ln pax tar +ln pax cpio +ln chown chgrp +ln fsck_ffs fsck +ln ksh sh +ln ksh -sh # init invokes the shell this way +ln test [ +ln mount_ffs ffs +ln newfs mount_mfs +ln grep egrep +ln reboot halt +ln less more +ln build vi + +libs -ledit -lutil -lcurses -lcompat -lpcap -ll -lm -ltermlib diff --git a/distrib/sun3/ramdisk/rd.disktab b/distrib/sun3/ramdisk/rd.disktab new file mode 100644 index 00000000000..e3749a0e86a --- /dev/null +++ b/distrib/sun3/ramdisk/rd.disktab @@ -0,0 +1,16 @@ +# $OpenBSD: rd.disktab,v 1.1 1998/08/23 18:09:08 kstailey Exp $ +rdroot|ramdiskroot|RAM-disk root FS image:\ + :ty=ramdisk:se#512:nt#2:ns#128:nc#16:\ + :pa#4046:oa#0:ta=4.2BSD:ba#4096:fa#512:\ + :pb#0:ob#0:tb=swap:\ + :pc#4046:oc#0: +wren7|Seagate Wren 7:\ + :dt=SCSI:ty=winchester:\ + :nc#1632:ns#52:nt#15:\ + :se#512:\ + :rm#3600:\ + :pa#65520:oa#0:ta=4.2BSD:\ + :pb#65520:ob#65520:tb=swap:\ + :pc#1272960:oc#0:\ + :pd#65520:od#131040:td=4.2BSD:\ + :pg#1076400:og#196560:tg=4.2BSD: diff --git a/distrib/sun3/ramdisk/rd.group b/distrib/sun3/ramdisk/rd.group new file mode 100644 index 00000000000..f34dc51c7f7 --- /dev/null +++ b/distrib/sun3/ramdisk/rd.group @@ -0,0 +1,21 @@ +wheel:*:0:root +daemon:*:1:daemon +kmem:*:2:root +sys:*:3:root +tty:*:4:root +operator:*:5:root +bin:*:7: +news:*:8: +wsrc:*:9: +users:*:10: +games:*:13: +staff:*:20:root +guest:*:31:root +utmp:*:45: +www:*:67: +network:*:69: +named:*:70: +ingres:*:74:ingres +dialer:*:117: +nogroup:*:32766: +nobody:*:32767: diff --git a/distrib/sun3/ramdisk/rd.master.passwd b/distrib/sun3/ramdisk/rd.master.passwd new file mode 100644 index 00000000000..2a43ada99ce --- /dev/null +++ b/distrib/sun3/ramdisk/rd.master.passwd @@ -0,0 +1,7 @@ +root::0:0::0:0::/:/bin/sh +daemon:*:1:31::0:0::/:/bin/sh +operator:*:2:5::0:0::/:/bin/sh +bin:*:3:7::0:0::/:/bin/sh +uucp:*:66:1::0:0::/:/bin/sh +www:*:67:67::0:0::/:/bin/sh +named:*:70:70::0:0::/:/bin/sh diff --git a/distrib/sun3/runlist.sh b/distrib/sun3/runlist.sh new file mode 100644 index 00000000000..1fb1c61a636 --- /dev/null +++ b/distrib/sun3/runlist.sh @@ -0,0 +1,13 @@ +# $OpenBSD: runlist.sh,v 1.1 1998/08/23 18:08:56 kstailey Exp $ + +if [ "X$1" = "X-d" ]; then + SHELLCMD=cat + shift +else + SHELLCMD="sh" +fi + +( while [ "X$1" != "X" ]; do + cat $1 + shift +done ) | awk -f ${TOPDIR}/list2sh.awk | ${SHELLCMD} |