summaryrefslogtreecommitdiff
path: root/distrib/sun3/common
diff options
context:
space:
mode:
Diffstat (limited to 'distrib/sun3/common')
-rw-r--r--distrib/sun3/common/RunList.awk7
-rw-r--r--distrib/sun3/common/install.md262
-rw-r--r--distrib/sun3/common/mini_usr.conf5
-rw-r--r--distrib/sun3/common/mini_usr.list3
-rw-r--r--distrib/sun3/common/mini_xx.list9
-rw-r--r--distrib/sun3/common/mini_xx.mk27
-rw-r--r--distrib/sun3/common/miniroot.list31
-rw-r--r--distrib/sun3/common/miniroot.tree12
-rw-r--r--distrib/sun3/common/mr.profile9
-rw-r--r--distrib/sun3/common/rd.passwd2
-rw-r--r--distrib/sun3/common/rd.welcome2
-rw-r--r--distrib/sun3/common/rdsetroot.c2
12 files changed, 324 insertions, 47 deletions
diff --git a/distrib/sun3/common/RunList.awk b/distrib/sun3/common/RunList.awk
index e404a702c60..cdda1047921 100644
--- a/distrib/sun3/common/RunList.awk
+++ b/distrib/sun3/common/RunList.awk
@@ -1,4 +1,4 @@
-# $NetBSD: RunList.awk,v 1.1.1.1 1995/10/08 23:07:46 gwr Exp $
+# $NetBSD: RunList.awk,v 1.1.1.1.6.1 1996/08/29 03:10:58 gwr Exp $
BEGIN {
printf("cd ${CURDIR}\n");
@@ -18,6 +18,11 @@ $1 == "LINK" {
printf("(cd ${TARGDIR}; ln %s %s)\n", $2, $3);
next;
}
+$1 == "SYMLINK" {
+ printf("echo '%s'\n", $0);
+ printf("(cd ${TARGDIR}; rm -f %s; ln -s %s %s)\n", $3, $2, $3);
+ next;
+}
$1 == "SPECIAL" {
printf("echo '%s'\n", $0);
printf("(cd ${TARGDIR};");
diff --git a/distrib/sun3/common/install.md b/distrib/sun3/common/install.md
new file mode 100644
index 00000000000..bacf9d71ee9
--- /dev/null
+++ b/distrib/sun3/common/install.md
@@ -0,0 +1,262 @@
+# $NetBSD: install.md,v 1.2.2.1 1996/08/29 03:33:48 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="xbin xman xinc xcon" XXX
+MDSETS=""
+
+md_set_term() {
+ if [ ! -z "$TERM" ]; then
+ return
+ fi
+ echo -n "Specify terminal type [sun]: "
+ getresp "sun"
+ TERM="$resp"
+ export TERM
+}
+
+__mount_kernfs() {
+ # Make sure kernfs is mounted.
+ if [ ! -d /kern -o ! -e /kern/msgbuf ]; then
+ mkdir /kern > /dev/null 2>&1
+ /sbin/mount_kernfs /kern /kern >/dev/null 2>&1
+ fi
+}
+
+md_makerootwritable() {
+ # Just remount the root device read-write.
+ if [ ! -e /tmp/.root_writable ]; then
+ __mount_kernfs
+ echo "Remounting root read-write..."
+ mount -u /kern/rootdev /
+ cp /dev/null /tmp/.root_writable
+ fi
+}
+
+md_get_diskdevs() {
+ # return available disk devices
+ __mount_kernfs
+ sed -n -e '/^sd[0-9] /s/ .*//p' \
+ -e '/^xd[0-9] /s/ .*//p' \
+ -e '/^xy[0-9] /s/ .*//p' \
+ < /kern/msgbuf | sort -u
+}
+
+md_get_cddevs() {
+ # return available CDROM devices
+ __mount_kernfs
+ sed -n -e '/^cd[0-9] /s/ .*//p' \
+ < /kern/msgbuf | sort -u
+}
+
+md_get_ifdevs() {
+ # return available network devices
+ __mount_kernfs
+ sed -n -e '/^ie[0-9] /s/ .*//p' \
+ -e '/^le[0-9] /s/ .*//p' \
+ < /kern/msgbuf | sort -u
+}
+
+md_get_partition_range() {
+ # return an expression describing the valid partition id's
+ echo '[a-h]'
+}
+
+md_installboot() {
+ # install the boot block on disk $1
+ echo "Installing boot block..."
+ ( cd /usr/mdec ;\
+ cp -p ./ufsboot /mnt/ufsboot ;\
+ sync ; sleep 1 ; sync ;\
+ ./installboot -v /mnt/ufsboot bootxx /dev/r${1}a )
+ echo "done."
+}
+
+md_native_fstype() {
+}
+
+md_native_fsopts() {
+}
+
+md_checkfordisklabel() {
+ # $1 is the disk to check
+ local rval
+
+ disklabel $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
+}
+
+md_prep_disklabel()
+{
+ local _disk
+
+ _disk=$1
+ md_checkfordisklabel $_disk
+ case $? in
+ 0)
+ echo -n "Do you wish to edit the disklabel on $_disk? [y]"
+ ;;
+ 1)
+ echo "WARNING: Disk $_disk has no label"
+ echo -n "Do you want to create one with the disklabel editor? [y]"
+ ;;
+ 2)
+ echo "WARNING: Label on disk $_disk is corrupted"
+ echo -n "Do you want to try and repair the damage using the disklabel editor? [y]"
+ ;;
+ esac
+
+ getresp "y"
+ case "$resp" in
+ y*|Y*) ;;
+ *) return ;;
+ esac
+
+ # display example
+ cat << \__md_prep_disklabel_1
+
+Here is an example of what the partition information will look like once
+you have entered the disklabel editor. Disk partition sizes and offsets
+are in sector (most likely 512 bytes) units. Make sure these size/offset
+pairs are on cylinder boundaries (the number of sector per cylinder is
+given in the `sectors/cylinder' entry, which is not shown here).
+
+Do not change any parameters except the partition layout and the label name.
+It's probably also wisest not to touch the `8 partitions:' line, even
+in case you have defined less than eight partitions.
+
+[Example]
+8 partitions:
+# size offset fstype [fsize bsize cpg]
+ a: 50176 0 4.2BSD 1024 8192 16 # (Cyl. 0 - 111)
+ b: 64512 50176 swap # (Cyl. 112 - 255)
+ c: 640192 0 unknown # (Cyl. 0 - 1428)
+ d: 525504 114688 4.2BSD 1024 8192 16 # (Cyl. 256 - 1428)
+[End of example]
+
+__md_prep_disklabel_1
+ echo -n "Press [Enter] to continue "
+ getresp ""
+ edlabel /dev/r${_disk}c
+}
+
+md_copy_kernel() {
+ echo -n "Copying kernel..."
+ cp -p /netbsd /mnt/netbsd
+ echo "done."
+}
+
+md_welcome_banner() {
+ if [ "$MODE" = "install" ]; then
+ echo ""
+ echo "Welcome to the NetBSD/sun3 ${VERSION} installation program."
+ cat << \__welcome_banner_1
+
+This program is designed to help you put NetBSD on your disk,
+in a simple and rational way. You'll be asked several questions,
+and it would probably be useful to have your disk's hardware
+manual, the installation notes, and a calculator handy.
+__welcome_banner_1
+
+ else
+ echo ""
+ echo "Welcome to the NetBSD/sun3 ${VERSION} upgrade program."
+ cat << \__welcome_banner_2
+
+This program is designed to help you upgrade your NetBSD 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
+}
+
+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() {
+ local what;
+ if [ "$MODE" = "install" ]; then
+ what="installed";
+ else
+ what="upgraded";
+ fi
+ cat << __congratulations_1
+
+CONGRATULATIONS! You have successfully $what NetBSD!
+To boot the installed system, enter halt at the command prompt. Once the
+system has halted, reset the machine and boot from the disk.
+
+__congratulations_1
+}
diff --git a/distrib/sun3/common/mini_usr.conf b/distrib/sun3/common/mini_usr.conf
index 330de168a4e..19d71c28dc3 100644
--- a/distrib/sun3/common/mini_usr.conf
+++ b/distrib/sun3/common/mini_usr.conf
@@ -1,5 +1,5 @@
#
-# $NetBSD: mini_usr.conf,v 1.2 1995/11/21 21:18:59 gwr Exp $
+# $NetBSD: mini_usr.conf,v 1.2.6.1 1996/08/29 03:12:10 gwr Exp $
#
# common/mini_usr.conf
#
@@ -23,5 +23,8 @@ srcdirs usr.bin
progs basename chflags cksum cmp cut ftp
progs rsh sed strings tftp
+srcdirs gnu/usr.bin
+progs sort
+
ln chown chgrp
diff --git a/distrib/sun3/common/mini_usr.list b/distrib/sun3/common/mini_usr.list
index a05b8a6fadb..1c3a2e6b417 100644
--- a/distrib/sun3/common/mini_usr.list
+++ b/distrib/sun3/common/mini_usr.list
@@ -1,5 +1,5 @@
#
-# $NetBSD: mini_usr.list,v 1.2 1995/11/21 21:19:00 gwr Exp $
+# $NetBSD: mini_usr.list,v 1.2.6.1 1996/08/29 03:12:45 gwr Exp $
#
# copy the crunched binary, link to it, and kill it
@@ -30,6 +30,7 @@ LINK mini_usr usr/bin/cut
LINK mini_usr usr/bin/ftp
LINK mini_usr usr/bin/rsh
LINK mini_usr usr/bin/sed
+LINK mini_usr usr/bin/sort
LINK mini_usr usr/bin/strings
LINK mini_usr usr/bin/tftp
diff --git a/distrib/sun3/common/mini_xx.list b/distrib/sun3/common/mini_xx.list
index ec1fa44fe12..5e893891123 100644
--- a/distrib/sun3/common/mini_xx.list
+++ b/distrib/sun3/common/mini_xx.list
@@ -1,17 +1,16 @@
#
-# $NetBSD: mini_xx.list,v 1.1 1995/11/21 21:19:01 gwr Exp $
+# $NetBSD: mini_xx.list,v 1.1.6.1 1996/08/29 03:14:53 gwr Exp $
# Build -static versions of some programs.
#
# These were re-linked with -static locally:
-COPY ${OBJDIR}/awk usr/bin
-
COPY ${OBJDIR}/grep usr/bin
LINK usr/bin/grep usr/bin/egrep
LINK usr/bin/grep usr/bin/fgrep
-COPY ${OBJDIR}/more usr/bin
+COPY ${OBJDIR}/less usr/bin
+LINK usr/bin/less usr/bin/more
COPY ${OBJDIR}/tip usr/bin
@@ -19,7 +18,7 @@ COPY ${OBJDIR}/vi usr/bin
# These are normally -static so just copy:
-COPY ${DESTDIR}/bin/tar bin
+COPY ${DESTDIR}/usr/bin/tar usr/bin
COPY ${DESTDIR}/usr/bin/gzip usr/bin
LINK usr/bin/gzip usr/bin/gunzip
diff --git a/distrib/sun3/common/mini_xx.mk b/distrib/sun3/common/mini_xx.mk
index d3d2b12c739..6d430d07737 100644
--- a/distrib/sun3/common/mini_xx.mk
+++ b/distrib/sun3/common/mini_xx.mk
@@ -1,37 +1,30 @@
#
-# $NetBSD: mini_xx.mk,v 1.1 1995/11/21 21:19:04 gwr Exp $
+# $NetBSD: mini_xx.mk,v 1.1.6.1 1996/08/29 03:17:15 gwr Exp $
# Hacks for re-linking some programs -static
#
-MINI_XX = awk grep more tip vi
+MINI_XX = grep less tip vi
mini_xx : ${MINI_XX}
clean_xx:
- -rm -f mini_xx ${MINI_XX}
+ -rm -f ${MINI_XX}
-awk : FORCE
- cd ${BSDSRCDIR}/gnu/usr.bin/gawk ;\
- $(MAKE) -f Makefile -f ${TOP}/common/Make.static \
- OUTDIR=${.CURDIR} ${.CURDIR}/awk
-
-grep : FORCE
+grep :
cd ${BSDSRCDIR}/gnu/usr.bin/grep ;\
$(MAKE) -f Makefile -f ${TOP}/common/Make.static \
OUTDIR=${.CURDIR} ${.CURDIR}/grep
-more : FORCE
- cd ${BSDSRCDIR}/usr.bin/more ;\
+less :
+ cd ${BSDSRCDIR}/usr.bin/less/less ;\
$(MAKE) -f Makefile -f ${TOP}/common/Make.static \
- OUTDIR=${.CURDIR} ${.CURDIR}/more
+ OUTDIR=${.CURDIR} ${.CURDIR}/less
-tip : FORCE
+tip :
cd ${BSDSRCDIR}/usr.bin/tip ;\
$(MAKE) -f Makefile -f ${TOP}/common/Make.static \
OUTDIR=${.CURDIR} ${.CURDIR}/tip
-vi : FORCE
- cd ${BSDSRCDIR}/usr.bin/vi/common ;\
+vi :
+ cd ${BSDSRCDIR}/usr.bin/vi/build ;\
$(MAKE) -f Makefile -f ${TOP}/common/Make.static \
OUTDIR=${.CURDIR} ${.CURDIR}/vi
-
-FORCE:
diff --git a/distrib/sun3/common/miniroot.list b/distrib/sun3/common/miniroot.list
index 31648f8c2ca..2b6e7f42114 100644
--- a/distrib/sun3/common/miniroot.list
+++ b/distrib/sun3/common/miniroot.list
@@ -1,4 +1,4 @@
-# $NetBSD: miniroot.list,v 1.2 1995/11/21 21:19:05 gwr Exp $
+# $NetBSD: miniroot.list,v 1.2.6.1 1996/08/29 03:19:32 gwr Exp $
# These are scripts:
COPY ${DESTDIR}/usr/bin/false bin
@@ -13,9 +13,7 @@ COPY ${DESTDIR}/usr/mdec/ufsboot usr/mdec
LINK usr/mdec/ufsboot ufsboot
# various files that we need in /etc for the install
-COPY ${DESTDIR}/etc/disktab etc
COPY ${DESTDIR}/etc/group etc
-COPY ${DESTDIR}/etc/hosts etc
COPY ${DESTDIR}/etc/master.passwd etc
COPY ${DESTDIR}/etc/passwd etc
COPY ${DESTDIR}/etc/protocols etc
@@ -23,18 +21,27 @@ COPY ${DESTDIR}/etc/pwd.db etc
COPY ${DESTDIR}/etc/services etc
COPY ${DESTDIR}/etc/spwd.db etc
+# some /etc files get special handling (for MFS /tmp yuck)
+COPY ${DESTDIR}/etc/disktab etc/disktab.shadow
+SYMLINK /tmp/disktab.shadow etc/disktab
+SYMLINK /tmp/fstab.shadow etc/fstab
+SYMLINK /tmp/resolv.conf.shadow etc/resolv.conf
+SYMLINK /tmp/hosts etc/hosts
+
# 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
+COPY ${DESTDIR}/dev/MAKEDEV dev
+COPY ${DESTDIR}/dev/MAKEDEV.local dev
+SPECIAL cd dev; sh MAKEDEV all
-# and the miniroot installation tools
+# copy the miniroot installation tools
COPY ${TOPDIR}/common/mr.profile .profile
-COPY ${TOPDIR}/common/mr.remount .remount
COPY ${TOPDIR}/common/mr.termcap usr/share/misc/termcap
-# and the "install" command
-COPY ${TOPDIR}/common/install.sh install
-SPECIAL chmod 755 install
+COPY ${TOPDIR}/common/install.md install.md
+COPY ${OBJDIR}/install.sub install.sub
+SPECIAL chmod 644 install.md install.sub
+
+COPY ${TOPDIR}/../miniroot/install.sh install
+COPY ${TOPDIR}/../miniroot/upgrade.sh upgrade
+SPECIAL chmod 755 install upgrade
diff --git a/distrib/sun3/common/miniroot.tree b/distrib/sun3/common/miniroot.tree
index cedeac867ab..beb75ee2027 100644
--- a/distrib/sun3/common/miniroot.tree
+++ b/distrib/sun3/common/miniroot.tree
@@ -1,5 +1,5 @@
#
-# $NetBSD: miniroot.tree,v 1.2 1995/11/21 21:19:07 gwr Exp $
+# $NetBSD: miniroot.tree,v 1.2.6.1 1996/08/29 03:20:18 gwr Exp $
#
/set type=dir uname=root gname=wheel mode=0755
@@ -21,6 +21,11 @@ etc
# ./etc
..
+# ./kern
+kern
+# ./kern
+..
+
# ./mnt
mnt
# ./mnt
@@ -31,6 +36,11 @@ mnt2
# ./mnt2
..
+# ./proc
+proc
+# ./proc
+..
+
# ./sbin
sbin
# ./sbin
diff --git a/distrib/sun3/common/mr.profile b/distrib/sun3/common/mr.profile
index e99ca75fa85..87f94f9897a 100644
--- a/distrib/sun3/common/mr.profile
+++ b/distrib/sun3/common/mr.profile
@@ -1,5 +1,5 @@
-# $OpenBSD: mr.profile,v 1.3 1996/04/25 21:31:46 niklas Exp $
-# $NetBSD: mr.profile,v 1.2 1995/11/21 21:19:08 gwr Exp $
+#
+# $NetBSD: mr.profile,v 1.2.6.1 1996/08/29 03:21:13 gwr Exp $
#
# Copyright (c) 1995 Jason R. Thorpe
# Copyright (c) 1994 Christopher G. Demetriou
@@ -48,11 +48,8 @@ update
# get the terminal type?
# (nah, ansi is good enough)
-# remount root
-sh /.remount
-
# run the installation script.
-echo 'To install OpenBSD, enter the command: install'
+echo 'To install NetBSD, enter the command: install'
echo 'Otherwise, enter the command: halt'
# /install XXX - Not yet...
diff --git a/distrib/sun3/common/rd.passwd b/distrib/sun3/common/rd.passwd
index 9e1644a7235..b524734954a 100644
--- a/distrib/sun3/common/rd.passwd
+++ b/distrib/sun3/common/rd.passwd
@@ -1 +1 @@
-root::0:0:OpenBSD RAM-disk root:/root:/bin/sh
+root::0:0:NetBSD RAM-disk root:/root:/bin/sh
diff --git a/distrib/sun3/common/rd.welcome b/distrib/sun3/common/rd.welcome
index 4888456008a..9c1cf8fa3b2 100644
--- a/distrib/sun3/common/rd.welcome
+++ b/distrib/sun3/common/rd.welcome
@@ -1,5 +1,5 @@
- Welcome to the OpenBSD/sun3 RAMDISK root!
+ 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)
diff --git a/distrib/sun3/common/rdsetroot.c b/distrib/sun3/common/rdsetroot.c
index ba0575c1f51..c9f47e56903 100644
--- a/distrib/sun3/common/rdsetroot.c
+++ b/distrib/sun3/common/rdsetroot.c
@@ -26,7 +26,7 @@
* (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 $
+ * $Id: rdsetroot.c,v 1.2 1996/09/05 21:27:30 deraadt Exp $
*/
/*