summaryrefslogtreecommitdiff
path: root/distrib/sun3
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-10-18 08:53:40 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-10-18 08:53:40 +0000
commitd6583bb2a13f329cf0332ef2570eb8bb8fc0e39c (patch)
treeece253b876159b39c620e62b6c9b1174642e070e /distrib/sun3
initial import of NetBSD tree
Diffstat (limited to 'distrib/sun3')
-rw-r--r--distrib/sun3/Makefile5
-rw-r--r--distrib/sun3/Makefile.inc10
-rw-r--r--distrib/sun3/common/Make.crunch20
-rw-r--r--distrib/sun3/common/Make.fsimage42
-rw-r--r--distrib/sun3/common/Makefile.inc31
-rw-r--r--distrib/sun3/common/RunList.awk39
-rw-r--r--distrib/sun3/common/RunList.sh14
-rw-r--r--distrib/sun3/common/dot.cmnutils110
-rw-r--r--distrib/sun3/common/install.sh280
-rw-r--r--distrib/sun3/common/mini_bin.list39
-rw-r--r--distrib/sun3/common/mini_sbin.list38
-rw-r--r--distrib/sun3/common/mini_usr.conf25
-rw-r--r--distrib/sun3/common/mini_usr.list42
-rw-r--r--distrib/sun3/common/miniroot.list41
-rw-r--r--distrib/sun3/common/miniroot.tree74
-rw-r--r--distrib/sun3/common/mr.disktab32
-rw-r--r--distrib/sun3/common/mr.etc.rc9
-rw-r--r--distrib/sun3/common/mr.instutils148
-rw-r--r--distrib/sun3/common/mr.profile52
-rw-r--r--distrib/sun3/common/mr.termcap91
-rw-r--r--distrib/sun3/common/ramdisk.list21
-rw-r--r--distrib/sun3/common/ramdisk.tree39
-rw-r--r--distrib/sun3/common/rd.disktab2
-rw-r--r--distrib/sun3/common/rd.fstab2
-rw-r--r--distrib/sun3/common/rd.passwd1
-rw-r--r--distrib/sun3/common/rd.protocols6
-rw-r--r--distrib/sun3/common/rd.services56
-rw-r--r--distrib/sun3/common/rd.sshrc4
-rw-r--r--distrib/sun3/common/rd.welcome24
-rw-r--r--distrib/sun3/common/rd_bin.conf83
-rw-r--r--distrib/sun3/common/rd_bin.list44
-rw-r--r--distrib/sun3/common/rdsetroot.c230
-rw-r--r--distrib/sun3/miniroot/Makefile57
-rw-r--r--distrib/sun3/ramdisk/Findrefs12
-rw-r--r--distrib/sun3/ramdisk/Makefile61
-rw-r--r--distrib/sun3/ramdisk/Showsyms9
36 files changed, 1793 insertions, 0 deletions
diff --git a/distrib/sun3/Makefile b/distrib/sun3/Makefile
new file mode 100644
index 00000000000..0a317598577
--- /dev/null
+++ b/distrib/sun3/Makefile
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.2 1995/10/12 21:16:53 gwr Exp $
+
+SUBDIR= miniroot ramdisk
+
+.include <bsd.subdir.mk>
diff --git a/distrib/sun3/Makefile.inc b/distrib/sun3/Makefile.inc
new file mode 100644
index 00000000000..69f3e1e8cc7
--- /dev/null
+++ b/distrib/sun3/Makefile.inc
@@ -0,0 +1,10 @@
+# $NetBSD: Makefile.inc,v 1.2 1995/10/13 16:01:02 gwr Exp $
+
+# Revision is 1.1
+REV= 11
+
+LDSTATIC= -static
+
+# Hack needed to find kernel images...
+BSDSRCDIR?= /usr/src
+SRCSYSDIR?= ${BSDSRCDIR}/sys
diff --git a/distrib/sun3/common/Make.crunch b/distrib/sun3/common/Make.crunch
new file mode 100644
index 00000000000..b89e7576c2c
--- /dev/null
+++ b/distrib/sun3/common/Make.crunch
@@ -0,0 +1,20 @@
+# $NetBSD: Make.crunch,v 1.2 1995/10/13 16:38:20 gwr Exp $
+#
+# This is included by subdirectories building a crunched binary.
+# Assume the following are already defined: TOP, CBIN
+
+CBIN?= xxx-crunched
+CRUNCHCONF= ${TOP}/common/${CBIN}.conf
+
+CLEANFILES+= ${CBIN} ${CBIN}.c ${CBIN}.cache ${CBIN}.mk ${CBIN}.syms
+CLEANFILES+= *.lo *_stub.o *_stub.c
+
+# Keep a copy that is not stripped so I can debug...
+${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
+ make -f ${CBIN}.mk all STRIP=true
+ cp -p ${CBIN} ${CBIN}.syms
+ strip ${CBIN}
+
+${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
+ crunchgen ${CRUNCHCONF}
+
diff --git a/distrib/sun3/common/Make.fsimage b/distrib/sun3/common/Make.fsimage
new file mode 100644
index 00000000000..53c19d6d192
--- /dev/null
+++ b/distrib/sun3/common/Make.fsimage
@@ -0,0 +1,42 @@
+#
+# $NetBSD: Make.fsimage,v 1.2 1995/10/13 16:38:26 gwr Exp $
+#
+
+# TOP is assumed to be defined by Makefile including this one.
+# These will be defined by it too:
+
+IMAGE?= xxx-${REV}
+CBIN?= xxx-crunched
+
+TREE?= ${.CURDIR}/${CBIN}.tree
+LISTS?= ${.CURDIR}/${CBIN}.list
+
+MOUNT_POINT?= /mnt
+DISKTYPE?= xxx-disktype
+BDEV?= /dev/rd0
+CDEV?= /dev/rd0
+
+IMAGE_DEPS?= ${CBIN}
+CLEANFILES+= ${IMAGE}.fs
+
+# These are all the parameters for the root fs:
+NBLKS?= 512
+# args: old fmt, minfree, opt, ...
+NEWFSARGS?= -O -m 0 -o space
+
+do_mount:
+ -newfs ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE}
+ mount ${BDEV} ${MOUNT_POINT}
+
+do_files:
+ mtree -def ${TREE} -p ${MOUNT_POINT}/ -u
+ TOPDIR=${TOP} CURDIR=${.CURDIR} \
+ OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
+ sh ${TOP}/common/RunList.sh ${LISTS}
+
+do_umount:
+ @echo ""
+ @df -i ${MOUNT_POINT}
+ @echo ""
+ -umount ${MOUNT_POINT}
+
diff --git a/distrib/sun3/common/Makefile.inc b/distrib/sun3/common/Makefile.inc
new file mode 100644
index 00000000000..69eb1490626
--- /dev/null
+++ b/distrib/sun3/common/Makefile.inc
@@ -0,0 +1,31 @@
+#
+# $NetBSD: Makefile.inc,v 1.1.1.1 1995/10/08 23:07:45 gwr Exp $
+#
+
+# TOP is assumed to be defined by Makefile including this one.
+
+CBIN?= instbin
+COMMONDIR= ${TOP}/common
+
+MOUNT_POINT?= /mnt
+BDEV?= /dev/rd0
+DISKTYPE?= xxx-disktype
+IMAGE?= xxx-${REV}.fs
+MDEC= ${DESTDIR}/usr/mdec
+
+LISTS= ${.CURDIR}/list
+MTREE= ${.CURDIR}/mtree.conf
+
+fsimage:
+ newfs -O -m 0 -o space -i 3052 -c 60 ${BDEV} ${DISKTYPE}
+ mount ${BDEV} ${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}
+
+.include <bsd.obj.mk>
+.include <bsd.subdir.mk>
diff --git a/distrib/sun3/common/RunList.awk b/distrib/sun3/common/RunList.awk
new file mode 100644
index 00000000000..e404a702c60
--- /dev/null
+++ b/distrib/sun3/common/RunList.awk
@@ -0,0 +1,39 @@
+# $NetBSD: RunList.awk,v 1.1.1.1 1995/10/08 23:07:46 gwr 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 == "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/common/RunList.sh b/distrib/sun3/common/RunList.sh
new file mode 100644
index 00000000000..380cd2512bd
--- /dev/null
+++ b/distrib/sun3/common/RunList.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# $NetBSD: RunList.sh,v 1.1.1.1 1995/10/08 23:07:47 gwr Exp $
+
+if [ "X$1" = "X-d" ]; then
+ SHELLCMD=cat
+ shift
+else
+ SHELLCMD="sh -e"
+fi
+
+cat "$@" |
+awk -f ${TOPDIR}/common/RunList.awk |
+${SHELLCMD}
diff --git a/distrib/sun3/common/dot.cmnutils b/distrib/sun3/common/dot.cmnutils
new file mode 100644
index 00000000000..cea610a4478
--- /dev/null
+++ b/distrib/sun3/common/dot.cmnutils
@@ -0,0 +1,110 @@
+#
+# $NetBSD: dot.cmnutils,v 1.1.1.1 1995/10/08 23:07:50 gwr 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 utilites (functions), to get NetBSD installed on
+# the hard disk. These are meant to be invoked from the shell prompt,
+# by people installing NetBSD.
+
+Set_tmp_dir()
+{
+ def_tmp_dir=`pwd`
+ if [ "$def_tmp_dir" = "/" -o "$def_tmp_dir" = "/mnt" ]; then
+ def_tmp_dir=/mnt/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_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 xvfp /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
+ echo -n "Are you installing a '-current' snapshot? [n] "
+ read snapshot
+ case $snapshot in
+ y*|Y*)
+ snapshot=y
+ ;;
+ *)
+ snapshot=n
+ ;;
+ esac
+ if [ $snapshot = n ]
+ then
+ cat "$1".??? | gunzip | (cd / ; tar xfp$tarverbose -)
+ else
+ cat "$1".tar.gz | gunzip | (cd /mnt ; tar xfp$tarverbose -)
+ fi
+}
diff --git a/distrib/sun3/common/install.sh b/distrib/sun3/common/install.sh
new file mode 100644
index 00000000000..c687b726bb3
--- /dev/null
+++ b/distrib/sun3/common/install.sh
@@ -0,0 +1,280 @@
+#!/bin/sh
+#
+# $NetBSD: install.sh,v 1.1.1.1 1995/10/08 23:07:50 gwr 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.
+#
+
+# NetBSD installation script.
+# In a perfect world, this would be a nice C program, with a reasonable
+# user interface.
+
+FSTABDIR=/mnt/etc # /mnt/etc
+#DONTDOIT=echo
+
+VERSION=1.0
+FSTAB=${FSTABDIR}/fstab
+
+getresp() {
+ read resp
+ if [ "X$resp" = "X" ]; then
+ resp=$1
+ fi
+}
+
+getvar() {
+ echo $(eval $(echo "echo \$$1"))
+}
+
+shiftvar() {
+ local - var
+ var="$1"
+ list="$(getvar $var)"
+ set -- $list
+ shift
+ setvar $var "$*"
+}
+
+getparts() {
+ disklabel $1 2>/dev/null | sed -e '/^[ ][ ][ad-p]/!d' |
+ sed -e 's,^[ ]*\([a-p]\):[ ]*[0-9]*[ ]*[0-9]*[ ][ ]*\([a-zA-Z0-9.]*\).*,\1 \2,' |
+ sed -e ':a
+ N;${s/\n/ /g;p;d;}
+ ba'
+}
+
+getdrives() {
+ local du thispart
+ for du in /dev/r${drivetype}?a; do
+ dd if=$du of=/dev/null bs=1b count=1 >/dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ thisunit=`echo $du | sed -e 's,/dev/r\(...\)a,\1,g'`
+ driveunits="$driveunits $thisunit"
+ else
+ continue;
+ fi
+ setvar $thisunit "$(getparts $thisunit)"
+ export $thisunit
+ done
+ export drivenunits
+}
+
+prepdrive() {
+ echo "which drive would you like to prepare next?"
+ echo "choices are: ${driveunits}"
+ echo ""
+ getresp
+ case $resp in
+ *) ;;
+ esac
+}
+
+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. Its main objective is to format,"
+echo "mount and create an fstab for your root (/) and user (/usr)"
+echo "partitions."
+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 "scanning for the root device"
+ ;;
+ *)
+ echo '
+OK, then. Enter "halt" at the prompt to halt the machine.
+If you have set the default boot device using the "eeprom"
+command, you can use the "reboot" command now. Otherwise,
+you may need to specify a boot device for the PROM monitor.'
+ exit
+ ;;
+esac
+
+drivetype=sd
+sect_fwd=""
+
+# find out what units are possible for that disk, and query the user.
+getdrives
+for du in $driveunits; do
+ set -- $(getvar $du)
+ if [ $# -ge 2 -a "$1" = "a" -a "`echo $2 | sed -e 's,.*BSD.*,BSD,'`" = "BSD" ]; then
+ rdev=$du
+ fi
+done
+
+echo ""
+echo "The root device you have chosen is on: ${rdev}"
+echo ""
+# 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
+
+echo ""
+echo "THIS IS YOUR LAST CHANCE!!!"
+echo ""
+echo "(answering yes will format your root partition on $rdev)"
+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 ""
+ answer=yes
+ ;;
+ no|NO)
+ echo '
+OK, then. enter "halt" or "reboot" at the prompt.'
+ exit
+ ;;
+ *)
+ echo -n "I want a yes or no answer... well? "
+ ;;
+ esac
+done
+echo "Initializing / (root) filesystem, and mounting..."
+$DONTDOIT newfs /dev/r${rdev}a $name
+$DONTDOIT mount_ffs /dev/${rdev}a /mnt
+echo ""
+echo -n "Creating a fstab..."
+mkdir -p $FSTABDIR
+echo "/dev/${rdev}a / ffs rw 1 1" > $FSTAB
+
+# get rid of this partition
+shiftvar $rdev
+shiftvar $rdev
+
+echo ""
+echo "Now lets setup your /usr file system"
+echo "(Once a valid input for drive and partition is seen"
+echo "it will be FORMATTED and inserted in the fstab.)"
+while [ "X$usrpart" = "X" ]; do
+ resp=""
+ drivename=""
+ while [ "X$resp" = "X" ]; do
+ echo "choices: $driveunits"
+ echo "which drive do you want /usr on?"
+ getresp
+ set -- $driveunits
+ while [ $# -gt 0 ]; do
+ if [ "X$resp" = "X$1" ]; then
+ drivename=$1
+ break;
+ else
+ shift
+ fi
+ done
+ if [ "X$drivename" != "X" ]; then
+ break
+ fi
+ done
+
+ usrpart=""
+ echo "You have selected $drivename"
+ echo "here is a list of partitions on $drivename"
+ disklabel $drivename 2>/dev/null | sed -e '/^[ ][ ][ad-p]:/p;/^#[ \t]*size/p;d'
+ echo "which partition would you like to format and have"
+ echo -n "mounted as /usr? (supply the letter): "
+ getresp
+ if [ "X$resp" = "X" ]; then
+ continue;
+ fi
+
+ list=$(getvar $drivename)
+ set -- $list
+ while [ $# -gt 0 ]; do
+ if [ "$resp" = "$1" ]; then
+ if [ "`echo $2 | sed -e 's,.*BSD.*,BSD,'`" != "BSD" ]; then
+ echo ""
+ echo -n "$drivename$resp is of type $2 which is not"
+ echo " a BSD filesystem type"
+ break
+ fi
+ usrpart=$drivename$resp
+ break
+ else
+ shift
+ shift
+ fi
+ done
+ if [ "X$usrpart" = "X" ]; then
+ echo "$resp is not a valid input."
+ echo ""
+ fi
+done
+
+echo ""
+echo "Initializing /usr filesystem, and mounting..."
+$DONTDOIT newfs /dev/r${usrpart} $name
+$DONTDOIT mkdir -p /mnt/usr
+$DONTDOIT mount_ffs /dev/${usrpart} /mnt/usr
+echo ""
+echo -n "Adding to fstab..."
+echo "/dev/${usrpart} /usr ffs rw 1 2" >> $FSTAB
+sync
+echo " done."
+
+echo '
+You might want to set the PROM default boot device.
+The current settings can be examined using:
+ eeprom bootdev
+ eeprom default_boot
+and they can be modified by adding "=value" i.e.:
+ eeprom bootdev=sd(0,0,0)
+ eeprom default_boot=true
+'
+
+echo '
+OK! The preliminary work of setting up your disk is now complete,
+and you can install the actual NetBSD software.
+
+Right now, your root is mounted on /mnt and your usr on /mnt/usr.
+You should consult the installation notes to determine how to load
+and install the NetBSD distribution sets, and how to configure your
+system when you are done.
+
+GOOD LUCK!
+'
diff --git a/distrib/sun3/common/mini_bin.list b/distrib/sun3/common/mini_bin.list
new file mode 100644
index 00000000000..0d10ae1d43b
--- /dev/null
+++ b/distrib/sun3/common/mini_bin.list
@@ -0,0 +1,39 @@
+#
+# $NetBSD: mini_bin.list,v 1.1.1.1 1995/10/08 23:07:48 gwr Exp $
+#
+
+# miniroot files from /bin:
+
+# Note: /bin/rcp is handled in mini_usr.list (crunched with rsh)
+# Everything else here is just copied from ${DESTDIR}
+
+COPY ${DESTDIR}/bin/cat bin
+COPY ${DESTDIR}/bin/chmod bin
+COPY ${DESTDIR}/bin/cp bin
+# COPY ${DESTDIR}/bin/csh bin
+COPY ${DESTDIR}/bin/date bin
+COPY ${DESTDIR}/bin/dd bin
+COPY ${DESTDIR}/bin/df bin
+COPY ${DESTDIR}/bin/echo bin
+COPY ${DESTDIR}/bin/ed bin
+COPY ${DESTDIR}/bin/expr bin
+COPY ${DESTDIR}/bin/kill bin
+COPY ${DESTDIR}/bin/ln bin
+COPY ${DESTDIR}/bin/ls bin
+COPY ${DESTDIR}/bin/mkdir bin
+COPY ${DESTDIR}/bin/mt bin
+COPY ${DESTDIR}/bin/mv bin
+COPY ${DESTDIR}/bin/pax bin
+COPY ${DESTDIR}/bin/ps bin
+COPY ${DESTDIR}/bin/pwd bin
+# COPY ${DESTDIR}/bin/rcp # See mini_usr.list
+COPY ${DESTDIR}/bin/rm bin
+
+COPY ${DESTDIR}/bin/rmdir bin
+COPY ${DESTDIR}/bin/sh bin
+COPY ${DESTDIR}/bin/stty bin
+COPY ${DESTDIR}/bin/sync bin
+
+COPY ${DESTDIR}/bin/test bin
+LINK bin/test bin/[
+
diff --git a/distrib/sun3/common/mini_sbin.list b/distrib/sun3/common/mini_sbin.list
new file mode 100644
index 00000000000..9325fa7ef0a
--- /dev/null
+++ b/distrib/sun3/common/mini_sbin.list
@@ -0,0 +1,38 @@
+#
+# $NetBSD: mini_sbin.list,v 1.1.1.1 1995/10/08 23:07:50 gwr Exp $
+#
+
+# XXX - Need these? ping,
+
+# miniroot files from /sbin:
+
+COPY ${DESTDIR}/sbin/disklabel sbin
+COPY ${DESTDIR}/sbin/dmesg sbin
+
+COPY ${DESTDIR}/sbin/edlabel sbin
+
+COPY ${DESTDIR}/sbin/fsck sbin
+COPY ${DESTDIR}/sbin/ifconfig sbin
+COPY ${DESTDIR}/sbin/init sbin
+COPY ${DESTDIR}/sbin/mknod sbin
+
+COPY ${DESTDIR}/sbin/mount sbin
+COPY ${DESTDIR}/sbin/mount_cd9660 sbin
+COPY ${DESTDIR}/sbin/mount_ffs sbin
+LINK sbin/mount_ffs sbin/mount_ufs
+
+COPY ${DESTDIR}/sbin/mount_nfs sbin
+COPY ${DESTDIR}/sbin/newfs sbin
+COPY ${DESTDIR}/sbin/ping sbin
+COPY ${DESTDIR}/sbin/reboot sbin
+LINK sbin/reboot sbin/halt
+
+COPY ${DESTDIR}/sbin/restore sbin
+LINK sbin/restore sbin/rrestore
+
+COPY ${DESTDIR}/sbin/route sbin
+COPY ${DESTDIR}/sbin/shutdown sbin
+COPY ${DESTDIR}/sbin/slattach sbin
+COPY ${DESTDIR}/sbin/swapon sbin
+COPY ${DESTDIR}/sbin/umount sbin
+
diff --git a/distrib/sun3/common/mini_usr.conf b/distrib/sun3/common/mini_usr.conf
new file mode 100644
index 00000000000..46223f0608c
--- /dev/null
+++ b/distrib/sun3/common/mini_usr.conf
@@ -0,0 +1,25 @@
+#
+# $NetBSD: mini_usr.conf,v 1.1.1.1 1995/10/08 23:07:50 gwr Exp $
+#
+# common/mini_usr.conf
+#
+# The only real purpose of this crunched binary is to
+# provide statically linked versions of some programs
+# that would normally reside in usr/bin or usr/sbin.
+# A few related ones are thrown in to save space:
+# chgrp, rcp
+#
+
+srcdirs /usr/src/bin /usr/src/sbin /usr/src/usr.bin /usr/src/usr.sbin
+
+progs chown chroot cksum cmp eeprom ftp more printf
+progs rcp rsh sed strings tftp tip update
+
+ln chown chgrp
+
+# These are linked -static so they are not needed here.
+# srcdirs /usr/src/gnu/usr.bin
+# progs gzip, tar
+# ln gzip gzcat gunzip
+
+libs -ltermcap
diff --git a/distrib/sun3/common/mini_usr.list b/distrib/sun3/common/mini_usr.list
new file mode 100644
index 00000000000..268a18569bf
--- /dev/null
+++ b/distrib/sun3/common/mini_usr.list
@@ -0,0 +1,42 @@
+#
+# $NetBSD: mini_usr.list,v 1.1.1.1 1995/10/08 23:07:46 gwr Exp $
+#
+
+# copy the crunched binary, link to it, and kill it
+
+COPY ${OBJDIR}/mini_usr mini_usr
+
+# Note: On the miniroot, /usr is part of the root fs,
+# so we can just make a link for /bin/rcp
+LINK mini_usr bin/rcp
+
+# usr/sbin:
+
+LINK mini_usr usr/sbin/chown
+LINK mini_usr usr/sbin/chroot
+LINK mini_usr usr/sbin/eeprom
+LINK mini_usr usr/sbin/update
+
+# usr/bin:
+
+LINK mini_usr usr/bin/chgrp
+LINK mini_usr usr/bin/cksum
+LINK mini_usr usr/bin/cmp
+LINK mini_usr usr/bin/ftp
+LINK mini_usr usr/bin/more
+LINK mini_usr usr/bin/printf
+LINK mini_usr usr/bin/rsh
+LINK mini_usr usr/bin/sed
+LINK mini_usr usr/bin/strings
+LINK mini_usr usr/bin/tftp
+LINK mini_usr usr/bin/tip
+
+SPECIAL rm mini_usr
+
+# These are linked statically, so just copy from ${DESTDIR}:
+
+COPY ${DESTDIR}/usr/bin/tar usr/bin
+COPY ${DESTDIR}/usr/bin/gzip usr/bin
+LINK usr/bin/gzip usr/bin/gunzip
+LINK usr/bin/gzip usr/bin/gzcat
+
diff --git a/distrib/sun3/common/miniroot.list b/distrib/sun3/common/miniroot.list
new file mode 100644
index 00000000000..008b928a31f
--- /dev/null
+++ b/distrib/sun3/common/miniroot.list
@@ -0,0 +1,41 @@
+# $NetBSD: miniroot.list,v 1.1.1.1 1995/10/08 23:07:48 gwr Exp $
+
+# From usr/mdec:
+COPY ${DESTDIR}/usr/mdec/bootxx usr/mdec
+COPY ${DESTDIR}/usr/mdec/installboot usr/mdec
+COPY ${DESTDIR}/usr/mdec/netboot usr/mdec
+COPY ${DESTDIR}/usr/mdec/ufsboot usr/mdec
+LINK usr/mdec/ufsboot ufsboot
+# XXX - How to do installboot?
+
+# various files that we need in /etc for the install
+COPY ${DESTDIR}/etc/disktab etc
+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
+
+# copy the MAKEDEV script and make some devices
+COPY ${DESTDIR}/dev/MAKEDEV dev/MAKEDEV
+SPECIAL cd dev; sh MAKEDEV std rd0 sd0 sd2 st0
+SPECIAL /bin/rm dev/MAKEDEV
+SPECIAL mkfifo dev/pipe
+
+# and the common installation tools
+COPY ${TOPDIR}/common/dot.cmnutils .cmnutils
+
+# the disktab explanation file (XXX need this?)
+# COPY ${TOPDIR}/common/mr.disktab etc/disktab.preinstall
+
+# and the miniroot installation tools
+COPY ${TOPDIR}/common/mr.instutils .instutils
+COPY ${TOPDIR}/common/mr.profile .profile
+COPY ${TOPDIR}/common/mr.termcap usr/share/misc/termcap
+
+# and the "install" command
+COPY ${TOPDIR}/common/install.sh install
+SPECIAL chmod 755 install
+
diff --git a/distrib/sun3/common/miniroot.tree b/distrib/sun3/common/miniroot.tree
new file mode 100644
index 00000000000..9e66a282636
--- /dev/null
+++ b/distrib/sun3/common/miniroot.tree
@@ -0,0 +1,74 @@
+#
+# $NetBSD: miniroot.tree,v 1.1.1.1 1995/10/08 23:07:47 gwr 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
+..
diff --git a/distrib/sun3/common/mr.disktab b/distrib/sun3/common/mr.disktab
new file mode 100644
index 00000000000..91768474fad
--- /dev/null
+++ b/distrib/sun3/common/mr.disktab
@@ -0,0 +1,32 @@
+#
+# $NetBSD: mr.disktab,v 1.1.1.1 1995/10/08 23:07:47 gwr Exp $
+#
+# 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)
+#
diff --git a/distrib/sun3/common/mr.etc.rc b/distrib/sun3/common/mr.etc.rc
new file mode 100644
index 00000000000..272302f54b3
--- /dev/null
+++ b/distrib/sun3/common/mr.etc.rc
@@ -0,0 +1,9 @@
+#!/bin/sh
+# $NetBSD: mr.etc.rc,v 1.2 1995/10/13 16:38:27 gwr Exp $
+
+# This is run by /sbin/init as:
+# /bin/sh /etc/rc
+# Just force init to go single-user...
+
+echo "/etc/rc: miniroot forces single-user mode..."
+exit 1
diff --git a/distrib/sun3/common/mr.instutils b/distrib/sun3/common/mr.instutils
new file mode 100644
index 00000000000..9d509f857fe
--- /dev/null
+++ b/distrib/sun3/common/mr.instutils
@@ -0,0 +1,148 @@
+#
+# $NetBSD: mr.instutils,v 1.1.1.1 1995/10/08 23:07:46 gwr 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 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=/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. 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..."
+ cd ${DEV}
+ sh MAKEDEV all
+ echo " done."
+
+ sync
+}
diff --git a/distrib/sun3/common/mr.profile b/distrib/sun3/common/mr.profile
new file mode 100644
index 00000000000..8aa3bafd9cc
--- /dev/null
+++ b/distrib/sun3/common/mr.profile
@@ -0,0 +1,52 @@
+#
+# $NetBSD: mr.profile,v 1.1.1.1 1995/10/08 23:07:47 gwr 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.
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:/
+export PATH
+TERM=ansi
+export TERM
+
+# set up some sane defaults
+echo 'erase ^?, werase ^H, kill ^U, intr ^C'
+stty newcrt werase '^H' intr '^C' kill '^U' erase '^?'
+echo ''
+
+# start running update, so that installed software is written as it goes.
+update
+
+# pull in the function definitions that people will use from the shell prompt.
+. /.cmnutils
+. /.instutils
+
+# run the installation script.
+umask 022
+install
diff --git a/distrib/sun3/common/mr.termcap b/distrib/sun3/common/mr.termcap
new file mode 100644
index 00000000000..360e98bcfc7
--- /dev/null
+++ b/distrib/sun3/common/mr.termcap
@@ -0,0 +1,91 @@
+#
+# $NetBSD: mr.termcap,v 1.1.1.1 1995/10/08 23:07:47 gwr Exp $
+#
+
+#
+# Customized for installation on Sun machines.
+#
+
+dumb:\
+ :am:\
+ :co#80:\
+ :bl=^G:cr=^M:do=^J:sf=^J:
+unknown:\
+ :gn:\
+ :tc=dumb:
+other|none of the above, but not exactly unknown:\
+ :am:gn:\
+ :co#80:\
+ :cl=^M^J:do=^J:ho=^M:
+
+arpanet|bussiplexer|dialup|ethernet|network|net|patch|plugboard|switch|network switch or dialup:\
+ :tc=unknown:
+lpr|printer|print|printing|line printer:\
+ :hc:os:\
+ :co#132:li#66:\
+ :bl=^G:cr=^M:do=^J:ff=^L:le=^H:sf=^J:
+
+#### ANSI terminals and terminal emulators
+#
+# See near the end of this file for details on ANSI conformance.
+# Don't mess with these entries! Lots of other entries depend on them!
+#
+
+# (ansi: changed ":pt:" to ":it#8:" -- esr)
+ansi|any ansi terminal with pessimistic assumptions:\
+ :am:bs:\
+ :co#80:it#8:li#24:\
+ :ce=\E[K:cl=\E[;H\E[2J:cm=\E[%i%d;%dH:do=\E[B:\
+ :ho=\E[H:le=\E[D:nd=\E[C:up=\E[A:
+#
+vt100|dec-vt100|vt100-am|vt100am|dec vt100:\
+ :bl=^G:cr=^M:it#8:\
+ :do=^J:co#80:li#24:cl=50\E[;H\E[2J:sf=2*\ED:\
+ :le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:cb=3\E[1K:\
+ :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\
+ :md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:is=\E[1;24r\E[24;1H:\
+ :if=/usr/share/tabset/vt100:\
+ :rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\
+ :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
+ :ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=2*\EM:vt#3:xn:\
+ :sc=\E7:rc=\E8:cs=\E[%i%d;%dr:
+#
+sun|Sun Microsystems Workstation console:\
+ :am:bs:km:mi:ms:pt:\
+ :co#80:it#8:li#34:\
+ :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:IC=\E[%d@:al=\E[L:\
+ :bl=^G:cd=\E[J:ce=\E[K:cl=^L:cm=\E[%i%d;%dH:cr=^M:\
+ :dc=\E[P:dl=\E[M:do=\E[B:ei=:ic=\E[@:im=:is=\E[1r:\
+ :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:kd=\E[B:kh=\E[H:\
+ :kl=\E[D:kr=\E[C:ku=\E[A:le=^H:nd=\E[C:rs=\E[1r:\
+ :se=\E[m:sf=^J:so=\E[7m:ta=^I:up=\E[A:
+#
+xterm|vs100|xterm terminal emulator (X11R6 Window System):\
+ :am:bs:km:mi:ms:pt:xn:xo:\
+ :co#80:it#8:li#65:\
+ :@7=\E[[:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:F1=\E[23~:\
+ :F2=\E[24~:IC=\E[%d@:LE=\E[%dD:UP=\E[%dA:\
+ :ac=++\054\054..00II--``aaffgghhjjkkllmmnnooqqssttuuvvwwxx~~:\
+ :ae=\E(B:al=\E[L:as=\E(0:bl=^G:cd=\E[J:ce=\E[K:\
+ :cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:\
+ :ct=\E[3k:dc=\E[P:dl=\E[M:do=^J:ei=\E[4l:ho=\E[H:\
+ :ic=\E[@:im=\E[4h:\
+ :is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l:\
+ :k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:k5=\E[15~:\
+ :k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:\
+ :kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=^H:kd=\EOB:\
+ :ke=\E[?1l\E>:kh=\E[@:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\
+ :ku=\EOA:le=^H:md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:\
+ :r2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E<:\
+ :rc=\E8:sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:ta=^I:\
+ :te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:u6=\E[%d;%dR:\
+ :u7=\E[6n:u8=\E[?1;2c:u9=\E[c:ue=\E[m:up=\E[A:\
+ :us=\E[4m:
+xterm24|vs100-24|xterm terminal emulator (24 lines) (X11R6 window system):\
+ :co#80:li#24:\
+ :tc=xterm:
+xterm25|vs100-25|xterm terminal emulator (25 lines) (X11R6 window system):\
+ :co#80:li#24:\
+ :tc=xterm:
+xterms|vs100s|xterm terminal emulator (small) (X11R6 window system):\
+ :tc=xterm24:
diff --git a/distrib/sun3/common/ramdisk.list b/distrib/sun3/common/ramdisk.list
new file mode 100644
index 00000000000..3d8e29ec80a
--- /dev/null
+++ b/distrib/sun3/common/ramdisk.list
@@ -0,0 +1,21 @@
+# $NetBSD: ramdisk.list,v 1.1.1.1 1995/10/08 23:07:46 gwr Exp $
+
+# copy the MAKEDEV script and make some devices
+COPY ${DESTDIR}/dev/MAKEDEV dev/MAKEDEV
+SPECIAL cd dev; sh MAKEDEV std rd0 sd0 sd2 st0
+SPECIAL /bin/rm dev/MAKEDEV
+SPECIAL mkfifo dev/pipe
+SPECIAL ln -s . usr
+
+# various files that we need in /etc for the install
+
+COPY ${TOPDIR}/common/rd.disktab etc/disktab
+COPY ${TOPDIR}/common/rd.fstab etc/fstab
+COPY ${TOPDIR}/common/rd.protocols etc/protocols
+COPY ${TOPDIR}/common/rd.services etc/services
+COPY ${TOPDIR}/common/rd.passwd etc/passwd
+
+# and the RC file
+COPY ${TOPDIR}/common/rd.sshrc .sshrc
+COPY ${TOPDIR}/common/rd.welcome .welcome
+
diff --git a/distrib/sun3/common/ramdisk.tree b/distrib/sun3/common/ramdisk.tree
new file mode 100644
index 00000000000..a242e6aa48b
--- /dev/null
+++ b/distrib/sun3/common/ramdisk.tree
@@ -0,0 +1,39 @@
+#
+# $NetBSD: ramdisk.tree,v 1.1.1.1 1995/10/08 23:07:48 gwr Exp $
+#
+
+/set type=dir uname=root gname=wheel mode=0755
+# .
+.
+
+# ./bin
+bin
+# ./bin
+..
+
+# ./dev
+dev
+# ./dev
+..
+
+# ./etc
+etc
+# ./etc
+..
+
+# ./mnt
+mnt
+# ./mnt
+..
+
+# ./sbin
+sbin
+# ./sbin
+..
+
+# ./tmp
+tmp
+# ./tmp
+..
+
+# ./usr will be a link to root
diff --git a/distrib/sun3/common/rd.disktab b/distrib/sun3/common/rd.disktab
new file mode 100644
index 00000000000..76067644074
--- /dev/null
+++ b/distrib/sun3/common/rd.disktab
@@ -0,0 +1,2 @@
+# $NetBSD: rd.disktab,v 1.2 1995/10/13 16:38:29 gwr Exp $
+# The ramdisk has no need for disktab (yet)
diff --git a/distrib/sun3/common/rd.fstab b/distrib/sun3/common/rd.fstab
new file mode 100644
index 00000000000..78bfa72a8b0
--- /dev/null
+++ b/distrib/sun3/common/rd.fstab
@@ -0,0 +1,2 @@
+# $NetBSD: rd.fstab,v 1.2 1995/10/13 16:38:31 gwr Exp $
+/dev/rd0 / ufs rw 1 1
diff --git a/distrib/sun3/common/rd.passwd b/distrib/sun3/common/rd.passwd
new file mode 100644
index 00000000000..b524734954a
--- /dev/null
+++ b/distrib/sun3/common/rd.passwd
@@ -0,0 +1 @@
+root::0:0:NetBSD RAM-disk root:/root:/bin/sh
diff --git a/distrib/sun3/common/rd.protocols b/distrib/sun3/common/rd.protocols
new file mode 100644
index 00000000000..0a0432edded
--- /dev/null
+++ b/distrib/sun3/common/rd.protocols
@@ -0,0 +1,6 @@
+#
+# etc/protocols (ramdisk version)
+# $NetBSD: rd.protocols,v 1.1.1.1 1995/10/08 23:07:49 gwr Exp $
+#
+ip 0 IP
+icmp 1 ICMP
diff --git a/distrib/sun3/common/rd.services b/distrib/sun3/common/rd.services
new file mode 100644
index 00000000000..15e200020c7
--- /dev/null
+++ b/distrib/sun3/common/rd.services
@@ -0,0 +1,56 @@
+#
+# etc/services (ramdisk version)
+# $NetBSD: rd.services,v 1.1.1.1 1995/10/08 23:07:49 gwr Exp $
+#
+tcpmux 1/tcp
+echo 7/tcp
+echo 7/udp
+discard 9/tcp sink null
+discard 9/udp sink null
+systat 11/tcp users
+daytime 13/tcp
+daytime 13/udp
+netstat 15/tcp
+chargen 19/tcp ttytst source
+chargen 19/udp ttytst source
+ftp-data 20/tcp
+ftp 21/tcp
+telnet 23/tcp
+smtp 25/tcp mail
+time 37/tcp timserver
+time 37/udp timserver
+nameserver 42/tcp name # IEN 116
+whois 43/tcp nicname
+domain 53/tcp nameserver
+domain 53/udp nameserver
+bootps 67/udp
+bootpc 68/udp
+tftp 69/udp
+#
+rje 77/tcp netrjs
+finger 79/tcp
+link 87/tcp ttylink
+kerberos 88/tcp krb5 # Kerberos v5
+kerberos 88/udp
+supdup 95/tcp
+# 100 - reserved
+hostnames 101/tcp hostname
+iso-tsap 102/tcp tsap
+#
+sunrpc 111/tcp
+sunrpc 111/udp
+
+#
+# UNIX specific services
+#
+exec 512/tcp
+biff 512/udp comsat
+login 513/tcp
+who 513/udp whod
+shell 514/tcp cmd
+syslog 514/udp
+printer 515/tcp spooler
+talk 517/udp
+ntalk 518/udp
+route 520/udp router routed
+
diff --git a/distrib/sun3/common/rd.sshrc b/distrib/sun3/common/rd.sshrc
new file mode 100644
index 00000000000..1964fc43814
--- /dev/null
+++ b/distrib/sun3/common/rd.sshrc
@@ -0,0 +1,4 @@
+# .sshrc
+# $NetBSD: rd.sshrc,v 1.2 1995/10/13 16:38:34 gwr Exp $
+path /sbin:/bin
+run cat /.welcome
diff --git a/distrib/sun3/common/rd.welcome b/distrib/sun3/common/rd.welcome
new file mode 100644
index 00000000000..b0600385aa5
--- /dev/null
+++ b/distrib/sun3/common/rd.welcome
@@ -0,0 +1,24 @@
+
+ Welcome to the NetBSD/sun3 RAMDISK root!
+
+This environment is designed to do only three things:
+1: Partititon your disk (use the command: edlabel /dev/rsd0c)
+2: Copy a miniroot image into the swap partition (/dev/rsd0b)
+3: Reboot (using the swap partition, i.e. /dev/sd?b).
+
+Copying the miniroot can be done several ways, allowing
+the source of the miniroot image to be on any of these:
+ boot tape, NFS server, TFTP server, rsh server
+
+The easiest is loading from tape, which is done as follows:
+ mt -f /dev/nrst0 rewind
+ mt -f /dev/nrst0 fsf 1
+ dd bs=16k if=/dev/nrst0 of=/dev/rsd0b
+(For help with other methods, please see the install notes.)
+
+To reboot using the swap partition, first use "halt",
+then at the PROM monitor prompt use a command like:
+ b sd(0,0,1)netbsd -s
+ ^-- 1 selects the swap partition
+
+To view this message again, type: cat /.welcome
diff --git a/distrib/sun3/common/rd_bin.conf b/distrib/sun3/common/rd_bin.conf
new file mode 100644
index 00000000000..fa40e778c99
--- /dev/null
+++ b/distrib/sun3/common/rd_bin.conf
@@ -0,0 +1,83 @@
+#
+# $NetBSD: rd_bin.conf,v 1.1.1.1 1995/10/08 23:07:47 gwr Exp $
+#
+# common/rd_bin.conf - unified binary for the ramdisk.
+#
+# The ramdisk root has to stay small enough so the kernel
+# can be loaded in less than one megabyte of ram, including
+# uninitialized data (bss). Otherwise it will not work on
+# the Sun3/50. This is not too hard, because the ONLY
+# tools needed in this root are those that one might use
+# to initialize the disk label and copy a miniroot image
+# into the swap partiton. Everything else is done after
+# the machine is rebooted from the miniroot.
+#
+# Note that the "ln" directives below are not really about
+# filesystem links, but rather the ability of the resulting
+# crunched binary to select the right program when argv[0]
+# matches the names on right of the "ln prog" directive.
+# For example, the shell can be run with argv[0]="-sh"
+# (login shell convention) but no such file will exist.
+# Similarly, one may want to run "init" as "oinit"...
+#
+# Notes about what is included (or not) and why:
+#
+# Include mknod incase I forgot some device nodes...
+# Support copying miniroot from NFS, TFTP, or CDROM.
+# Need mount_ffs, mount_ufs to remount the ramdisk.
+#
+# Might use cat to look at files (it's small anyway).
+# Need for copying miniroot from tape: dd, mt
+# Keep to allow minor fixes: ln, mkdir, mv
+# Small and handy: cat, echo, pwd, sync
+#
+# Note: ssh has no "if", so "test" is useless. Also,
+# left out: cp, chmod, rm. The ramdisk does not really
+# need them, and they pull in fts_* from libc.
+#
+# Might use these to get the miniroot: rsh, tftp
+#
+# Assume gunzip can run elsewhere, i.e.:
+# rsh gzcat sun3.miniroot.gz
+# No need to extract archives either...
+#
+
+#
+# Here are all the programs, ordered by source location:
+
+# Special programs used to save space...
+#srcdirs /usr/src/distrib/utils
+srcdirs ../../utils
+progs init_s ssh tls
+ln init_s init oinit
+ln ssh sh
+ln ssh -sh # login shell (not actual file name)
+ln tls ls
+# These are built with special flags to save a little space.
+# The x_ prefix is just to make them unique among all srcdirs.
+progs x_dd x_ifconfig
+ln x_dd dd
+ln x_ifconfig ifconfig
+
+srcdirs /usr/src/sbin
+progs edlabel mknod mount
+progs mount_cd9660 mount_ffs mount_nfs
+progs reboot umount
+ln mount_ffs ffs mount_ufs ufs
+ln mount_nfs nfs
+ln mount_cd9660 cd9660
+ln reboot halt
+
+srcdirs /usr/src/bin
+progs cat echo ln mkdir mt mv pwd sync
+
+srcdirs /usr/src/usr.bin
+progs rsh tftp
+
+# srcdirs /usr/src/usr.sbin
+
+# srcdirs /usr/src/gnu/usr.bin
+# progs cpio, gzip, tar
+# ln gzip gzcat gunzip
+
+libs libhack.o -lutil
diff --git a/distrib/sun3/common/rd_bin.list b/distrib/sun3/common/rd_bin.list
new file mode 100644
index 00000000000..7c7c855d1f6
--- /dev/null
+++ b/distrib/sun3/common/rd_bin.list
@@ -0,0 +1,44 @@
+#
+# $NetBSD: rd_bin.list,v 1.2 1995/10/13 16:38:36 gwr Exp $
+#
+
+# copy the crunched binary, link to it, and kill it
+
+COPY ${OBJDIR}/rd_bin rd_bin
+
+# From /usr/src/distrib/utils:
+LINK rd_bin sbin/init
+LINK rd_bin sbin/ifconfig
+LINK rd_bin sbin/edlabel
+LINK rd_bin bin/dd
+LINK rd_bin bin/ls
+LINK rd_bin bin/rsh
+LINK rd_bin bin/sh
+LINK rd_bin bin/ssh
+LINK rd_bin bin/tftp
+
+# From /usr/src/sbin:
+LINK rd_bin sbin/halt
+LINK rd_bin sbin/mknod
+LINK rd_bin sbin/mount
+LINK rd_bin sbin/mount_cd9660
+LINK rd_bin sbin/mount_ffs
+LINK rd_bin sbin/mount_nfs
+LINK rd_bin sbin/mount_ufs
+LINK rd_bin sbin/reboot
+LINK rd_bin sbin/umount
+
+# From /usr/src/bin:
+LINK rd_bin bin/cat
+# LINK rd_bin bin/chmod
+# LINK rd_bin bin/cp
+LINK rd_bin bin/echo
+LINK rd_bin bin/ln
+LINK rd_bin bin/mkdir
+LINK rd_bin bin/mt
+LINK rd_bin bin/mv
+LINK rd_bin bin/pwd
+# LINK rd_bin bin/rm
+LINK rd_bin bin/sync
+
+SPECIAL rm rd_bin
diff --git a/distrib/sun3/common/rdsetroot.c b/distrib/sun3/common/rdsetroot.c
new file mode 100644
index 00000000000..ba0575c1f51
--- /dev/null
+++ b/distrib/sun3/common/rdsetroot.c
@@ -0,0 +1,230 @@
+/* $NetBSD: rdsetroot.c,v 1.2 1995/10/13 16:38:39 gwr Exp $ */
+
+/*
+ * Copyright (c) 1994 Gordon W. Ross
+ * 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. 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: rdsetroot.c,v 1.1 1995/10/18 08:37:51 deraadt Exp $
+ */
+
+/*
+ * Copy a ramdisk image into the space reserved for it.
+ * Kernel variables: rd_root_size, rd_root_image
+ */
+
+#include <sys/types.h>
+#include <sys/file.h>
+#include <sys/mman.h>
+
+#include <stdio.h>
+#include <a.out.h>
+
+extern off_t lseek();
+
+struct exec head;
+char *file;
+
+/* Virtual addresses of the symbols we frob. */
+long rd_root_image_va, rd_root_size_va;
+
+/* Offsets relative to start of data segment. */
+long rd_root_image_off, rd_root_size_off;
+
+/* value in the location at rd_root_size_off */
+int rd_root_size_val;
+
+/* pointers to pieces of mapped file */
+char *dataseg;
+
+/* and lengths */
+int data_len;
+int data_off;
+int data_pgoff;
+
+main(argc,argv)
+ char **argv;
+{
+ int fd, n;
+ int *ip;
+ char *cp;
+
+ if (argc < 2) {
+ printf("%s: missing file name\n", argv[0]);
+ exit(1);
+ }
+ file = argv[1];
+
+ fd = open(file, O_RDWR);
+ if (fd < 0) {
+ perror(file);
+ exit(1);
+ }
+
+ n = read(fd, &head, sizeof(head));
+ if (n < sizeof(head)) {
+ printf("%s: reading header\n", file);
+ exit(1);
+ }
+
+ if (N_BADMAG(head)) {
+ printf("%s: bad magic number\n");
+ exit(1);
+ }
+
+#ifdef DEBUG
+ printf(" text: %9d\n", head.a_text);
+ printf(" data: %9d\n", head.a_data);
+ printf(" bss: %9d\n", head.a_bss);
+ printf(" syms: %9d\n", head.a_syms);
+ printf("entry: 0x%08X\n", head.a_entry);
+ printf("trsiz: %9d\n", head.a_trsize);
+ printf("drsiz: %9d\n", head.a_drsize);
+#endif
+
+ if (head.a_syms <= 0) {
+ printf("%s: no symbols\n", file);
+ exit(1);
+ }
+ if (head.a_trsize ||
+ head.a_drsize)
+ {
+ printf("%s: has relocations\n");
+ exit(1);
+ }
+
+ find_rd_root_image(file);
+
+ /*
+ * Map in the whole data segment.
+ * The file offset needs to be page aligned.
+ */
+ data_off = N_DATOFF(head);
+ data_len = head.a_data;
+ /* align... */
+ data_pgoff = N_PAGSIZ(head) - 1;
+ data_pgoff &= data_off;
+ data_off -= data_pgoff;
+ data_len += data_pgoff;
+ /* map in in... */
+ dataseg = mmap(NULL, /* any address is ok */
+ data_len, /* length */
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED,
+ fd, data_off);
+ if ((long)dataseg == -1) {
+ printf("%s: can not map data seg\n", file);
+ perror(file);
+ exit(1);
+ }
+ dataseg += data_pgoff;
+
+ /*
+ * Find value in the location: rd_root_size
+ */
+ ip = (int*) (dataseg + rd_root_size_off);
+ rd_root_size_val = *ip;
+#ifdef DEBUG
+ printf("rd_root_size val: 0x%08X (%d blocks)\n",
+ rd_root_size_val, (rd_root_size_val >> 9));
+#endif
+
+ /*
+ * Copy the symbol table and string table.
+ */
+#ifdef DEBUG
+ printf("copying root image...\n");
+#endif
+ n = read(0, dataseg + rd_root_image_off,
+ rd_root_size_val);
+ if (n < 0) {
+ perror("read");
+ exit(1);
+ }
+
+ msync(dataseg - data_pgoff, data_len
+#ifdef sun
+ ,0
+#endif
+ );
+
+#ifdef DEBUG
+ printf("...copied %d bytes\n", n);
+#endif
+ close(fd);
+ exit(0);
+}
+
+
+/*
+ * Find locations of the symbols to patch.
+ */
+struct nlist wantsyms[] = {
+ { "_rd_root_size", 0 },
+ { "_rd_root_image", 0 },
+ { NULL, 0 },
+};
+
+find_rd_root_image(file)
+ char *file;
+{
+ int data_va;
+ int std_entry;
+
+ if (nlist(file, wantsyms)) {
+ printf("%s: no rd_root_image symbols?\n", file);
+ exit(1);
+ }
+ std_entry = N_TXTADDR(head) +
+ (head.a_entry & (N_PAGSIZ(head)-1));
+ data_va = N_DATADDR(head);
+ if (head.a_entry != std_entry) {
+ printf("%s: warning: non-standard entry point: 0x%08x\n",
+ file, head.a_entry);
+ printf("\texpecting entry=0x%X\n", std_entry);
+ data_va += (head.a_entry - std_entry);
+ }
+
+ rd_root_size_off = wantsyms[0].n_value - data_va;
+ rd_root_image_off = wantsyms[1].n_value - data_va;
+#ifdef DEBUG
+ printf(".data segment va: 0x%08X\n", data_va);
+ printf("rd_root_size va: 0x%08X\n", wantsyms[0].n_value);
+ printf("rd_root_image va: 0x%08X\n", wantsyms[1].n_value);
+ printf("rd_root_size off: 0x%08X\n", rd_root_size_off);
+ printf("rd_root_image off: 0x%08X\n", rd_root_image_off);
+#endif
+
+ /*
+ * Sanity check locations of db_* symbols
+ */
+ if (rd_root_image_off < 0 || rd_root_image_off >= head.a_data) {
+ printf("%s: rd_root_image not in data segment?\n", file);
+ exit(1);
+ }
+ if (rd_root_size_off < 0 || rd_root_size_off >= head.a_data) {
+ printf("%s: rd_root_size not in data segment?\n", file);
+ exit(1);
+ }
+}
diff --git a/distrib/sun3/miniroot/Makefile b/distrib/sun3/miniroot/Makefile
new file mode 100644
index 00000000000..b3defc8ae66
--- /dev/null
+++ b/distrib/sun3/miniroot/Makefile
@@ -0,0 +1,57 @@
+# $NetBSD: Makefile,v 1.2 1995/10/13 16:46:47 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/${IMAGE}.list
+
+MOUNT_POINT= /mnt
+DISKTYPE= miniroot
+BDEV= /dev/sd2b
+CDEV= /dev/rsd2b
+
+KERNEL=${SRCSYSDIR}/arch/sun3/compile/GENERIC/netbsd
+
+# These are all the parameters for the miniroot: (6MB)
+NBLKS= 12288
+# old format, minfree, opt, b/i trks, sects, cpg
+NEWFSARGS= -O -m 0 -o space -i 8192 -t 8 -u 32 -c 16
+
+${IMAGE}.fs: ${CBIN} do_mount do_files do_bootxx do_kernel do_umount
+ dd if=${CDEV} of=$@ bs=64b count=`expr ${NBLKS} / 64`
+
+# Only do these for the miniroot, not the ramdisk.
+do_bootxx:
+ sync ; sleep 1 ; sync
+ cd ${MOUNT_POINT} ;\
+ usr/mdec/installboot -v ufsboot usr/mdec/bootxx ${CDEV}
+
+# Copy the generic kernel
+do_kernel:
+ cp -p ${KERNEL} ${MOUNT_POINT}/netbsd
+
+# Do not delete this if I change my mind and kill make...
+.PRECIOUS: ${IMAGE}.fs
+
+# Rules used making ${IMAGE}.fs (do_*)
+.include "${TOP}/common/Make.fsimage"
+
+# Rules for making ${CBIN} ...
+.include "${TOP}/common/Make.crunch"
+
+clean cleandir:
+ -rm -f a.out core *.core *.o
+ -rm -f ${CLEANFILES}
+
+# Standard rules needed by the above...
+.include <bsd.obj.mk>
diff --git a/distrib/sun3/ramdisk/Findrefs b/distrib/sun3/ramdisk/Findrefs
new file mode 100644
index 00000000000..2a098b5df7a
--- /dev/null
+++ b/distrib/sun3/ramdisk/Findrefs
@@ -0,0 +1,12 @@
+#!/bin/sh
+# $NetBSD: Findrefs,v 1.2 1995/10/13 16:51:28 gwr Exp $
+
+# Small helper to find out who pulls in X
+
+[ "$1" ] || { echo "$0: match_string" ; exit 1; }
+
+for f in *.lo
+do
+ nm -p $f | grep "$1" && echo $f
+done
+
diff --git a/distrib/sun3/ramdisk/Makefile b/distrib/sun3/ramdisk/Makefile
new file mode 100644
index 00000000000..0a7294833bb
--- /dev/null
+++ b/distrib/sun3/ramdisk/Makefile
@@ -0,0 +1,61 @@
+# $NetBSD: Makefile,v 1.2 1995/10/13 16:51:30 gwr Exp $
+
+TOP= ${.CURDIR}/..
+
+# This include just sets REV=XX
+.include "${TOP}/Makefile.inc"
+
+IMAGE= ramdisk
+CBIN= rd_bin
+
+TREE= ${TOP}/common/${IMAGE}.tree
+
+LISTS= ${TOP}/common/${CBIN}.list \
+ ${TOP}/common/${IMAGE}.list
+
+MOUNT_POINT= /mnt
+DISKTYPE= rdroot
+BDEV= /dev/rd0
+CDEV?= /dev/rd0
+
+KERNEL=${SRCSYSDIR}/arch/sun3/compile/RAMDISK/netbsd
+
+# These are all the parameters for the root fs: (256K)
+NBLKS= 512
+# args: old fmt, 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
+
+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: ${CBIN} do_mount do_files do_umount
+ dd if=${CDEV} of=$@ count=${NBLKS}
+
+# Do not delete this if I change my mind and kill make...
+.PRECIOUS: ${IMAGE}.fs
+
+# Rules used making ${IMAGE}.fs (do_*)
+.include "${TOP}/common/Make.fsimage"
+
+# Rules for making ${CBIN} ...
+.include "${TOP}/common/Make.crunch"
+
+${CBIN} : libhack.o
+
+# Use stubs to eliminate some large stuff from libc
+HACKSRC=${TOP}/../utils/libhack
+.include "${HACKSRC}/Makefile.inc"
+
+clean cleandir:
+ -rm -f a.out core *.core *.o
+ -rm -f ${CLEANFILES}
+
+# Standard rules needed by the above...
+.include <bsd.obj.mk>
diff --git a/distrib/sun3/ramdisk/Showsyms b/distrib/sun3/ramdisk/Showsyms
new file mode 100644
index 00000000000..a854d3ce55c
--- /dev/null
+++ b/distrib/sun3/ramdisk/Showsyms
@@ -0,0 +1,9 @@
+#!/bin/sh
+# $NetBSD: Showsyms,v 1.2 1995/10/13 16:51:31 gwr Exp $
+# Small helper to print out symbols in a useful order.
+
+nm -n rd_bin.syms |grep -i ' a '
+nm -n rd_bin.syms |grep -i ' t '
+nm -n rd_bin.syms |grep -i ' d '
+nm -n rd_bin.syms |grep -i ' b '
+nm -p rd_bin.syms |grep -i ' c '