diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1997-04-13 17:17:57 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1997-04-13 17:17:57 +0000 |
commit | e326f4656f8b22aa36092753985a6f87e93d7579 (patch) | |
tree | 0db3f7e81182aab19cfe90387c29ab3103d48563 | |
parent | 091aa076e3981a6d671f839cff32f29a3070338a (diff) |
import of hp300's ramdisk stuff for i386.
merged w/ existing stuff...
awk nuked away from ramdisk, only MAKEDEV needs it.
21 files changed, 1403 insertions, 10 deletions
diff --git a/distrib/i386/floppies/inst-common/Makefile.inc b/distrib/i386/floppies/common/Makefile.inc index a8b0795d9a3..e62cfa6c7f5 100644 --- a/distrib/i386/floppies/inst-common/Makefile.inc +++ b/distrib/i386/floppies/common/Makefile.inc @@ -1,4 +1,4 @@ -# $Id: Makefile.inc,v 1.13 1997/01/25 09:16:39 deraadt Exp $ +# $Id: Makefile.inc,v 1.1 1997/04/13 17:17:43 mickey Exp $ # TOP is assumed to be defined by Makefile including this one. diff --git a/distrib/i386/floppies/inst-common/dot.commonutils b/distrib/i386/floppies/common/dot.commonutils index c7b605bc16a..d8c9e6e19bf 100644 --- a/distrib/i386/floppies/inst-common/dot.commonutils +++ b/distrib/i386/floppies/common/dot.commonutils @@ -1,4 +1,4 @@ -# $OpenBSD: dot.commonutils,v 1.7 1996/12/09 07:05:02 deraadt Exp $ +# $OpenBSD: dot.commonutils,v 1.1 1997/04/13 17:17:44 mickey Exp $ # # Copyright (c) 1994 Christopher G. Demetriou # All rights reserved. diff --git a/distrib/i386/floppies/inst-common/instbin-krb.conf b/distrib/i386/floppies/common/instbin-krb.conf index 3c113122631..7553945c612 100644 --- a/distrib/i386/floppies/inst-common/instbin-krb.conf +++ b/distrib/i386/floppies/common/instbin-krb.conf @@ -1,4 +1,4 @@ -# $OpenBSD: instbin-krb.conf,v 1.3 1997/02/09 16:48:12 deraadt Exp $ +# $OpenBSD: instbin-krb.conf,v 1.1 1997/04/13 17:17:44 mickey Exp $ # # instbin.conf - unified binary for the inst/upgr floppies # diff --git a/distrib/i386/floppies/inst-common/instbin.conf b/distrib/i386/floppies/common/instbin.conf index 42e6f2eb54f..baf0aca95f7 100644 --- a/distrib/i386/floppies/inst-common/instbin.conf +++ b/distrib/i386/floppies/common/instbin.conf @@ -1,4 +1,4 @@ -# $OpenBSD: instbin.conf,v 1.16 1997/02/09 16:48:14 deraadt Exp $ +# $OpenBSD: instbin.conf,v 1.1 1997/04/13 17:17:45 mickey Exp $ # # instbin.conf - unified binary for the inst/upgr floppies # diff --git a/distrib/i386/floppies/inst-common/list b/distrib/i386/floppies/common/list index bb4e50158c7..0caa2770b71 100644 --- a/distrib/i386/floppies/inst-common/list +++ b/distrib/i386/floppies/common/list @@ -1,4 +1,4 @@ -# $Id: list,v 1.12 1997/03/21 03:33:23 kstailey Exp $ +# $Id: list,v 1.1 1997/04/13 17:17:45 mickey Exp $ # copy the crunched binary, link to it, and kill it COPY ${OBJDIR}/instbin instbin diff --git a/distrib/i386/floppies/inst-common/mtree.conf b/distrib/i386/floppies/common/mtree.conf index 98872e02f86..c68e3d047fe 100644 --- a/distrib/i386/floppies/inst-common/mtree.conf +++ b/distrib/i386/floppies/common/mtree.conf @@ -1,4 +1,4 @@ -# $Id: mtree.conf,v 1.4 1996/09/23 09:18:29 deraadt Exp $ +# $Id: mtree.conf,v 1.1 1997/04/13 17:17:46 mickey Exp $ /set type=dir uname=root gname=wheel mode=0755 # . diff --git a/distrib/i386/floppies/common/rdsetroot.c b/distrib/i386/floppies/common/rdsetroot.c new file mode 100644 index 00000000000..5e43390413d --- /dev/null +++ b/distrib/i386/floppies/common/rdsetroot.c @@ -0,0 +1,229 @@ +/* $OpenBSD: rdsetroot.c,v 1.1 1997/04/13 17:17:46 mickey Exp $ */ +/* $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. + */ + +/* + * 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/i386/floppies/inst-common/termcap.pc3 b/distrib/i386/floppies/common/termcap.pc3 index feba9cc941d..feba9cc941d 100644 --- a/distrib/i386/floppies/inst-common/termcap.pc3 +++ b/distrib/i386/floppies/common/termcap.pc3 diff --git a/distrib/i386/floppies/inst/Makefile b/distrib/i386/floppies/inst/Makefile index 4d32f2c3ed8..4406f88d82a 100644 --- a/distrib/i386/floppies/inst/Makefile +++ b/distrib/i386/floppies/inst/Makefile @@ -1,8 +1,8 @@ -# $Id: Makefile,v 1.2 1996/09/21 07:03:13 deraadt Exp $ +# $Id: Makefile,v 1.3 1997/04/13 17:17:47 mickey Exp $ TOP= ${.CURDIR}/.. .include "${TOP}/Makefile.inc" IMAGE= inst${REV}.fs -.include "${TOP}/inst-common/Makefile.inc" +.include "${TOP}/common/Makefile.inc" diff --git a/distrib/i386/floppies/ramdisk/Makefile b/distrib/i386/floppies/ramdisk/Makefile new file mode 100644 index 00000000000..053c46cda79 --- /dev/null +++ b/distrib/i386/floppies/ramdisk/Makefile @@ -0,0 +1,77 @@ +# $OpenBSD: Makefile,v 1.1 1997/04/13 17:17:52 mickey Exp $ +# $NetBSD: Makefile,v 1.1 1995/07/18 04:13:06 briggs Exp $ + +TOP= ${.CURDIR}/.. + +.include "${TOP}/Makefile.inc" +IMAGE= miniroot-${REV}.fs +CRUNCHCONF?= ${.CURDIR}/${CBIN}.conf +BASE=miniroot + +MOUNT_POINT= /mnt1 +BDEV= /dev/rd0a +CDEV= /dev/rrd0a +RDEV= /dev/rd0c + +KERNEL= /sys/arch/i386/compile/RAMDISK/bsd + +all: ${CBIN} ${IMAGE} + @echo "all done" + +.include "Makefile.inc" + +DISKTYPE= rdroot +NBLKS= 4046 +# old format, minfree, opt, b/i trks, sects, cpg +NEWFSARGS= -t ffs -m 0 -o space -c 16 -i 4096 + +${IMAGE}: do_prep do_mount do_files do_umount_copy do_unconfig + mv -f ${IMAGE}.tmp ${IMAGE} + -if [ -e ${.CURDIR}/${__objdir}/rd.pid ] ; then \ + kill `cat ${.CURDIR}/${__objdir}/rd.pid`; \ + rm ${.CURDIR}/${__objdir}/rd.pid;\ + fi + +rdsetroot: ${TOP}/common/rdsetroot.c + ${HOSTCC} -DDEBUG -o rdsetroot ${TOP}/common/rdsetroot.c + +setroot: ${IMAGE} bsd + ${.CURDIR}/${__objdir}/rdsetroot bsd < ${IMAGE} + +bsd: ${KERNEL} + cp ${KERNEL} bsd + +writetape: + echo rewinding tape < /dev/rst0 + buffer -i /usr/mdec/stboot -o /dev/nrst0 + buffer -i /usr/mdec/bootst -o /dev/nrst0 + buffer -B -p75 -i bsd -o /dev/nrst0 + echo rewinding tape < /dev/rst0 + + +do_prep: ${CBIN} do_unconfig + sh ${.CURDIR}/start_rdconfig.sh ${RDEV} ${NBLKS} + disklabel -w -r ${RDEV} ${DISKTYPE} + +do_mount: + -newfs ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE} + mount ${BDEV} ${MOUNT_POINT} + +do_umount_copy: + @echo "" + @df -i ${MOUNT_POINT} + @echo "" + -umount ${MOUNT_POINT} + dd if=${CDEV} of=${IMAGE}.tmp bs=4b count=`expr ${NBLKS} / 4 ` + +do_unconfig: + -umount ${MOUNT_POINT} + -if [ -e ${.CURDIR}/${__objdir}/rd.pid ] ; then \ + kill `cat ${.CURDIR}/${__objdir}/rd.pid`; \ + rm ${.CURDIR}/${__objdir}/rd.pid; \ + fi + + +.PRECIOUS: ${IMAGE} + + diff --git a/distrib/i386/floppies/ramdisk/Makefile.inc b/distrib/i386/floppies/ramdisk/Makefile.inc new file mode 100644 index 00000000000..39090ce2cdc --- /dev/null +++ b/distrib/i386/floppies/ramdisk/Makefile.inc @@ -0,0 +1,32 @@ +# +# $OpenBSD: Makefile.inc,v 1.1 1997/04/13 17:17:52 mickey Exp $ +# $NetBSD: Makefile.inc,v 1.1 1995/07/18 04:13:14 briggs Exp $ +# + +# TOP is assumed to be defined by Makefile including this one. + +CBIN?= raminst +COMMONDIR= ${TOP}/ramdisk + +MOUNT_POINT?= ${TOP}/${BASE}/fs + +LISTS= ${COMMONDIR}/../common/list ${.CURDIR}/list +CRUNCHCONF?= ${COMMONDIR}/${CBIN}.conf +MTREE= ${COMMONDIR}/mtree.conf + +${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF} + crunchgen -D ${BSDSRCDIR} -L ${DESTDIR}/usr/lib ${CRUNCHCONF} + +${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c + make -f ${CBIN}.mk all + +do_files: + mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u + TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \ + TARGDIR=${MOUNT_POINT} sh ${TOP}/runlist.sh ${LISTS} + +clean cleandir: + /bin/rm -f core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache *.o *.lo *.c + +.include <bsd.obj.mk> +.include <bsd.subdir.mk> diff --git a/distrib/i386/floppies/ramdisk/disktab.preinstall b/distrib/i386/floppies/ramdisk/disktab.preinstall new file mode 100644 index 00000000000..5fe26a7d81c --- /dev/null +++ b/distrib/i386/floppies/ramdisk/disktab.preinstall @@ -0,0 +1,29 @@ +# 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/i386/floppies/ramdisk/dot.hdprofile b/distrib/i386/floppies/ramdisk/dot.hdprofile new file mode 100644 index 00000000000..047adae43a8 --- /dev/null +++ b/distrib/i386/floppies/ramdisk/dot.hdprofile @@ -0,0 +1,59 @@ +# $OpenBSD: dot.hdprofile,v 1.1 1997/04/13 17:17:53 mickey 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/bin:/usr/sbin:/ +export PATH +TERM=pc3 +export TERM + +umask 022 + +if [ "X${DONEPROFILE}" = "X" ]; then + DONEPROFILE=YES + + echo "Checking filesystems..." + fsck -y + + echo "Mounting filesystems..." + mount -a + mount -t kernfs /kern /kern + + # set up some sane defaults + echo 'erase ^?, werase ^W, kill ^U, intr ^C' + stty newcrt werase ^W intr ^C kill ^U erase ^? 9600 + echo '' + + # pull in the functions that people will use from the shell prompt. + . /.commonutils + . /.instutils + + echo "Follow the installation directions to install the OpenBSD" + echo "distribution sets." +fi diff --git a/distrib/i386/floppies/ramdisk/dot.instutils b/distrib/i386/floppies/ramdisk/dot.instutils new file mode 100644 index 00000000000..89acf73dcad --- /dev/null +++ b/distrib/i386/floppies/ramdisk/dot.instutils @@ -0,0 +1,156 @@ +# $OpenBSD: dot.instutils,v 1.1 1997/04/13 17:17:53 mickey 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=/dev + ETC=/etc + if [ ! -f /etc/fstab ]; then + DEV=/mnt/dev + ETC=/mnt/etc + fi + + echo "You will now be prompted for information about this" + echo "machine. If you hit return, the default answer (in" + echo "brackets) will be used." + + echo "" + echo -n "What is this machine's hostname? [unknown.host.domain] " + read hname + if [ "$hname" = "" ]; then + hname=unknown.host.domain + fi + echo $hname > ${ETC}/myname + proto_domain=`echo $hname | sed -e 's/[^.]*\.//'` + + echo "" + echo "What domain is this machine in (this is NOT its YP" + echo -n "domain name)? [$proto_domain] " + read dname + if [ "$dname" = "" ]; then + dname=$proto_domain + fi + + echo "" + if [ -e $ETC/sendmail.cf ]; then + echo "WARNING: A default sendmail.cf exists, and probably" + echo "needs to be tuned and/or replaced, to work properly at" + echo "your site!" + else + echo "WARNING: No default sendmail.cf installed. Did you" + echo "forget to install the 'etc' distribution?" + fi + + echo "127.0.0.1 localhost localhost.$dname" > ${ETC}/hosts + + echo "" + echo -n "Does this machine have an ethernet interface? [y] " + read resp + case "$resp" in + n*) + ;; + *) + intf= + while [ "$intf" = "" ]; do + echo -n "What is the primary interface name " + echo -n "(e.g. ed0, ep0, etc)? " + read intf + done + echo -n "What is the hostname for this interface? [$hname] " + read ifname + if [ "$ifname" = "" ]; then + ifname=$hname + fi + ifaddr= + while [ "$ifaddr" = "" ]; do + echo -n "What is the IP address associated with " + echo -n "interface ${intf}? " + read ifaddr + done + echo "$ifaddr $ifname `echo $ifname | sed -e s/\.$dname//`" \ + >> ${ETC}/hosts + + echo -n "Does this interface have a special netmask? [n] " + read resp + case "$resp" in + y*) + echo -n "What is the netmask? [0xffffff00] " + read ifnetmask + if [ "$ifnetmask" = "" ]; then + ifnetmask=0xffffff00 + fi + ;; + *) + ifnetmask= + ;; + esac + + echo -n "Does this interface need additional flags? [n] " + read resp + case "$resp" in + y*) + echo -n "What flags? [link0] " + read ifflags + if [ "$ifflags" = "" ]; then + ifflags=link0 + fi + ;; + *) + ifflags= + ;; + esac + echo "inet $ifname $ifnetmask $ifflags" > ${ETC}/hostname.$intf + + echo "" + echo -n "WARNING: if you have any more ethernet interfaces, " + echo "you will have to configure" + echo -n "them by hand. Read the comments in /etc/netstart to " + echo "learn how to do this." + ;; + esac + + echo "" + echo -n "Making device nodes (may take a while)..." + cd ${DEV} + sh MAKEDEV all + echo " done." + + sync + + echo "" + echo "If you haven't already installed a kernel on the hard drive" + echo "using your kernel-copy floppy, do so now. Kernel" + echo "installation instructions can be found in the" + echo "installation notes." +} diff --git a/distrib/i386/floppies/ramdisk/dot.profile b/distrib/i386/floppies/ramdisk/dot.profile new file mode 100644 index 00000000000..01ec15b13ce --- /dev/null +++ b/distrib/i386/floppies/ramdisk/dot.profile @@ -0,0 +1,56 @@ +# +# Copyright (c) 1994 Christopher G. Demetriou +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by Christopher G. Demetriou. +# 4. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $Id: dot.profile,v 1.1 1997/04/13 17:17:54 mickey Exp $ + +PATH=/sbin:/bin:/usr/bin:/usr/sbin:/ +export PATH +TERM=pc3 +export TERM + +umask 022 + +if [ "X${DONEPROFILE}" = "X" ]; then + DONEPROFILE=YES + + # set up some sane defaults + echo 'erase ^?, werase ^W, kill ^U, intr ^C' + stty newcrt werase ^W intr ^C kill ^U erase ^? 9600 + echo '' + + # mount the kern_fs so that we can examine the dmesg state + mount -t kernfs /kern /kern + + # pull in the functions that people will use from the shell prompt. + . /.commonutils + . /.instutils + + # run the installation script. + install +fi diff --git a/distrib/i386/floppies/ramdisk/install.md b/distrib/i386/floppies/ramdisk/install.md new file mode 100644 index 00000000000..7b9c47e3064 --- /dev/null +++ b/distrib/i386/floppies/ramdisk/install.md @@ -0,0 +1,638 @@ +#!/bin/sh +# $OpenBSD: install.md,v 1.1 1997/04/13 17:17:54 mickey 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. + +# OpenBSD installation script. +# In a perfect world, this would be a nice C program, with a reasonable +# user interface. + +DT=/etc/disktab # /etc/disktab +FSTABDIR=/mnt/etc # /mnt/etc +#DONTDOIT=echo + +VERSION=2.0 +FSTAB=${FSTABDIR}/fstab + +getresp() { + read resp + if [ "X$resp" = "X" ]; then + resp=$1 + fi +} + +echo "Welcome to the OpenBSD ${VERSION} installation program." +echo "" +echo "This program is will put OpenBSD on your hard disk. It is not" +echo "painless, but it could be worse. You'll be asked several questions," +echo "and it would probably be useful to have your disk's hardware" +echo "manual, the installation notes, and a calculator handy." +echo "" +echo "In particular, you will need to know some reasonably detailed" +echo "information about your disk's geometry, because there is currently" +echo "no way this this program can figure that information out." +echo "" +echo "As with anything which modifies your hard drive's contents, this" +echo "program can cause SIGNIFICANT data loss, and you are advised" +echo "to make sure your hard drive is backed up before beginning the" +echo "installation process." +echo "" +echo "Default answers are displyed in brackets after the questions." +echo "You can hit Control-C at any time to quit, but if you do so at a" +echo "prompt, you may have to hit return. Also, quitting in the middle of" +echo "installation may leave your system in an inconsistent state." +echo "" +echo -n "Proceed with installation? [n] " +getresp "n" +case "$resp" in +y*|Y*) + echo "Cool! Let's get to it..." + ;; +*) + echo "OK, then. Enter 'halt' at the prompt to halt the" + echo "machine. Once the machine has halted, remove the" + echo "floppy and press any key to reboot." + exit + ;; +esac + +echo "" +echo "To do the installation, you'll need to provide some information about" +echo "your disk." + +echo "OpenBSD can be installed on ST506, ESDI, IDE, or SCSI disks." +echo -n "What kind of disk will you be installing on? [SCSI] " +getresp "SCSI" +case "$resp" in +esdi|ESDI|st506|ST506) + drivetype=wd + echo -n "Does it support _automatic_ sector remapping? [y] " + getresp "y" + case "$resp" in + n*|N*) + sect_fwd="sf:" + ;; + *) + sect_fwd="" + ;; + esac +;; +ide|IDE) + drivetype=wd + sect_fwd="" + type=ST506 + ;; +scsi|SCSI) + drivetype=sd + sect_fwd="" + type=SCSI + ;; +esac + +# find out what units are possible for that disk, and query the user. +driveunits=`ls /dev/${drivetype}?a | sed -e 's,/dev/\(...\)a,\1,g'` +if [ "X${driveunits}" = "X" ]; then + echo "FATAL ERROR:" + echo "No devices for disks of type '${drivetype}'." + echo "This is probably a bug in the install disks." + echo "Exiting install program." + exit +fi +prefdrive=${drivetype}0 + +echo "The following ${drivetype}-type disks are supported by this" +echo "installation procedure:" +echo "${driveunits}" +echo "Note that they may not exist in _your_ machine; the list of" +echo "disks in your machine was printed when the system was booting." +while [ "X${drivename}" = "X" ]; do + echo -n "Which disk would like to install on? [${prefdrive}] " + getresp ${prefdrive} + otherdrives=`echo "${driveunits}" | sed -e s,${resp},,` + if [ "X${driveunits}" = "X${otherdrives}" ]; then + echo "\"${resp}\" is an invalid drive name. Valid choices" + echo "are: "${driveunits} + else + drivename=${resp} + fi +done + +echo "" +echo "Using disk ${drivename}." +echo -n "What kind of disk is it? (one word please) [my${drivetype}] " +getresp "my${drivetype}" +labelname=$resp + +echo "" +echo "You will now need to provide some information about your disk's" +echo "geometry. This should either be in the User's Manual for your disk," +echo "or you should have written down what OpenBSD printed when booting." +echo "(Note that he geometry that's printed at boot time is preferred.)" +echo "" +echo "You may choose to view the initial boot messages for your system" +echo "again right now if you like." +echo -n "View the boot messages again? [n] " +getresp "n" +case "$resp" in +y*|Y*) + less -rsS /kern/msgbuf + ;; +*) + echo "" + ;; +esac + +echo "You will now enter the disk geometry information" +echo "" + +bytes_per_sect=`cat /kern/msgbuf \ + | sed -n -e /^${drivename}:/p -e /^${drivename}:/q \ + | sed 's/\([^ ]*[ ]*\)\{8\}\([^ ]*\).*$/\2/'` +echo -n "Number of bytes per disk sector? [$bytes_per_sect] " +getresp $bytes_per_sect +bytes_per_sect="$resp" + +cyls_per_disk=`cat /kern/msgbuf \ + | sed -n -e /^${drivename}:/p -e /^${drivename}:/q \ + | sed 's/\([^ ]*[ ]*\)\{3\}\([^ ]*\).*$/\2/'` +echo -n "Number of disk cylinders? [$cyls_per_disk]" +getresp $cyls_per_disk +cyls_per_disk="$resp" + +tracks_per_cyl=`cat /kern/msgbuf \ + | sed -n -e /^${drivename}:/p -e /^${drivename}:/q \ + | sed 's/\([^ ]*[ ]*\)\{5\}\([^ ]*\).*$/\2/'` +echo -n "Number of disk tracks (heads) per disk cylinder? [$tracks_per_cyl]" +getresp $tracks_per_cyl +tracks_per_cyl="$resp" + +sects_per_track=`cat /kern/msgbuf \ + | sed -n -e /^${drivename}:/p -e /^${drivename}:/q \ + | sed 's/\([^ ]*[ ]*\)\{7\}\([^ ]*\).*$/\2/'` +echo -n "Number of disk sectors per disk track? [$sects_per_track]" +getresp $sects_per_track +sects_per_track="$resp" + +cylindersize=`expr $sects_per_track \* $tracks_per_cyl` +cylbytes=`expr $cylindersize \* $bytes_per_sect` +disksize=`expr $cylindersize \* $cyls_per_disk` + +echo "" +echo "Your disk has a total of $disksize $bytes_per_sect byte sectors," +echo "arranged as $cyls_per_disk cylinders which contain $cylindersize " +echo "sectors ($cylbytes bytes) each." +echo "" +echo "You can specify partition sizes in cylinders ('c') or sectors ('s')." +while [ "X${sizemult}" = "X" ]; do + echo -n "What units would you like to use? [cylinders] " + getresp cylinders + case "$resp" in + c*|C*) + sizemult=$cylindersize + sizeunit="cylinders" + maxdisk=$cyls_per_disk + ;; + s*|S*) + sizemult=1 + sizeunit="sectors" + maxdisk=$disksize; + ;; + *) + echo "Enter cylinders ('c') or sectors ('s')." + ;; + esac +done + +if [ $sizeunit = "sectors" ]; then + echo "For best disk performance or workable CHS-translating IDE systems," + echo "partitions should begin and end on cylinder boundaries. Wherever" + echo "possible, use multiples of the cylinder size ($cylindersize sectors)." +fi + +echo -n "" +echo -n "Size of OpenBSD portion of disk (in $sizeunit) ? [$maxdisk] " +getresp "$maxdisk" +partition=$resp +partition_sects=`expr $resp \* $sizemult` +part_offset=0 +if [ $partition_sects -lt $disksize ]; then + echo -n "Offset of OpenBSD portion of disk (in $sizeunit)? " + getresp + part_offset=$resp +fi +badspacesec=0 +if [ "$sect_fwd" = "sf:" ]; then + badspacecyl=`expr $sects_per_track + 126` + badspacecyl=`expr $badspacecyl + $cylindersize - 1` + badspacecyl=`expr $badspacecyl / $cylindersize` + badspacesec=`expr $badspacecyl \* $cylindersize` + echo "" + echo -n "Using $badspacesec sectors ($badspacecyl cylinders) for the " + echo "bad144 bad block table" +fi + +sects_left=`expr $partition_sects - $badspacesec` +units_left=`expr $sects_left / $sizemult` +echo "" +echo "There are $units_left $sizeunit left to allocate." +echo "" +root=0 +while [ $root -eq 0 ]; do + echo -n "Root partition size (in $sizeunit)? " + getresp + case $resp in + [1-9]*) + total=$resp + if [ $total -gt $units_left ]; then + echo -n "Root size is greater than remaining " + echo "free space on disk." + else + root=$resp + fi + ;; + esac +done +root_offset=$part_offset +part_used=`expr $root + $badspacesec / $sizemult` +units_left=`expr $partition - $part_used` +echo "" + +swap=0 +while [ $swap -eq 0 ]; do + echo "$units_left $sizeunit remaining in OpenBSD portion of disk." + echo -n "Swap partition size (in $sizeunit)? " + getresp + case $resp in + [1-9]*) + if [ $swap -gt $units_left ]; then + echo -n "Swap size is greater than remaining " + echo "free space on disk." + else + swap=$resp + fi + ;; + esac +done +swap_offset=`expr $root_offset + $root` +part_used=`expr $part_used + $swap` +echo "" + +fragsize=1024 +blocksize=8192 +$DONTDOIT fsck -t ffs /dev/rfd0a +$DONTDOIT mount -u /dev/fd0a / +cat /etc/disktab.preinstall > $DT +echo "" >> $DT +echo "$labelname|OpenBSD installation generated:\\" >> $DT +echo " :dt=${type}:ty=winchester:\\" >> $DT +echo -n " :nc#${cyls_per_disk}:ns#${sects_per_track}" >> $DT +echo ":nt#${tracks_per_cyl}:\\" >> $DT +echo " :se#${bytes_per_sect}:${sect_fwd}\\" >> $DT +_size=`expr $root \* $sizemult` +_offset=`expr $root_offset \* $sizemult` +echo -n " :pa#${_size}:oa#${_offset}" >> $DT +echo ":ta=4.2BSD:ba#${blocksize}:fa#${fragsize}:\\" >> $DT +_size=`expr $swap \* $sizemult` +_offset=`expr $swap_offset \* $sizemult` +echo " :pb#${_size}:ob#${_offset}:tb=swap:\\" >> $DT +echo " :pc#${disksize}:oc#0:\\" >> $DT + +echo "You will now have to enter information about any other partitions" +echo "to be created in the OpenBSD portion of the disk. This process will" +echo "be complete when you've filled up all remaining space in the OpenBSD" +echo "portion of the disk." + +while [ $part_used -lt $partition ]; do + part_size=0 + units_left=`expr $partition - $part_used` + while [ $part_size -eq 0 ]; do + echo "" + echo -n "$units_left $sizeunit remaining in OpenBSD portion of " + echo "the disk" + echo -n "Next partition size (in $sizeunit) [$units_left] ? " + getresp "$units_left" + case $resp in + [1-9]*) + total=`expr $part_used + $resp` + if [ $total -gt $partition ]; then + echo "That would make the parition too large to fit!" + else + part_size=$resp + part_used=$total + part_name="" + while [ "$part_name" = "" ]; do + echo -n "Mount point? " + getresp + part_name=$resp + done + fi + ;; + esac + done + # XXX we skip partition d to avoid user confusion + if [ "$ename" = "" ]; then + ename=$part_name + offset=`expr $part_offset + $root + $swap` + _size=`expr $part_size \* $sizemult` + _offset=`expr $offset \* $sizemult` + echo -n " :pe#${_size}:oe#${_offset}" >> $DT + echo ":te=4.2BSD:be#${blocksize}:fe#${fragsize}:\\" >> $DT + offset=`expr $offset + $part_size` + elif [ "$fname" = "" ]; then + fname=$part_name + _size=`expr $part_size \* $sizemult` + _offset=`expr $offset \* $sizemult` + echo -n " :pf#${_size}:of#${_offset}" >> $DT + echo ":tf=4.2BSD:bf#${blocksize}:ff#${fragsize}:\\" >> $DT + offset=`expr $offset + $part_size` + elif [ "$gname" = "" ]; then + gname=$part_name + _size=`expr $part_size \* $sizemult` + _offset=`expr $offset \* $sizemult` + echo -n " :pg#${_size}:og#${_offset}" >> $DT + echo ":tg=4.2BSD:bg#${blocksize}:fg#${fragsize}:\\" >> $DT + offset=`expr $offset + $part_size` + elif [ "$hname" = "" ]; then + hname=$part_name + _size=`expr $part_size \* $sizemult` + _offset=`expr $offset \* $sizemult` + echo -n " :ph#${_size}:oh#${_offset}" >> $DT + echo ":th=4.2BSD:bh#${blocksize}:fh#${fragsize}:\\" >> $DT + part_used=$partition + elif [ "$iname" = "" ]; then + iname=$part_name + _size=`expr $part_size \* $sizemult` + _offset=`expr $offset \* $sizemult` + echo -n " :pi#${_size}:oi#${_offset}" >> $DT + echo ":ti=4.2BSD:bi#${blocksize}:fi#${fragsize}:\\" >> $DT + part_used=$partition + elif [ "$jname" = "" ]; then + jname=$part_name + _size=`expr $part_size \* $sizemult` + _offset=`expr $offset \* $sizemult` + echo -n " :pj#${_size}:oj#${_offset}" >> $DT + echo ":tj=4.2BSD:bj#${blocksize}:fj#${fragsize}:\\" >> $DT + part_used=$partition + elif [ "$kname" = "" ]; then + kname=$part_name + _size=`expr $part_size \* $sizemult` + _offset=`expr $offset \* $sizemult` + echo -n " :pk#${_size}:ok#${_offset}" >> $DT + echo ":tk=4.2BSD:bk#${blocksize}:fk#${fragsize}:\\" >> $DT + part_used=$partition + elif [ "$lname" = "" ]; then + lname=$part_name + _size=`expr $part_size \* $sizemult` + _offset=`expr $offset \* $sizemult` + echo -n " :pl#${_size}:ol#${_offset}" >> $DT + echo ":tl=4.2BSD:bl#${blocksize}:fl#${fragsize}:\\" >> $DT + part_used=$partition + elif [ "$mname" = "" ]; then + mname=$part_name + _size=`expr $part_size \* $sizemult` + _offset=`expr $offset \* $sizemult` + echo -n " :pm#${_size}:om#${_offset}" >> $DT + echo ":tm=4.2BSD:bm#${blocksize}:fm#${fragsize}:\\" >> $DT + part_used=$partition + elif [ "$nname" = "" ]; then + nname=$part_name + _size=`expr $part_size \* $sizemult` + _offset=`expr $offset \* $sizemult` + echo -n " :pn#${_size}:on#${_offset}" >> $DT + echo ":tn=4.2BSD:bn#${blocksize}:fn#${fragsize}:\\" >> $DT + part_used=$partition + elif [ "$oname" = "" ]; then + oname=$part_name + _size=`expr $part_size \* $sizemult` + _offset=`expr $offset \* $sizemult` + echo -n " :po#${_size}:oo#${_offset}" >> $DT + echo ":to=4.2BSD:bo#${blocksize}:fo#${fragsize}:\\" >> $DT + part_used=$partition + elif [ "$pname" = "" ]; then + pname=$part_name + _size=`expr $part_size \* $sizemult` + _offset=`expr $offset \* $sizemult` + echo -n " :pp#${_size}:op#${_offset}" >> $DT + echo ":tp=4.2BSD:bp#${blocksize}:fp#${fragsize}:\\" >> $DT + part_used=$partition + fi +done +echo "" >> $DT +sync + +echo "" +echo "THIS IS YOUR LAST CHANCE!!!" +echo "" +echo -n "Are you SURE you want OpenBSD installed on your hard drive? (yes/no) " +answer="" +while [ "$answer" = "" ]; do + getresp + case $resp in + yes|YES) + echo "" + echo "Here we go..." + answer=yes + ;; + no|NO) + echo "" + echo -n "OK, then. enter 'halt' to halt the machine. " + echo "Once the machine has halted," + echo -n "remove the floppy, and press any key to " + echo "reboot." + exit + ;; + *) + echo -n "I want a yes or no answer... well? " + ;; + esac +done + +echo "" +echo -n "Labeling disk $drivename..." +$DONTDOIT disklabel -w -B $drivename $labelname +echo " done." + +if [ "$sect_fwd" = "sf:" ]; then + echo -n "Initializing bad144 badblock table..." + $DONTDOIT bad144 $drivename 0 + echo " done." +fi + +echo "Initializing root filesystem, and mounting..." +$DONTDOIT newfs /dev/r${drivename}a $name +$DONTDOIT mount -v /dev/${drivename}a /mnt +if [ "$ename" != "" ]; then + echo "" + echo "Initializing $ename filesystem, and mounting..." + $DONTDOIT newfs /dev/r${drivename}e $name + $DONTDOIT mkdir -p /mnt/$ename + $DONTDOIT mount -v /dev/${drivename}e /mnt/$ename +fi +if [ "$fname" != "" ]; then + echo "" + echo "Initializing $fname filesystem, and mounting..." + $DONTDOIT newfs /dev/r${drivename}f $name + $DONTDOIT mkdir -p /mnt/$fname + $DONTDOIT mount -v /dev/${drivename}f /mnt/$fname +fi +if [ "$gname" != "" ]; then + echo "" + echo "Initializing $gname filesystem, and mounting..." + $DONTDOIT newfs /dev/r${drivename}g $name + $DONTDOIT mkdir -p /mnt/$gname + $DONTDOIT mount -v /dev/${drivename}g /mnt/$gname +fi +if [ "$hname" != "" ]; then + echo "" + echo "Initializing $hname filesystem, and mounting..." + $DONTDOIT newfs /dev/r${drivename}h $name + $DONTDOIT mkdir -p /mnt/$hname + $DONTDOIT mount -v /dev/${drivename}h /mnt/$hname +fi +if [ "$iname" != "" ]; then + echo "" + echo "Initializing $iname filesystem, and mounting..." + $DONTDOIT newfs /dev/r${drivename}i $name + $DONTDOIT mkdir -p /mnt/$iname + $DONTDOIT mount -v /dev/${drivename}i /mnt/$iname +fi +if [ "$jname" != "" ]; then + echo "" + echo "Initializing $jname filesystem, and mounting..." + $DONTDOIT newfs /dev/r${drivename}j $name + $DONTDOIT mkdir -p /mnt/$jname + $DONTDOIT mount -v /dev/${drivename}j /mnt/$jname +fi +if [ "$kname" != "" ]; then + echo "" + echo "Initializing $kname filesystem, and mounting..." + $DONTDOIT newfs /dev/r${drivename}k $name + $DONTDOIT mkdir -p /mnt/$kname + $DONTDOIT mount -v /dev/${drivename}k /mnt/$kname +fi +if [ "$lname" != "" ]; then + echo "" + echo "Initializing $lname filesystem, and mounting..." + $DONTDOIT newfs /dev/r${drivename}l $name + $DONTDOIT mkdir -p /mnt/$lname + $DONTDOIT mount -v /dev/${drivename}l /mnt/$lname +fi +if [ "$mname" != "" ]; then + echo "" + echo "Initializing $mname filesystem, and mounting..." + $DONTDOIT newfs /dev/r${drivename}m $name + $DONTDOIT mkdir -p /mnt/$mname + $DONTDOIT mount -v /dev/${drivename}m /mnt/$mname +fi +if [ "$nname" != "" ]; then + echo "" + echo "Initializing $nname filesystem, and mounting..." + $DONTDOIT newfs /dev/r${drivename}n $name + $DONTDOIT mkdir -p /mnt/$nname + $DONTDOIT mount -v /dev/${drivename}n /mnt/$nname +fi +if [ "$oname" != "" ]; then + echo "" + echo "Initializing $oname filesystem, and mounting..." + $DONTDOIT newfs /dev/r${drivename}o $name + $DONTDOIT mkdir -p /mnt/$oname + $DONTDOIT mount -v /dev/${drivename}o /mnt/$oname +fi +if [ "$pname" != "" ]; then + echo "" + echo "Initializing $pname filesystem, and mounting..." + $DONTDOIT newfs /dev/r${drivename}p $name + $DONTDOIT mkdir -p /mnt/$pname + $DONTDOIT mount -v /dev/${drivename}p /mnt/$pname +fi + +echo "" +echo "Populating filesystems with bootstrapping binaries and config files" +$DONTDOIT tar -cXf - . | (cd /mnt ; tar -xpf - ) +$DONTDOIT cp /tmp/.hdprofile /mnt/.profile + +echo "" +echo -n "Creating an fstab..." +echo /dev/${drivename}a / ffs rw 1 1 | sed -e s,//,/, > $FSTAB +if [ "$ename" != "" ]; then + echo /dev/${drivename}e /$ename ffs rw 1 2 | sed -e s,//,/, >> $FSTAB +fi +if [ "$fname" != "" ]; then + echo /dev/${drivename}f /$fname ffs rw 1 3 | sed -e s,//,/, >> $FSTAB +fi +if [ "$gname" != "" ]; then + echo /dev/${drivename}g /$gname ffs rw 1 4 | sed -e s,//,/, >> $FSTAB +fi +if [ "$hname" != "" ]; then + echo /dev/${drivename}h /$hname ffs rw 1 5 | sed -e s,//,/, >> $FSTAB +fi +if [ "$iname" != "" ]; then + echo /dev/${drivename}i /$iname ffs rw 1 5 | sed -e s,//,/, >> $FSTAB +fi +if [ "$jname" != "" ]; then + echo /dev/${drivename}j /$jname ffs rw 1 5 | sed -e s,//,/, >> $FSTAB +fi +if [ "$kname" != "" ]; then + echo /dev/${drivename}k /$kname ffs rw 1 5 | sed -e s,//,/, >> $FSTAB +fi +if [ "$lname" != "" ]; then + echo /dev/${drivename}l /$lname ffs rw 1 5 | sed -e s,//,/, >> $FSTAB +fi +if [ "$mname" != "" ]; then + echo /dev/${drivename}m /$mname ffs rw 1 5 | sed -e s,//,/, >> $FSTAB +fi +if [ "$nname" != "" ]; then + echo /dev/${drivename}n /$nname ffs rw 1 5 | sed -e s,//,/, >> $FSTAB +fi +if [ "$oname" != "" ]; then + echo /dev/${drivename}o /$oname ffs rw 1 5 | sed -e s,//,/, >> $FSTAB +fi +if [ "$pname" != "" ]; then + echo /dev/${drivename}p /$pname ffs rw 1 5 | sed -e s,//,/, >> $FSTAB +fi + +sync +echo " done." + +echo "OK! The preliminary work of setting up your disk is now complete." +echo "" +echo "The remaining tasks are:" +echo "" +echo "To copy a OpenBSD kernel to the hard drive's root filesystem." +echo "Once accomplished, you can boot off the hard drive." +echo "" +echo "To load and install the OpenBSD distribution sets." +echo "Currently the hard drive's root filesystem is mounted on /mnt" +echo "" +echo "Consult the installation notes which will describe how to" +echo "install the distribution sets and kernel. Post-installation" +echo "configuration is also discussed therein." +echo "" +echo "GOOD LUCK!" +echo "" diff --git a/distrib/i386/floppies/ramdisk/list b/distrib/i386/floppies/ramdisk/list new file mode 100644 index 00000000000..548186db6dc --- /dev/null +++ b/distrib/i386/floppies/ramdisk/list @@ -0,0 +1,11 @@ +# $Id: list,v 1.1 1997/04/13 17:17:55 mickey Exp $ + +# the disktab explanation file +COPY disktab.preinstall etc/disktab.preinstall + +# and the installation tools +COPY dot.profile .profile +COPY dot.instutils .instutils +COPY install.md install +COPY dot.hdprofile tmp/.hdprofile +SPECIAL chmod 755 install diff --git a/distrib/i386/floppies/ramdisk/mtree.conf b/distrib/i386/floppies/ramdisk/mtree.conf new file mode 100644 index 00000000000..e042cb0ff01 --- /dev/null +++ b/distrib/i386/floppies/ramdisk/mtree.conf @@ -0,0 +1,77 @@ +# $Id: mtree.conf,v 1.1 1997/04/13 17:17:55 mickey 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 +.. + +# ./kern +kern +# ./kern +.. + +# ./sbin +sbin +# ./sbin +.. + +# ./tmp +tmp mode=01777 +# ./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/i386/floppies/ramdisk/raminst.conf b/distrib/i386/floppies/ramdisk/raminst.conf new file mode 100644 index 00000000000..bae23665c81 --- /dev/null +++ b/distrib/i386/floppies/ramdisk/raminst.conf @@ -0,0 +1,25 @@ +# $OpenBSD: raminst.conf,v 1.1 1997/04/13 17:17:55 mickey Exp $ +# +# instbin.conf - unified binary for the inst/upgr floppies +# + +srcdirs bin sbin usr.bin/less usr.bin usr.sbin gnu/usr.bin + +progs bad144 cat chmod chown chroot cp dd df disklabel ed expr fsck_ffs +progs ftp fdisk +progs ifconfig init less ln ls mkdir mknod mount mount_cd9660 +progs mount_ffs mount_msdos mount_nfs mount_kernfs +progs mv newfs pax pdksh ping pwd reboot rm route +progs sed shutdown slattach strings stty sync test tip umount +progs rsh restore gzip + +ln chown chgrp +ln fsck_ffs fsck +ln less more +ln pax tar +ln pdksh sh +ln pdksh -sh # init invokes the shell this way +ln test [ +ln reboot halt + +libs -ledit -lutil -ltermcap -lkrb -ldes -ll -lm diff --git a/distrib/i386/floppies/ramdisk/start_rdconfig.sh b/distrib/i386/floppies/ramdisk/start_rdconfig.sh new file mode 100644 index 00000000000..d22552b968e --- /dev/null +++ b/distrib/i386/floppies/ramdisk/start_rdconfig.sh @@ -0,0 +1,4 @@ +echo rdconfig ${1} ${2} +rdconfig ${1} ${2} & +echo $! >rd.pid + diff --git a/distrib/i386/floppies/upgr/Makefile b/distrib/i386/floppies/upgr/Makefile index 5d65dfba77a..6f78740dcce 100644 --- a/distrib/i386/floppies/upgr/Makefile +++ b/distrib/i386/floppies/upgr/Makefile @@ -1,8 +1,8 @@ -# $Id: Makefile,v 1.3 1995/12/14 07:00:15 deraadt Exp $ +# $Id: Makefile,v 1.4 1997/04/13 17:17:56 mickey Exp $ TOP= ${.CURDIR}/.. .include "${TOP}/Makefile.inc" IMAGE= upgr${REV}.fs -.include "${TOP}/inst-common/Makefile.inc" +.include "${TOP}/common/Makefile.inc" |